Friday, 16 April 2010

Building a debian package for a CPAN module, and a known issue

The good news is that building a debian package from the source of a CPAN module is easy, thanks to the dh-make-perl tool.
The bad news is that the configuration of dh-make-perl can lead to the generation of a debian package containing unneeded files, and as a collateral effect preventing package installation as the files belong to more than one package.

For example you can end up with something like:

dpkg: error processing /var/cache/apt/archives/scnlibpoe-filter-stomp-perl_0.01_all.deb (--unpack):
trying to overwrite `/usr/lib/perl/5.8/perllocal.pod', which is also in package scnlibpoe-component-client-stomp-perl

The same result can be achieved by applying this change to your debian/rules file:
--- debian/rules (revision 32211)
+++ debian/rules (working copy)
@@ -51,8 +51,11 @@
- rmdir --ignore-fail-on-non-empty --parents $(TMP)/usr/lib/perl5
+ rm -rfv $(TMP)/usr/lib


No comments:

Post a Comment