My Debian package produces a lintian error:

rhythmbox-plugin-alternative-toolbar: extra-license-file usr/lib/rhythmbox/plugins/alternative-toolbar/LICENSE

This is because the source contains the LICENSE file - and Debian rules for packaging state that all license information should be within the copyright file of the package.

I'm using autotools automake for building - my debian/rules looks like this:

#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-version.mk
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

DEB_DH_AUTORECONF_ARGS := --as-needed ./autogen.sh

# List any files which are not installed
common-binary-post-install-arch:: list-missing

My initial thought was to include an override_dh_auto_install statement in the rules to strip out the LICENSE file but this seems to be ignored (or doesn't work) if I add the following at the bottom of the current rules

    find . -name "LICENSE" -delete

Thus to my question - how do I remove the LICENSE file when building a Debian package ?

Note - I don't want to artificially hide the lintian error with some sort of override - I want to ensure the built package doesn’t include the extra LICENSE file.

  • You appear to be using cdbs, not dh, so dh overrides won't work. Lintian isn't complaining about there being a LICENSE file in the source code though, it's complaining about it being installed in the binary package; so if you can remove it from the installed files, you should be OK. (I don't know much about cdbs though so I can't really help.) – Stephen Kitt Dec 21 '15 at 16:49

This question was asked almost 2 years ago, but there aren't any answers. So I will post the solution that I found recently.

Delete the file after calling dh_auto_install:

    find ./debian -type f -name "LICENSE" -delete

Or override another directive that is called after files are staged but before package is built. Here is how I first did it by overriding the dh_md5sums directive:

    find ./debian/<package_name> -type f -name "LICENSE.txt" -delete

Overriding other dh_ directives might work as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.