Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging and template cleanups #109

Merged
merged 5 commits into from Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
dh-make-golang
_build/
36 changes: 22 additions & 14 deletions make.go
Expand Up @@ -492,11 +492,18 @@ func writeTemplates(dir, gopkg, debsrc, debbin, debversion, pkgType string, depe
fmt.Fprintf(f, "Section: devel\n")
fmt.Fprintf(f, "Priority: optional\n")
fmt.Fprintf(f, "Maintainer: Debian Go Packaging Team <team+pkg-go@tracker.debian.org>\n")
fmt.Fprintf(f, "Uploaders: %s <%s>\n", getDebianName(), getDebianEmail())
sort.Strings(dependencies)
builddeps := append([]string{"debhelper (>= 11)", "dh-golang", "golang-any"}, dependencies...)
fmt.Fprintf(f, "Build-Depends: %s\n", strings.Join(builddeps, ",\n "))
fmt.Fprintf(f, "Standards-Version: 4.2.1\n")
fmt.Fprintf(f, "Uploaders:\n %s <%s>,\n", getDebianName(), getDebianEmail())
fmt.Fprintf(f, "Rules-Requires-Root: no\n")
builddeps := []string{"debhelper (>= 11)", "dh-golang"}
builddeps_bytype := append([]string{"golang-any"}, dependencies...)
sort.Strings(builddeps_bytype)
fmt.Fprintf(f, "Build-Depends:\n %s,\n", strings.Join(builddeps, ",\n "))
builddeps_deptype := "Indep"
if pkgType == "program" {
builddeps_deptype = "Arch"
}
fmt.Fprintf(f, "Build-Depends-%s:\n %s,\n", builddeps_deptype, strings.Join(builddeps_bytype, ",\n "))
fmt.Fprintf(f, "Standards-Version: 4.3.0\n")
fmt.Fprintf(f, "Homepage: %s\n", getHomepageForGopkg(gopkg))
fmt.Fprintf(f, "Vcs-Browser: https://salsa.debian.org/go-team/packages/%s\n", debsrc)
fmt.Fprintf(f, "Vcs-Git: https://salsa.debian.org/go-team/packages/%s.git\n", debsrc)
Expand All @@ -513,7 +520,8 @@ func writeTemplates(dir, gopkg, debsrc, debbin, debversion, pkgType string, depe
fmt.Fprintf(f, "Architecture: all\n")
deps = append(deps, dependencies...)
}
fmt.Fprintf(f, "Depends: %s\n", strings.Join(deps, ",\n "))
sort.Strings(deps)
fmt.Fprintf(f, "Depends:\n %s,\n", strings.Join(deps, ",\n "))
description, err := getDescriptionForGopkg(gopkg)
if err != nil {
log.Printf("Could not determine description for %q: %v\n", gopkg, err)
Expand Down Expand Up @@ -544,20 +552,20 @@ func writeTemplates(dir, gopkg, debsrc, debbin, debversion, pkgType string, depe
copyright = "TODO"
}
fmt.Fprintf(f, "Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\n")
fmt.Fprintf(f, "Upstream-Name: %s\n", filepath.Base(gopkg))
fmt.Fprintf(f, "Source: %s\n", getHomepageForGopkg(gopkg))
fmt.Fprintf(f, "Upstream-Name: %s\n", filepath.Base(gopkg))
fmt.Fprintf(f, "Files-Excluded:\n")
for _, dir := range vendorDirs {
fmt.Fprintf(f, " %s\n", dir)
fmt.Fprintf(f, " %s\n", dir)
}
fmt.Fprintf(f, " Godeps/_workspace\n")
fmt.Fprintf(f, " Godeps/_workspace\n")
fmt.Fprintf(f, "\n")
fmt.Fprintf(f, "Files: *\n")
fmt.Fprintf(f, "Copyright: %s\n", copyright)
fmt.Fprintf(f, "Files:\n *\n")
fmt.Fprintf(f, "Copyright:\n %s\n", copyright)
fmt.Fprintf(f, "License: %s\n", license)
fmt.Fprintf(f, "\n")
fmt.Fprintf(f, "Files: debian/*\n")
fmt.Fprintf(f, "Copyright: %s %s <%s>\n", time.Now().Format("2006"), getDebianName(), getDebianEmail())
fmt.Fprintf(f, "Files:\n debian/*\n")
fmt.Fprintf(f, "Copyright:\n %s %s <%s>\n", time.Now().Format("2006"), getDebianName(), getDebianEmail())
fmt.Fprintf(f, "License: %s\n", license)
fmt.Fprintf(f, "Comment: Debian packaging is licensed under the same terms as upstream\n")
fmt.Fprintf(f, "\n")
Expand All @@ -577,7 +585,7 @@ func writeTemplates(dir, gopkg, debsrc, debbin, debversion, pkgType string, depe
fmt.Fprintf(f, "\n")
}
fmt.Fprintf(f, "%%:\n")
fmt.Fprintf(f, "\tdh $@ --buildsystem=golang --with=golang\n")
fmt.Fprintf(f, "\tdh $@ ---builddirectory=_build -buildsystem=golang --with=golang\n")

f, err = os.Create(filepath.Join(dir, "debian", "source", "format"))
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions metadata.go
Expand Up @@ -135,11 +135,11 @@ func getLicenseForGopkg(gopkg string) (string, string, error) {
if deblicense, ok := githubLicenseToDebianLicense[rl.GetLicense().GetKey()]; ok {
fulltext := debianLicenseText[deblicense]
if fulltext == "" {
fulltext = "TODO"
fulltext = " TODO"
}
return deblicense, fulltext, nil
} else {
return "TODO", "TODO", nil
return "TODO", " TODO", nil
}
}

Expand Down