jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.14k stars 1.07k forks source link

--deb-changelog creates changelog at /usr/share/doc/<package>/changelog.gz instead of /usr/share/doc/<package>/changelog.Debian.gz #1575

Open jean-christophe-manciot opened 5 years ago

jean-christophe-manciot commented 5 years ago

Ubuntu 19.04 fpm 1.9.3

For instance:

fpm -s dir -t deb -C consul/bin --prefix /usr/bin --name ${package} --verbose --version "${release_number}" --iteration ${os_version} --category admin --provides ${package} --architecture native --maintainer "Jean-Christophe Manciot <manciot.jeanchristophe@gmail.com>" --description "$(cat description-pak)" --deb-changelog "${changelog_file}" --url "https://github.com/hashicorp/consul" --depends "libc6"

creates a deb which contains:

dpkg --contents consul_1.4.0+b1-19.04_amd64.deb | grep changelog
-rw-r--r-- 0/0           45921 2018-12-05 10:36 ./usr/share/doc/consul/changelog.gz

This makes the changelog unreadable by apt changelog and does not respect debian policy.

It seems that --deb-changelog is mixed with --deb-upstream-changelog.

vsvyatski commented 5 years ago

In addition to that the file inside changelog.gz is called changelog instead of changelog.Debian. The issue is still present in fpm 1.11.0.

infertux commented 4 years ago

Same issue here. lintian -i foobar.deb reports this error:

E: foobar: debian-changelog-file-missing-or-wrong-name
N: 
N:    Each Debian package (which provides a /usr/share/doc/<pkg> directory)
N:    must install a Debian changelog file in
N:    /usr/share/doc/<pkg>/changelog.Debian.gz
N:    
N:    A common error is to name the Debian changelog like an upstream
N:    changelog (/usr/share/doc/<pkg>/changelog.gz); therefore, lintian will
N:    apply further checks to such a file if it exists even after issuing this
N:    error.
N:    
N:    Refer to Debian Policy Manual section 12.7 (Changelog files) for
N:    details.
N:    
N:    Severity: serious, Certainty: certain
N:    
N:    Check: changelog-file, Type: binary
root360-AndreasUlm commented 4 years ago

Unfortunately that's an issue in lintian as the Debian Packaging Policy (1) concerning changelog states:

If the package has only one file which is used both as the Debian changelog and the upstream release notes or changelog, because there is no separate upstream maintainer, then that file should usually be installed as /usr/share/doc/package/NEWS.gz or /usr/share/doc/package/changelog.gz (depending on whether the file is release notes or a changelog); if there is a separate upstream maintainer, but no upstream release notes or changelog, then the Debian changelog should still be called changelog.Debian.gz.

To fix lintian I changed the code from renaming the changelog to copying it with PR https://github.com/jordansissel/fpm/pull/1695. This results in the warning 'duplicate-changelog-files' but at least it's now a warning and not an error.

(1) https://www.debian.org/doc/debian-policy/ch-docs.html#s-changelogs

stefan2904 commented 6 days ago

fyi, with fpm 1.15.1, calling fpm with --deb-changelog changelog.Debian still results in /usr/share/doc/<package>/changelog.gz

(which interestingly is not installed by apt at all?)