@@ -475,13 +475,6 @@ func writeTemplates(dir, gopkg, debsrc, debbin, debversion, pkgType string, depe
475
475
getDebianEmail (),
476
476
time .Now ().Format ("Mon, 02 Jan 2006 15:04:05 -0700" ))
477
477
478
- f , err = os .Create (filepath .Join (dir , "debian" , "compat" ))
479
- if err != nil {
480
- return err
481
- }
482
- defer f .Close ()
483
- fmt .Fprintf (f , "11\n " )
484
-
485
478
f , err = os .Create (filepath .Join (dir , "debian" , "control" ))
486
479
if err != nil {
487
480
return err
@@ -492,11 +485,18 @@ func writeTemplates(dir, gopkg, debsrc, debbin, debversion, pkgType string, depe
492
485
fmt .Fprintf (f , "Section: devel\n " )
493
486
fmt .Fprintf (f , "Priority: optional\n " )
494
487
fmt .
Fprintf (
f ,
"Maintainer: Debian Go Packaging Team <[email protected] >\n " )
495
- fmt .Fprintf (f , "Uploaders: %s <%s>\n " , getDebianName (), getDebianEmail ())
496
- sort .Strings (dependencies )
497
- builddeps := append ([]string {"debhelper (>= 11)" , "dh-golang" , "golang-any" }, dependencies ... )
498
- fmt .Fprintf (f , "Build-Depends: %s\n " , strings .Join (builddeps , ",\n " ))
499
- fmt .Fprintf (f , "Standards-Version: 4.2.1\n " )
488
+ fmt .Fprintf (f , "Uploaders:\n %s <%s>,\n " , getDebianName (), getDebianEmail ())
489
+ fmt .Fprintf (f , "Rules-Requires-Root: no\n " )
490
+ builddeps := []string {"debhelper-compat (= 12)" , "dh-golang" }
491
+ builddeps_bytype := append ([]string {"golang-any" }, dependencies ... )
492
+ sort .Strings (builddeps_bytype )
493
+ fmt .Fprintf (f , "Build-Depends:\n %s,\n " , strings .Join (builddeps , ",\n " ))
494
+ builddeps_deptype := "Indep"
495
+ if pkgType == "program" {
496
+ builddeps_deptype = "Arch"
497
+ }
498
+ fmt .Fprintf (f , "Build-Depends-%s:\n %s,\n " , builddeps_deptype , strings .Join (builddeps_bytype , ",\n " ))
499
+ fmt .Fprintf (f , "Standards-Version: 4.3.0\n " )
500
500
fmt .Fprintf (f , "Homepage: %s\n " , getHomepageForGopkg (gopkg ))
501
501
fmt .Fprintf (f , "Vcs-Browser: https://salsa.debian.org/go-team/packages/%s\n " , debsrc )
502
502
fmt .Fprintf (f , "Vcs-Git: https://salsa.debian.org/go-team/packages/%s.git\n " , debsrc )
@@ -513,7 +513,8 @@ func writeTemplates(dir, gopkg, debsrc, debbin, debversion, pkgType string, depe
513
513
fmt .Fprintf (f , "Architecture: all\n " )
514
514
deps = append (deps , dependencies ... )
515
515
}
516
- fmt .Fprintf (f , "Depends: %s\n " , strings .Join (deps , ",\n " ))
516
+ sort .Strings (deps )
517
+ fmt .Fprintf (f , "Depends:\n %s,\n " , strings .Join (deps , ",\n " ))
517
518
description , err := getDescriptionForGopkg (gopkg )
518
519
if err != nil {
519
520
log .Printf ("Could not determine description for %q: %v\n " , gopkg , err )
@@ -544,20 +545,20 @@ func writeTemplates(dir, gopkg, debsrc, debbin, debversion, pkgType string, depe
544
545
copyright = "TODO"
545
546
}
546
547
fmt .Fprintf (f , "Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\n " )
547
- fmt .Fprintf (f , "Upstream-Name: %s\n " , filepath .Base (gopkg ))
548
548
fmt .Fprintf (f , "Source: %s\n " , getHomepageForGopkg (gopkg ))
549
+ fmt .Fprintf (f , "Upstream-Name: %s\n " , filepath .Base (gopkg ))
549
550
fmt .Fprintf (f , "Files-Excluded:\n " )
550
551
for _ , dir := range vendorDirs {
551
- fmt .Fprintf (f , " %s\n " , dir )
552
+ fmt .Fprintf (f , " %s\n " , dir )
552
553
}
553
- fmt .Fprintf (f , " Godeps/_workspace\n " )
554
+ fmt .Fprintf (f , " Godeps/_workspace\n " )
554
555
fmt .Fprintf (f , "\n " )
555
- fmt .Fprintf (f , "Files: *\n " )
556
- fmt .Fprintf (f , "Copyright: %s\n " , copyright )
556
+ fmt .Fprintf (f , "Files:\n *\n " )
557
+ fmt .Fprintf (f , "Copyright:\n %s\n " , copyright )
557
558
fmt .Fprintf (f , "License: %s\n " , license )
558
559
fmt .Fprintf (f , "\n " )
559
- fmt .Fprintf (f , "Files: debian/*\n " )
560
- fmt .Fprintf (f , "Copyright: %s %s <%s>\n " , time .Now ().Format ("2006" ), getDebianName (), getDebianEmail ())
560
+ fmt .Fprintf (f , "Files:\n debian/*\n " )
561
+ fmt .Fprintf (f , "Copyright:\n %s %s <%s>\n " , time .Now ().Format ("2006" ), getDebianName (), getDebianEmail ())
561
562
fmt .Fprintf (f , "License: %s\n " , license )
562
563
fmt .Fprintf (f , "Comment: Debian packaging is licensed under the same terms as upstream\n " )
563
564
fmt .Fprintf (f , "\n " )
@@ -577,7 +578,7 @@ func writeTemplates(dir, gopkg, debsrc, debbin, debversion, pkgType string, depe
577
578
fmt .Fprintf (f , "\n " )
578
579
}
579
580
fmt .Fprintf (f , "%%:\n " )
580
- fmt .Fprintf (f , "\t dh $@ --buildsystem=golang --with=golang\n " )
581
+ fmt .Fprintf (f , "\t dh $@ --builddirectory=_build -- buildsystem=golang --with=golang\n " )
581
582
582
583
f , err = os .Create (filepath .Join (dir , "debian" , "source" , "format" ))
583
584
if err != nil {
0 commit comments