dh-make-perl will rock your socks

dh-make-perl

is the most awesome Debian package /ever/.

dh-make-perl --cpan Some::Module --build
sudo dpkg -i libsome-module-0.1-1_all.deb

Done.

Dependencies

If you have

apt-file

installed and Some::Module requires Lib::Foo for which a Debian package is available, the dependancy will automatically be created. If Lib::Foo does not have a Debian package already available, you will likely need to manually run

dh-make-perl

on Lib::Foo first.

I haven’t seen the

apt-file

trick mentioned elsewhere. Honestly when someone mentioned it on IRC I didn’t believe him. Sure enough, looking at the source for

dh-make-per

l revealed that it does indeed check apt-file for each module that Some::Module lists as required in the

META.yml

.

Why?

Now dpkg/apt know that you have Some::Module installed. If an official package for Some::Module comes out, it will likely have the same name and if it is for a newer version of Some::Module aptitude upgrade will automagically upgrade you to it. The real win is ease of cleanly uninstalling though. How many times have you found what you thought was the perfect module for task XYZ and installed it. Only to find that it isn’t so hot 5 minutes after beginning to use it. Making sure ‘

make uninstall

‘ really uninstalled every thing can be a pain.

This entry was posted in General and tagged , , , , . Bookmark the permalink.

3 Responses to dh-make-perl will rock your socks

  1. That’s some nifty info, Michael. Thanks!

  2. Patrick says:

    Hi, I tried compiling the perl modules using:

    $ dh-make-perl –build –cpan Lyrics::Fetcher::LyricsDownload

    This all works fine, and I even get a list of dependencies the package has, which I can then install using apt-get install.

    But when I install the final .deb package I get the following error:
    [terminal]
    patrick@global:~$ sudo dpkg -i liblyrics-fetcher-lyricsdownload-perl_0.01-1_all.deb
    (Reading database … 52109 files and directories currently installed.)
    Unpacking liblyrics-fetcher-lyricsdownload-perl (from liblyrics-fetcher-lyricsdownload-perl_0.01-1_all.deb) …
    dpkg: error processing liblyrics-fetcher-lyricsdownload-perl_0.01-1_all.deb (–install):
    trying to overwrite `/usr/lib/perl/5.8/perllocal.pod’, which is also in package libhtml-tree-perl
    Errors were encountered while processing:
    liblyrics-fetcher-lyricsdownload-perl_0.01-1_all.deb
    [/terminal]

    By the way: the package: libhtml-tree-perl was also a package I compiled myself using dh-make-perl.

    What is causing perllocal.pod to being a problem?

    • Alex Peters says:

      perllocal.pod holds info on modules added locally to one’s Perl installation, and is appended to whenever a module is installed using a Makefile. In the context of a Debian package for a module, this file has no purpose; the package manager takes on this responsibility.

      Some extra work is required to stop this file from being added to the Debian package. This comment makes allusions without showing how:

      http://www.debian-administration.org/articles/78#comment_8

      It’s probably just as simple as a “rm $(SOMEWHERE)/perllocal.pod” call in the right place though.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>