Repository: goreleaser/nfpm
Pull request #597 (2022-12-30 00:54:10)

fix(deb): changelog fixes
closes #560 


caarlos0: cc/ @defanator 
cloudflare-pages[bot]: ## Deploying with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages

<table><tr><td><strong>Latest commit:</strong> </td><td>
<code>2f59cea</code>
</td></tr>
<tr><td><strong>Status:</strong></td><td>&nbsp;✅&nbsp; Deploy successful!</td></tr>
<tr><td><strong>Preview URL:</strong></td><td>
<a href='https://68159c9d.nfpm.pages.dev'>https://68159c9d.nfpm.pages.dev</a>
</td></tr>
<tr><td><strong>Branch Preview URL:</strong></td><td>
<a href='https://lintian.nfpm.pages.dev'>https://lintian.nfpm.pages.dev</a>
</td></tr>
</table>

[View logs](https://dash.cloudflare.com/?to=/:account/pages/view/nfpm/68159c9d-f11f-419a-9e8d-b8c96d70c4f5)


Patch:
diff --git a/deb/deb.go b/deb/deb.go
index 2008e45..ad8f22d 100644
--- a/deb/deb.go
+++ b/deb/deb.go
@@ -485,7 +485,10 @@ func createChangelogInsideDataTar(tarw *tar.Writer, md5w io.Writer,
 	created map[string]bool, info *nfpm.Info,
 ) (int64, error) {
 	var buf bytes.Buffer
-	out := gzip.NewWriter(&buf)
+	out, err := gzip.NewWriterLevel(&buf, gzip.BestCompression)
+	if err != nil {
+		return 0, fmt.Errorf("could not create gzip writer: %w", err)
+	}
 	// the writers are properly closed later, this is just in case that we have
 	// an error in another part of the code.
 	defer out.Close() // nolint: errcheck
@@ -500,13 +503,14 @@ func createChangelogInsideDataTar(tarw *tar.Writer, md5w io.Writer,
 	}
 
 	if err = out.Close(); err != nil {
-		return 0, fmt.Errorf("closing changelog.gz: %w", err)
+		return 0, fmt.Errorf("closing changelog.Debian.gz: %w", err)
 	}
 
 	changelogData := buf.Bytes()
 
 	// https://www.debian.org/doc/manuals/developers-reference/pkgs.de.html#recording-changes-in-the-package
-	changelogName := normalizePath(fmt.Sprintf("/usr/share/doc/%s/changelog.gz", info.Name))
+	// https://lintian.debian.org/tags/debian-changelog-file-missing-or-wrong-name
+	changelogName := normalizePath(fmt.Sprintf("/usr/share/doc/%s/changelog.Debian.gz", info.Name))
 	if err = createTree(tarw, changelogName, created); err != nil {
 		return 0, err
 	}
@@ -570,15 +574,6 @@ func createControl(instSize int64, md5sums []byte, info *nfpm.Info) (controlTarG
 		"conffiles": conffiles(info),
 	}
 
-	if info.Changelog != "" {
-		changeLogData, err := formatChangelog(info)
-		if err != nil {
-			return nil, err
-		}
-
-		filesToCreate["changelog"] = []byte(changeLogData)
-	}
-
 	triggers := createTriggers(info)
 	if len(triggers) > 0 {
 		filesToCreate["triggers"] = triggers
diff --git a/internal/cmd/init.go b/internal/cmd/init.go
index c32d144..8001aa5 100644
--- a/internal/cmd/init.go
+++ b/internal/cmd/init.go
@@ -69,13 +69,13 @@ license: "MIT"
 changelog: "changelog.yaml"
 contents:
 - src: ./foo
-  dst: /usr/local/bin/foo
+  dst: /usr/bin/foo
 - src: ./bar
-  dst: /usr/local/bin/bar
+  dst: /usr/bin/bar
 - src: ./foobar.conf
   dst: /etc/foobar.conf
   type: config
-- src: /usr/local/bin/foo
+- src: /usr/bin/foo
   dst: /sbin/foo
   type: symlink
 overrides:
diff --git a/www/docs/configuration.md b/www/docs/configuration.md
index aad06ee..0f7b0c3 100644
--- a/www/docs/configuration.md
+++ b/www/docs/configuration.md
@@ -151,7 +151,7 @@ conflicts:
 contents:
   # Basic file that applies to all packagers
   - src: path/to/local/foo
-    dst: /usr/local/bin/foo
+    dst: /usr/bin/foo
 
   # Simple config file
   - src: path/to/local/foo.conf
@@ -164,8 +164,8 @@ contents:
   - src: path/to/local/*.1.gz
     dst: /usr/share/man/man1/
 
-  # Simple symlink at /usr/local/bin/foo which points to /sbin/foo, which is
-  # the same behaviour as `ln -s /sbin/foo /usr/local/bin/foo`.
+  # Simple symlink at /usr/bin/foo which points to /sbin/foo, which is
+  # the same behaviour as `ln -s /sbin/foo /usr/bin/foo`.
   #
   # This also means that both "src" and "dst" are paths inside the package (or
   # rather paths in the file system where the package will be installed) and
@@ -218,7 +218,7 @@ contents:
   # than 'root') has to be always specified manually in 'file_info' as it will not be copied
   # from the 'src' file.
   - src: path/to/foo
-    dst: /usr/local/foo
+    dst: /usr/share/foo
     file_info:
       # Make sure that the mode is specified in octal, e.g. 0644 instead of 644.
       mode: 0644


Test patch:
diff --git a/apk/apk_test.go b/apk/apk_test.go
index 6b2dfbe..1be84b5 100644
--- a/apk/apk_test.go
+++ b/apk/apk_test.go
@@ -65,7 +65,7 @@ func exampleInfo() *nfpm.Info {
 			Contents: []*files.Content{
 				{
 					Source:      "../testdata/fake",
-					Destination: "/usr/local/bin/fake",
+					Destination: "/usr/bin/fake",
 				},
 				{
 					Source:      "../testdata/whatever.conf",
@@ -110,7 +110,7 @@ func TestCreateBuilderData(t *testing.T) {
 
 	require.NoError(t, builderData(tw))
 
-	require.Equal(t, 13832, buf.Len())
+	require.Equal(t, 13320, buf.Len())
 }
 
 func TestCombineToApk(t *testing.T) {
@@ -143,7 +143,7 @@ func TestPathsToCreate(t *testing.T) {
 func TestDefaultWithArch(t *testing.T) {
 	expectedChecksums := map[string]string{
 		"usr/share/doc/fake/fake.txt": "96c335dc28122b5f09a4cef74b156cd24c23784c",
-		"usr/local/bin/fake":          "f46cece3eeb7d9ed5cb244d902775427be71492d",
+		"usr/bin/fake":                "f46cece3eeb7d9ed5cb244d902775427be71492d",
 		"etc/fake/fake.conf":          "96c335dc28122b5f09a4cef74b156cd24c23784c",
 		"etc/fake/fake2.conf":         "96c335dc28122b5f09a4cef74b156cd24c23784c",
 	}
@@ -200,7 +200,7 @@ func TestFileDoesNotExist(t *testing.T) {
 				Contents: []*files.Content{
 					{
 						Source:      "../testdata/fake",
-						Destination: "/usr/local/bin/fake",
+						Destination: "/usr/bin/fake",
 					},
 					{
 						Source:      "../testdata/whatever.confzzz",
diff --git a/arch/arch_test.go b/arch/arch_test.go
index aebaa98..d621c31 100644
--- a/arch/arch_test.go
+++ b/arch/arch_test.go
@@ -42,7 +42,7 @@ func exampleInfo() *nfpm.Info {
 			Contents: []*files.Content{
 				{
 					Source:      "../testdata/fake",
-					Destination: "/usr/local/bin/fake",
+					Destination: "/usr/share/bin/fake",
 				},
 				{
 					Source:      "../testdata/whatever.conf",
diff --git a/deb/deb_test.go b/deb/deb_test.go
index 539956f..4850280 100644
--- a/deb/deb_test.go
+++ b/deb/deb_test.go
@@ -62,7 +62,7 @@ func exampleInfo() *nfpm.Info {
 			Contents: []*files.Content{
 				{
 					Source:      "../testdata/fake",
-					Destination: "/usr/local/bin/fake",
+					Destination: "/usr/bin/fake",
 				},
 				{
 					Source:      "../testdata/whatever.conf",
@@ -325,7 +325,7 @@ func TestDebFileDoesNotExist(t *testing.T) {
 				Contents: []*files.Content{
 					{
 						Source:      "../testdata/fake",
-						Destination: "/usr/local/bin/fake",
+						Destination: "/usr/bin/fake",
 					},
 					{
 						Source:      "../testdata/whatever.confzzz",
@@ -544,43 +544,6 @@ func TestDEBConventionalFileName(t *testing.T) {
 	}
 }
 
-func TestDebChangelogControl(t *testing.T) {
-	info := &nfpm.Info{
-		Name:        "changelog-test",
-		Arch:        "amd64",
-		Description: "This package has changelogs.",
-		Version:     "1.0.0",
-		Changelog:   "../testdata/changelog.yaml",
-	}
-	err := info.Validate()
-	require.NoError(t, err)
-
-	controlTarGz, err := createControl(0, []byte{}, info)
-	require.NoError(t, err)
-
-	controlChangelog := extractFileFromTar(t, inflate(t, "gz", controlTarGz), "changelog")
-
-	goldenChangelog := readAndFormatAsDebChangelog(t, info.Changelog, info.Name)
-
-	require.Equal(t, goldenChangelog, string(controlChangelog))
-}
-
-func TestDebNoChangelogControlWithoutChangelogConfigured(t *testing.T) {
-	info := &nfpm.Info{
-		Name:        "no-changelog-test",
-		Arch:        "amd64",
-		Description: "This package has explicitly no changelog.",
-		Version:     "1.0.0",
-	}
-	err := info.Validate()
-	require.NoError(t, err)
-
-	controlTarGz, err := createControl(0, []byte{}, info)
-	require.NoError(t, err)
-
-	require.False(t, tarContains(t, inflate(t, "gz", controlTarGz), "changelog"))
-}
-
 func TestDebChangelogData(t *testing.T) {
 	info := &nfpm.Info{
 		Name:        "changelog-test",
@@ -595,7 +558,7 @@ func TestDebChangelogData(t *testing.T) {
 	dataTarball, _, _, dataTarballName, err := createDataTarball(info)
 	require.NoError(t, err)
 
-	changelogName := fmt.Sprintf("/usr/share/doc/%s/changelog.gz", info.Name)
+	changelogName := fmt.Sprintf("/usr/share/doc/%s/changelog.Debian.gz", info.Name)
 	dataChangelogGz := extractFileFromTar(t,
 		inflate(t, dataTarballName, dataTarball), changelogName)
 
diff --git a/internal/rpmpack/rpm_test.go b/internal/rpmpack/rpm_test.go
index f21597a..47b91b0 100644
--- a/internal/rpmpack/rpm_test.go
+++ b/internal/rpmpack/rpm_test.go
@@ -22,7 +22,7 @@ func TestFileOwner(t *testing.T) {
 	user := "testUser"
 
 	r.AddFile(RPMFile{
-		Name:  "/usr/local/hello",
+		Name:  "/usr/hello",
 		Body:  []byte("content of the file"),
 		Group: group,
 		Owner: user,
@@ -46,7 +46,7 @@ func Test100644(t *testing.T) {
 		t.Fatalf("NewRPM returned error %v", err)
 	}
 	r.AddFile(RPMFile{
-		Name: "/usr/local/hello",
+		Name: "/usr/share/hello",
 		Body: []byte("content of the file"),
 		Mode: 0o100644,
 	})
@@ -162,20 +162,20 @@ func TestAllowListDirs(t *testing.T) {
 	}
 
 	r.AddFile(RPMFile{
-		Name: "/usr/local/dir1",
+		Name: "/usr/share/dir1",
 		Mode: 0o40000,
 	})
 	r.AddFile(RPMFile{
-		Name: "/usr/local/dir2",
+		Name: "/usr/share/dir2",
 		Mode: 0o40000,
 	})
 
-	r.AllowListDirs(map[string]bool{"/usr/local/dir1": true})
+	r.AllowListDirs(map[string]bool{"/usr/share/dir1": true})
 
 	if err := r.Write(io.Discard); err != nil {
 		t.Errorf("NewRPM returned error %v", err)
 	}
-	expected := map[string]RPMFile{"/usr/local/dir1": {Name: "/usr/local/dir1", Mode: 0o40000}}
+	expected := map[string]RPMFile{"/usr/share/dir1": {Name: "/usr/share/dir1", Mode: 0o40000}}
 	if d := cmp.Diff(expected, r.files); d != "" {
 		t.Errorf("Expected dirs differs (want->got):\n%v", d)
 	}
diff --git a/rpm/rpm_test.go b/rpm/rpm_test.go
index d24e4f9..2176143 100644
--- a/rpm/rpm_test.go
+++ b/rpm/rpm_test.go
@@ -54,7 +54,7 @@ func exampleInfo() *nfpm.Info {
 			Contents: []*files.Content{
 				{
 					Source:      "../testdata/fake",
-					Destination: "/usr/local/bin/fake",
+					Destination: "/usr/bin/fake",
 				},
 				{
 					Source:      "../testdata/whatever.conf",
@@ -466,7 +466,7 @@ func TestRPMFileDoesNotExist(t *testing.T) {
 	info.Contents = []*files.Content{
 		{
 			Source:      "../testdata/fake",
-			Destination: "/usr/local/bin/fake",
+			Destination: "/usr/bin/fake",
 		},
 		{
 			Source:      "../testdata/whatever.confzzz",
diff --git a/testdata/acceptance/apk.dockerfile b/testdata/acceptance/apk.dockerfile
index 06ea3fd..e418a48 100644
--- a/testdata/acceptance/apk.dockerfile
+++ b/testdata/acceptance/apk.dockerfile
@@ -16,12 +16,12 @@ RUN ls -l /path/to/symlink | grep "/path/to/symlink -> /etc/foo/whatever.conf"
 
 # ---- simple test ----
 FROM min AS simple
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN echo wat >> /etc/foo/whatever.conf
 RUN apk del foo
 RUN test -f /etc/foo/whatever.conf
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 
 
 # ---- no-glob test ----
@@ -36,7 +36,7 @@ RUN test -f /usr/share/whatever/folder2/file2
 
 # ---- complex test ----
 FROM min AS complex
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN test -d /usr/share/whatever/
 RUN test -d /usr/share/whatever/folder
@@ -53,7 +53,7 @@ RUN test -f /etc/something/a
 RUN test -f /etc/something/b
 RUN test -d /etc/something/c
 RUN test -f /etc/something/c/d
-RUN test $(stat -c %a /usr/sbin/fake) -eq 4755
+RUN test $(stat -c %a /usr/bin/fake2) -eq 4755
 RUN test -f /tmp/preinstall-proof
 RUN test -f /tmp/postinstall-proof
 RUN test ! -f /tmp/preremove-proof
@@ -61,8 +61,8 @@ RUN test ! -f /tmp/postremove-proof
 RUN echo wat >> /etc/foo/whatever.conf
 RUN apk del foo
 RUN test -f /etc/foo/whatever.conf
-RUN test ! -f /usr/local/bin/fake
-RUN test ! -f /usr/sbin/fake
+RUN test ! -f /usr/bin/fake
+RUN test ! -f /usr/bin/fake2
 RUN test -f /tmp/preremove-proof
 RUN test -f /tmp/postremove-proof
 RUN test ! -d /var/log/whatever
@@ -79,7 +79,7 @@ RUN apk add  /tmp/foo.apk
 
 # ---- overrides test ----
 FROM min AS overrides
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN test ! -f /tmp/preinstall-proof
 RUN test -f /tmp/postinstall-proof
@@ -88,7 +88,7 @@ RUN test ! -f /tmp/postremove-proof
 RUN echo wat >> /etc/foo/whatever.conf
 RUN apk del foo
 RUN test -f /etc/foo/whatever.conf
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 RUN test -f /tmp/preremove-proof
 RUN test ! -f /tmp/postremove-proof
 
diff --git a/testdata/acceptance/archlinux.dockerfile b/testdata/acceptance/archlinux.dockerfile
index 987e3ac..e51d3fa 100644
--- a/testdata/acceptance/archlinux.dockerfile
+++ b/testdata/acceptance/archlinux.dockerfile
@@ -16,12 +16,12 @@ RUN ls -l /path/to/symlink | grep "/path/to/symlink -> /etc/foo/whatever.conf"
 
 # ---- simple test ----
 FROM min AS simple
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN echo wat >> /etc/foo/whatever.conf
 RUN pacman --noconfirm -R foo
 RUN test -f /etc/foo/whatever.conf.pacsave
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 
 
 # ---- no-glob test ----
@@ -39,7 +39,7 @@ FROM min AS complex
 RUN pacman -Qi foo | grep "Depends On\\s*: bash"
 RUN pacman -Qi foo | grep "Replaces\\s*: foo"
 RUN pacman -Qi foo | grep "Provides\\s*: fake"
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN test -d /usr/share/whatever/
 RUN test -d /usr/share/whatever/folder
@@ -56,7 +56,7 @@ RUN test -f /etc/something/a
 RUN test -f /etc/something/b
 RUN test -d /etc/something/c
 RUN test -f /etc/something/c/d
-RUN test $(stat -c %a /usr/bin/fake) -eq 4755
+RUN test $(stat -c %a /usr/bin/fake2) -eq 4755
 RUN test -f /tmp/preinstall-proof
 RUN test -f /tmp/postinstall-proof
 RUN test ! -f /tmp/preremove-proof
@@ -64,8 +64,8 @@ RUN test ! -f /tmp/postremove-proof
 RUN echo wat >> /etc/foo/whatever.conf
 RUN pacman --noconfirm -R foo
 RUN test -f /etc/foo/whatever.conf.pacsave
-RUN test ! -f /usr/local/bin/fake
 RUN test ! -f /usr/bin/fake
+RUN test ! -f /usr/bin/fake2
 RUN test -f /tmp/preremove-proof
 RUN test -f /tmp/postremove-proof
 RUN test ! -d /var/log/whatever
@@ -80,7 +80,7 @@ RUN echo "Arch Linux has no signature support"
 
 # ---- overrides test ----
 FROM min AS overrides
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN test ! -f /tmp/preinstall-proof
 RUN test -f /tmp/postinstall-proof
@@ -89,7 +89,7 @@ RUN test ! -f /tmp/postremove-proof
 RUN echo wat >> /etc/foo/whatever.conf
 RUN pacman --noconfirm -R foo
 RUN test -f /etc/foo/whatever.conf.pacsave
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 RUN test -f /tmp/preremove-proof
 RUN test ! -f /tmp/postremove-proof
 
@@ -133,4 +133,4 @@ RUN test -f /tmp/postupgrade-proof
 RUN test -f /etc/regular.conf
 RUN test -f /etc/regular.conf.pacnew
 RUN test -f /etc/noreplace.conf
-RUN test -f /etc/noreplace.conf.pacnew
\ No newline at end of file
+RUN test -f /etc/noreplace.conf.pacnew
diff --git a/testdata/acceptance/core.complex.yaml b/testdata/acceptance/core.complex.yaml
index a43900e..3b15e66 100644
--- a/testdata/acceptance/core.complex.yaml
+++ b/testdata/acceptance/core.complex.yaml
@@ -21,7 +21,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/acceptance/folder/*
   dst: /usr/share/whatever/folder
 - src: ./testdata/whatever.conf
@@ -29,32 +29,39 @@ contents:
   type: config
 - src: ./testdata/something
   dst: /etc/something
-- src: ./testdata/fake
-  dst: /usr/sbin/fake
-  packager: deb
+- dst: /usr/foo/bar/something
+  type: dir
+- dst: /var/log/whatever
+  type: dir
+- dst: /usr/share/foo
+  type: dir
+
+# Packager specifics:
+
+- packager: deb
+  src: ./testdata/fake
+  dst: /usr/bin/fake2
   file_info:
     mode: 04755
-- src: ./testdata/fake
-  dst: /usr/sbin/fake
-  packager: rpm
+
+- packager: rpm
+  src: ./testdata/fake
+  dst: /usr/bin/fake2
   file_info:
     mode: 04755
-- src: ./testdata/fake
-  dst: /usr/sbin/fake
-  packager: apk
+
+- packager: apk
+  src: ./testdata/fake
+  dst: /usr/bin/fake2
   file_info:
     mode: 04755
-- src: ./testdata/fake
-  dst: /usr/bin/fake
+
+- packager: archlinux
+  src: ./testdata/fake
+  dst: /usr/bin/fake2
   file_info:
     mode: 04755
-  packager: archlinux
-- dst: /usr/foo/bar/something
-  type: dir
-- dst: /var/log/whatever
-  type: dir
-- dst: /usr/share/foo
-  type: dir
+
 scripts:
   preinstall: ./testdata/acceptance/scripts/preinstall.sh
   postinstall: ./testdata/acceptance/scripts/postinstall.sh
diff --git a/testdata/acceptance/core.env-var-version.yaml b/testdata/acceptance/core.env-var-version.yaml
index e3d872f..05c79d3 100644
--- a/testdata/acceptance/core.env-var-version.yaml
+++ b/testdata/acceptance/core.env-var-version.yaml
@@ -19,7 +19,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/acceptance/folder/**/*
   dst: /usr/share/whatever/folder/
 - src: ./testdata/whatever.conf
diff --git a/testdata/acceptance/core.min.yaml b/testdata/acceptance/core.min.yaml
index e04c563..2023913 100644
--- a/testdata/acceptance/core.min.yaml
+++ b/testdata/acceptance/core.min.yaml
@@ -5,4 +5,4 @@ license: MIT
 maintainer: "Foo Bar"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
diff --git a/testdata/acceptance/core.overrides.yaml b/testdata/acceptance/core.overrides.yaml
index f6615f4..caebe23 100644
--- a/testdata/acceptance/core.overrides.yaml
+++ b/testdata/acceptance/core.overrides.yaml
@@ -19,7 +19,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/acceptance/folder/*
   dst: /usr/share/whatever/folder
 - src: ./testdata/whatever.conf
diff --git a/testdata/acceptance/core.signed.yaml b/testdata/acceptance/core.signed.yaml
index 9630ec2..23f8764 100644
--- a/testdata/acceptance/core.signed.yaml
+++ b/testdata/acceptance/core.signed.yaml
@@ -8,7 +8,7 @@ vendor: "FooBarCorp"
 homepage: "http://example.com"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 deb:
   signature:
     key_file: ./internal/sign/testdata/privkey_unprotected.asc
diff --git a/testdata/acceptance/core.simple.yaml b/testdata/acceptance/core.simple.yaml
index 0a5e95f..017e293 100644
--- a/testdata/acceptance/core.simple.yaml
+++ b/testdata/acceptance/core.simple.yaml
@@ -12,7 +12,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/whatever.conf
   dst: /etc/foo/whatever.conf
   type: config
diff --git a/testdata/acceptance/core.withchangelog.yaml b/testdata/acceptance/core.withchangelog.yaml
index 9dcba75..64d100b 100644
--- a/testdata/acceptance/core.withchangelog.yaml
+++ b/testdata/acceptance/core.withchangelog.yaml
@@ -13,7 +13,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/whatever.conf
   dst: /etc/foo/whatever.conf
   type: config
diff --git a/testdata/acceptance/deb.debsign.sign.yaml b/testdata/acceptance/deb.debsign.sign.yaml
index 3d274ac..ad2f49b 100644
--- a/testdata/acceptance/deb.debsign.sign.yaml
+++ b/testdata/acceptance/deb.debsign.sign.yaml
@@ -8,7 +8,7 @@ vendor: "FooBarCorp"
 homepage: "http://example.com"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 deb:
   signature:
     method: debsign
diff --git a/testdata/acceptance/deb.dockerfile b/testdata/acceptance/deb.dockerfile
index 3a99139..3bfa657 100644
--- a/testdata/acceptance/deb.dockerfile
+++ b/testdata/acceptance/deb.dockerfile
@@ -16,12 +16,12 @@ RUN ls -l /path/to/symlink | grep "/path/to/symlink -> /etc/foo/whatever.conf"
 
 # ---- simple test ----
 FROM min AS simple
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN echo wat >> /etc/foo/whatever.conf
 RUN dpkg -r foo
 RUN test -f /etc/foo/whatever.conf
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 
 
 # ---- no-glob test ----
@@ -39,7 +39,7 @@ FROM min AS complex
 RUN apt-cache show /tmp/foo.deb | grep "Depends: bash"
 RUN apt-cache show /tmp/foo.deb | grep "Suggests: zsh"
 RUN apt-cache show /tmp/foo.deb | grep "Recommends: fish"
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN test -d /usr/share/whatever/
 RUN test -d /usr/share/whatever/folder
@@ -56,7 +56,7 @@ RUN test -f /etc/something/a
 RUN test -f /etc/something/b
 RUN test -d /etc/something/c
 RUN test -f /etc/something/c/d
-RUN test $(stat -c %a /usr/sbin/fake) -eq 4755
+RUN test $(stat -c %a /usr/bin/fake2) -eq 4755
 RUN test -f /tmp/preinstall-proof
 RUN test -f /tmp/postinstall-proof
 RUN test ! -f /tmp/preremove-proof
@@ -64,8 +64,8 @@ RUN test ! -f /tmp/postremove-proof
 RUN echo wat >> /etc/foo/whatever.conf
 RUN dpkg -r foo
 RUN test -f /etc/foo/whatever.conf
-RUN test ! -f /usr/local/bin/fake
-RUN test ! -f /usr/sbin/fake
+RUN test ! -f /usr/bin/fake
+RUN test ! -f /usr/bin/fake2
 RUN test -f /tmp/preremove-proof
 RUN test -f /tmp/postremove-proof
 RUN test ! -d /var/log/whatever
@@ -95,7 +95,7 @@ RUN dpkg -i /tmp/foo.deb
 
 # ---- overrides test ----
 FROM min AS overrides
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN test ! -f /tmp/preinstall-proof
 RUN test -f /tmp/postinstall-proof
@@ -104,7 +104,7 @@ RUN test ! -f /tmp/postremove-proof
 RUN echo wat >> /etc/foo/whatever.conf
 RUN dpkg -r foo
 RUN test -f /etc/foo/whatever.conf
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 RUN test -f /tmp/preremove-proof
 RUN test ! -f /tmp/postremove-proof
 
@@ -130,12 +130,18 @@ FROM test_base AS withchangelog
 # image filters out changelogs by default
 # so we have to remove that rule
 RUN apt update -y
-RUN apt install -y gzip
+RUN apt install -y gzip lintian
 RUN dpkg -i /tmp/foo.deb
-RUN zcat "/usr/share/doc/foo/changelog.gz" | grep "Carlos A Becker <pkg@carlosbecker.com>"
-RUN zcat "/usr/share/doc/foo/changelog.gz" | grep "note 1"
-RUN zcat "/usr/share/doc/foo/changelog.gz" | grep "note 2"
-RUN zcat "/usr/share/doc/foo/changelog.gz" | grep "note 3"
+RUN zcat "/usr/share/doc/foo/changelog.Debian.gz" | grep "Carlos A Becker <pkg@carlosbecker.com>"
+RUN zcat "/usr/share/doc/foo/changelog.Debian.gz" | grep "note 1"
+RUN zcat "/usr/share/doc/foo/changelog.Debian.gz" | grep "note 2"
+RUN zcat "/usr/share/doc/foo/changelog.Debian.gz" | grep "note 3"
+RUN lintian /tmp/foo.deb > lintian.out
+RUN test $(grep -c 'debian-changelog-file-missing-or-wrong-name' lintian.out) = 0
+RUN test $(grep -c 'changelog-not-compressed-with-max-compression' lintian.out) = 0
+RUN test $(grep -c 'unknown-control-file' lintian.out) = 0
+# TODO: RUN test $(grep -c 'package-contains-timestamped-gzip' lintian.out) = 0
+# TODO: RUN test $(grep -c 'syntax-error-in-debian-changelog' lintian.out) = 0
 
 # ---- rules test ----
 FROM min AS rules
@@ -161,11 +167,11 @@ RUN dpkg -i /tmp/foo.deb
 
 # ---- compression test ----
 FROM min AS compression
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN echo wat >> /etc/foo/whatever.conf
 RUN dpkg -r foo
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 
 # ---- upgrade test ----
 FROM test_base AS upgrade
diff --git a/testdata/acceptance/deb.dpkg-sig.sign.yaml b/testdata/acceptance/deb.dpkg-sig.sign.yaml
index 0daaf6a..fefb692 100644
--- a/testdata/acceptance/deb.dpkg-sig.sign.yaml
+++ b/testdata/acceptance/deb.dpkg-sig.sign.yaml
@@ -8,7 +8,7 @@ vendor: "FooBarCorp"
 homepage: "http://example.com"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 deb:
   signature:
     method: dpkg-sig
diff --git a/testdata/acceptance/deb.gzip.compression.yaml b/testdata/acceptance/deb.gzip.compression.yaml
index 28af978..2d99134 100644
--- a/testdata/acceptance/deb.gzip.compression.yaml
+++ b/testdata/acceptance/deb.gzip.compression.yaml
@@ -11,7 +11,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
   - src: ./testdata/fake
-    dst: /usr/local/bin/fake
+    dst: /usr/bin/fake
   - src: ./testdata/whatever.conf
     dst: /etc/foo/whatever.conf
     type: config
diff --git a/testdata/acceptance/deb.none.compression.yaml b/testdata/acceptance/deb.none.compression.yaml
index 631fbf9..66fd7b2 100644
--- a/testdata/acceptance/deb.none.compression.yaml
+++ b/testdata/acceptance/deb.none.compression.yaml
@@ -11,7 +11,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
   - src: ./testdata/fake
-    dst: /usr/local/bin/fake
+    dst: /usr/bin/fake
   - src: ./testdata/whatever.conf
     dst: /etc/foo/whatever.conf
     type: config
diff --git a/testdata/acceptance/deb.rules.yaml b/testdata/acceptance/deb.rules.yaml
index adc0af5..130584a 100644
--- a/testdata/acceptance/deb.rules.yaml
+++ b/testdata/acceptance/deb.rules.yaml
@@ -11,7 +11,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/whatever.conf
   dst: /etc/foo/whatever.conf
   type: config
diff --git a/testdata/acceptance/deb.triggers.yaml b/testdata/acceptance/deb.triggers.yaml
index bf7323f..86ffe21 100644
--- a/testdata/acceptance/deb.triggers.yaml
+++ b/testdata/acceptance/deb.triggers.yaml
@@ -7,7 +7,7 @@ vendor: "foobar"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 scripts:
   postinstall: ./testdata/acceptance/scripts/postinstall_trigger.sh
 deb:
diff --git a/testdata/acceptance/deb.xz.compression.yaml b/testdata/acceptance/deb.xz.compression.yaml
index 268e5bb..717f65c 100644
--- a/testdata/acceptance/deb.xz.compression.yaml
+++ b/testdata/acceptance/deb.xz.compression.yaml
@@ -11,7 +11,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
   - src: ./testdata/fake
-    dst: /usr/local/bin/fake
+    dst: /usr/bin/fake
   - src: ./testdata/whatever.conf
     dst: /etc/foo/whatever.conf
     type: config
diff --git a/testdata/acceptance/rpm.dockerfile b/testdata/acceptance/rpm.dockerfile
index d009580..837f879 100644
--- a/testdata/acceptance/rpm.dockerfile
+++ b/testdata/acceptance/rpm.dockerfile
@@ -16,12 +16,12 @@ RUN ls -l /path/to/symlink | grep "/path/to/symlink -> /etc/foo/whatever.conf"
 
 # ---- simple test ----
 FROM min AS simple
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN echo wat >> /etc/foo/whatever.conf
 RUN rpm -e foo
 RUN test -f /etc/foo/whatever.conf.rpmsave
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 
 
 # ---- no-glob test ----
@@ -39,7 +39,7 @@ FROM min AS complex
 RUN test "$(rpm -qp --recommends /tmp/foo.rpm)" = "fish"
 RUN test "$(rpm -qp --suggests /tmp/foo.rpm)" = "zsh"
 RUN test "$(rpm -qp --requires /tmp/foo.rpm)" = "bash"
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN test -d /usr/share/whatever/folder
 RUN test -f /usr/share/whatever/folder/file1
@@ -55,7 +55,7 @@ RUN test -f /etc/something/a
 RUN test -f /etc/something/b
 RUN test -d /etc/something/c
 RUN test -f /etc/something/c/d
-RUN test $(stat -c %a /usr/sbin/fake) -eq 4755
+RUN test $(stat -c %a /usr/bin/fake2) -eq 4755
 RUN test -f /tmp/preinstall-proof
 RUN test -f /tmp/postinstall-proof
 RUN test -f /tmp/pretrans-proof
@@ -65,8 +65,8 @@ RUN test ! -f /tmp/postremove-proof
 RUN echo wat >> /etc/foo/whatever.conf
 RUN rpm -e foo
 RUN test -f /etc/foo/whatever.conf.rpmsave
-RUN test ! -f /usr/local/bin/fake
-RUN test ! -f /usr/sbin/fake
+RUN test ! -f /usr/bin/fake
+RUN test ! -f /usr/bin/fake2
 RUN test -f /tmp/preremove-proof
 RUN test -f /tmp/postremove-proof
 RUN test ! -d /var/log/whatever
@@ -94,7 +94,7 @@ RUN yum install -y foo
 
 # ---- overrides test ----
 FROM min AS overrides
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN test -d /usr/share/whatever/folder
 RUN test -f /usr/share/whatever/folder/file1
@@ -109,7 +109,7 @@ RUN test ! -f /tmp/postremove-proof
 RUN echo wat >> /etc/foo/whatever.conf
 RUN rpm -e foo
 RUN test -f /etc/foo/whatever.conf.rpmsave
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 RUN test ! -f /tmp/preremove-proof
 RUN test -f /tmp/postremove-proof
 
@@ -150,12 +150,12 @@ RUN rpm -q foo --changelog | grep -E "^- note 3$"
 FROM min AS compression
 ARG compression
 RUN test "${compression}" = "$(rpm -qp --qf '%{PAYLOADCOMPRESSOR}' /tmp/foo.rpm)"
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN echo wat >> /etc/foo/whatever.conf
 RUN rpm -e foo
 RUN test -f /etc/foo/whatever.conf.rpmsave
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 
 # ---- upgrade test ----
 FROM test_base AS upgrade
@@ -197,12 +197,12 @@ RUN cat /etc/noreplace.conf.rpmnew | grep foo=baz
 
 # ---- release test ----
 FROM min AS release
-RUN test -e /usr/local/bin/fake
+RUN test -e /usr/bin/fake
 RUN test -f /etc/foo/whatever.conf
 RUN echo wat >> /etc/foo/whatever.conf
 RUN rpm -e foo
 RUN test -f /etc/foo/whatever.conf.rpmsave
-RUN test ! -f /usr/local/bin/fake
+RUN test ! -f /usr/bin/fake
 
 # ---- directories test ----
 FROM test_base AS directories
diff --git a/testdata/acceptance/rpm.gzip.compression.yaml b/testdata/acceptance/rpm.gzip.compression.yaml
index f9a2bc4..baf7454 100644
--- a/testdata/acceptance/rpm.gzip.compression.yaml
+++ b/testdata/acceptance/rpm.gzip.compression.yaml
@@ -11,7 +11,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/whatever.conf
   dst: /etc/foo/whatever.conf
   type: config
diff --git a/testdata/acceptance/rpm.lzma.compression.yaml b/testdata/acceptance/rpm.lzma.compression.yaml
index 4c949c4..b02bbcd 100644
--- a/testdata/acceptance/rpm.lzma.compression.yaml
+++ b/testdata/acceptance/rpm.lzma.compression.yaml
@@ -11,7 +11,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/whatever.conf
   dst: /etc/foo/whatever.conf
   type: config
diff --git a/testdata/acceptance/rpm.release.yaml b/testdata/acceptance/rpm.release.yaml
index 80d2a17..84ff23a 100644
--- a/testdata/acceptance/rpm.release.yaml
+++ b/testdata/acceptance/rpm.release.yaml
@@ -12,7 +12,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/whatever.conf
   dst: /etc/foo/whatever.conf
   type: config
diff --git a/testdata/acceptance/rpm.xz.compression.yaml b/testdata/acceptance/rpm.xz.compression.yaml
index 4abcbe1..3b13f0f 100644
--- a/testdata/acceptance/rpm.xz.compression.yaml
+++ b/testdata/acceptance/rpm.xz.compression.yaml
@@ -11,7 +11,7 @@ homepage: "https://foobar.org"
 license: "MIT"
 contents:
 - src: ./testdata/fake
-  dst: /usr/local/bin/fake
+  dst: /usr/bin/fake
 - src: ./testdata/whatever.conf
   dst: /etc/foo/whatever.conf
   type: config