Upgrading debian packages with newer cpan releases

mintywalker on 2009-07-11T15:23:15

I do all my cpan package/module management via debian's apt(itude) tool.

It works really well (for me) with one fairly major exception. Figuring out how to build packages/deb files is a bit complex.

It seems to be one of those problems that has so many different ways to do it and/or so many pitfalls that newbie dummies like me struggle. However once over that hurdle I have found using apt to be really nice.

After a lot of help from Aaron and faaar too many hours pulling out my hair I believe I have a process that generally works for me. So I thought I would share a worked example.

Upgrading libwww-perl via a Debian / Ubuntu deb package

It is hopefully a cleaner and tidier example of a post to london.pm about the same thing.

If anyone has any experience with building Debian/Ubuntu packages from cpan, I'd welcome some feedback.

ps. I'm aware of http://debian.pkgs.cpan.org/ but it doesn't always have what I want. I also find that the differently named packages sooner or later cause some kinda clash with the packages I get from Debian/Ubuntu.

pps. I'm also aware of dh-make-perl however that has caused me to trip up previously with version numbers.

For example the version of Spreadsheet::ParseExcel in Ubuntu Jaunty is 0.3300. The latest version on cpan is 0.49 and to make that work it's version in the debian package needs to be 0.4900. But dh-make-perl picks 0.49.

Plus, sometimes you want to tinker with the debian control files a little, and I've not yet figured out how to have it upgrade an existing module rather than build a new version (and loose all the changelog history from the debian package).

Again, via Aaron, I found the following to be rather helpful when figuring out what the version number wants to be for Debian

dpkg --compare-versions 0.3300 lt 0.4900 && echo yes || echo no

ppps. If you're more a redhat / fedora kinda person then perhaps this might be of interest