jkeenan1 has asked for the wisdom of the Perl Monks concerning the following question:

Quite a few of my CPAN modules have been repackaged by people in lands far and distant as .rpm files. But now I would like to package several of them in a .deb so that they could be distributed to Debian, Ubuntu and related Linux distributions -- such as at my current employer!

The hard way to do this would be for me to learn how to make a .deb myself.

The Lazy way would be to see if there's something on CPAN that can do it for me.

Based on the documentation, the likeliest candidate is DPKG-Tools. However, in the documentation its author characterizes it as an incomplete effort. It appears to have been a school project and has not been updated in nearly four years.

Has anyone used this module, and with what results?

If not, is there some other Perl that will do this?

Thank you very much.

Jim Keenan

Replies are listed 'Best First'.
Re: Seek Perl module to build .deb files
by rafl (Friar) on Jun 10, 2006 at 00:59 UTC

    There's the dh-make-perl package, which generates quick-and-dirty packages from CPAN distributions and CPANPLUS::Dist::Deb, which does the same thing, but, at least in my eyes, slightly better.

    The generated packages are quite useful, but still not suitable to be integrated with a real-world distribution. So if you want to see your modules in the official Debian/Ubuntu/Whatever archive, you'll either need to find someone who's skilled enough to package it for you or to package it yourself properly.

    Cheers, Flo

      Thanks. Could you elaborate on why these are "still not suitable to be integrated with a real-world distribution"? (I'll take your word for it, but I have to explain this to colleagues at work as well.)

      Jim Keenan

        There are several reasons for this. I'll tell you the first few things that come to my mind.

        Automatic package builders use heuristics to determine specific information. For example they "guess" the license of a module, which can get you into serious troubles as a distributor. They "guess" the build-dependencies. This usually works well for pure-perl modules with a complete PREREQ_PM list, but fails for almost any module which doesn't use pure-perl only.

        Packages generated by those tools tend to be low-quality. They don't use common best-practices in packaging, they use outdated stuff like compatibility versions (debian/compat) and they have no clue about what documentation should be in the package and what shouldn't.

        Beside that they are, at least in my experience, not very robust. Not only the generated packages are broken (do not build, install, work, whatever), even the tools itself croak from time to time, if they don't like the module they should package.

        These might not be the most important things, but they might be enough to see that one shouldn't create debian source packages in a full automated fashion.

        Nevertheless, even I use dh-make-perl and friends from time to time. Most perl packages look the same from the debian packagers point of view. This makes it possible to use dh-make-perl to do the boring things, like a first debian/rules version, etc. and concentrate on those things that the tools can't do for you: Checking the copyright information, finding a good package description, ...

        HTH, Flo