Packaging perl modules

Alexander E. Patrakov patrakov at
Sat Dec 8 23:46:22 PST 2007

[Credit for asking the "how to uninstall a perl module?" question goes
to Archaic]


there was a decision to add DESTDIR support to all LFS and then
eventually BLFS packages. However, there is a problem applying this
approach to typical perl modules (let me use "Want" as a small
example, you can download it from Try
installing it naively into a DESTDIR:

tar xf Want-0.16.tar.gz
cd Want-0.16
make test
make DESTDIR=/tmp/Want install

This seems to work:

$ find /tmp/Want -type f

but actually doesn't work quite well:

1) it instals a /tmp/Want/usr/lib/perl5/5.8.8/i486-linux/perllocal.pod
file, while the intent was to append to the existing file.

2) it writes a /tmp/Want/usr/lib/perl5/site_perl/5.8.8/i486-linux/auto/Want/.packlist
file. Looking in this file, one finds that each line starts with

In fact, with package management in place, both files are useless: one
can use his package manager instead of "perldoc perllocal" to see the
list of locally-installed modules, and the same package manager works
well for uninstalling the module (instead of calling ExtUtils
directly) once it is no longer needed.


1) perllocal.pod should not be packaged as it is. It should be either
removed completely or converted into a pair post-installation and
post-removal scripts.

2) .packlist should be either adjusted or (better, as double package
management is a bad idea) removed completely.

In fact, Debian patches their perl (or, more precisely, the MakeMaker
module) so that for "vendor" installs (see below), such files are not
produced at all:

perl INSTALLDIRS=vendor  # on Debian
make test
make DESTDIR=/tmp/Want install

$ find /tmp/Want -type f  # on Debian

OTOH, RedHat simply removes the uneeded files when packaging:

find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
(not sure what they do with perllocal.pod, but it is not in the
resulting package either)

So here are the questions:

1) where should such issues be explained?

2) should LFS apply the MakeMaker perl patch that suppresses
installation of .packlist and perllocal.pod files for vendor installs,
or rely on the packager to remove them?

Alexander E. Patrakov

More information about the lfs-dev mailing list