Creating a Debian package from a Perl module

The most used Perl modules are available as Debian packages.
However,  Debian does not always provide the latest version we need and not all the existing CPAN modules are available.
At CPAN, we can find any module for almost everything and we can manually install it.
Debian Perl packaging Team has created a dedicated tool for Debian users :  dh-make-perl.
To install it :

root@localhost:~# apt-get install devscripts dh-make-perl

Make sure the command is available :

fool@localhost:~$ which dh-make-perl

I decided to install the Perl module System2 :

fool@localhost:~$dh-make-perl –build –cpan System2

The program dh-make-perl will download directly from a CPAN mirror the module System2, check for any dependencies and create the corresponding Debian package.

The freshly created package is  :

$HOME/.cpan/build/libsystem2-perl_0.84-1_all.deb

Install the package  as root :

dpkg –install $HOME/.cpan/build/libsystem2-perl_0.84-1_all.deb

dpkg -l |grep -i system2


ii  libsystem2-perl                           0.84-1                     like system(), but with access to STDOUT and STDERR.

Check now that the module is available through perl and perldoc commands :

fool@localhost:~$perl -MSystem2 -e1

fool@localhost:~$perldoc System2

For more information about Perl modules :

http://www.cpan.org

Advertisements

2 thoughts on “Creating a Debian package from a Perl module

    • That’s right. But I mentioned above that some Perl modules are not packaged at all by Debian Perl Team due to the huge amount of existing modules.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s