Random thoughts shooting out of volatile mind
CDBS Packaging : copyright file support

One of the thing CDBS provides is support for verifying / generating debian/copyright file. This feature will be help full if new files show up in newer releases. It can also be helpful to generate the first version of copyright file. But don't blindly follow this feature, you need to cross verify the things it generates.

To use this feature add the following line to your debian/rules file first

include /usr/share/cdbs/1/rules/utils.mk 

Now create a file called debian/copyright_hints using touch command

touch debian/copyright_hints

Now run the following command to allow CDBS to do its magic and generate a new file called debian/copyright_newhints

DEB_MAINTAINER_MODE=1 fakeroot debian/rules build

As you see we set the variable DEB_MAINTAINER_MODE which means this is feature to help the maintainer rather than targeted for automatic builds. So if there is no new things added to the new release you should see something like this in the build log.

Scanning upstream source for new/changed copyright notices...

licensecheck -c '.*' -r --copyright -i '^debian/(changelog|copyright(|_hints|_newhints))' -l '99999' * | /usr/lib/cdbs/licensecheck2dep5 > debian/co$
19 combinations of copyright and licensing found.
No new copyright notices found - assuming no news is good news...

In case there are new files added you should get output similar to below

Scanning upstream source for new/changed copyright notices...

licensecheck -c '.*' -r --copyright -i '^debian/(changelog|copyright(|_hints|_newhints))' -l '99999' * | /usr/lib/cdbs/licensecheck2dep5 > debian/co$
0 combinations of copyright and licensing found.

Format: http://www.debian.org/doc/packaging-manuals/…
Upstream-Name: FIXME
Upstream-Contact: FIXME
Source: FIXME
Disclaimer: Autogenerated by CDBS


To fix the situation please do the following:
  1) Fully compare debian/copyright_hints with debian/copyright_newhints
  2) Update debian/copyright as needed
  3) Replace debian/copyright_hints with debian/copyright_newhints

So as the last 3 points says you need to compare your copyright_hints and the newly generated file by CDBS copyright_newhints for difference and update the debian/copyright as required and replace the existing debian/copyright_hints with debian/copyright_newhints.


  1. This feature can be used to generate the copyright file for the first time you need a copyright file with only debian/* copyright in it.
  2. If you are using it to generate copyright file for the first time be sure to cross verify the things mentioned in the file than just blindly copy pasting.
  3. If there are binary files like images are involved in your project be sure to clean up those from your copyright_hints before trying to build the package. Because of too much of binary cruft in any files means dpkg-source will be angry at you :-).

Last but not the least, I know CDBS provides some really cool features which we will explore with next few posts but always keep in mind this quote by Jonas. (Of course don't ask me to prove that Jonas did say it as there is no pgp signature of him with quote to verify ;-) )

CDBS is tool to help packagers and does not involve any magic.

Posted by: copyninja on Monday, 11 February 2013

blog comments powered by Disqus
Fork me on GitHub