SlackPerlMod


The following is a method of creating Slackware-style packages for practically any Perl module you can pull from CPAN. I found this necessary since it is standard practise for me NOT to install a compiler suite on every system I run; I prefer instead to create a standard Slackware system on a USB drive with a full development kit and chroot to it whenever I need to build something. Consistency is a wonderful thing. :-)

Meant to be called from the CPAN shell with 'look':

$ perl -MCPAN -e shell
cpan> look Foo::Package

or

$ perl -MCPAN -e look Foo::Package

Notes:

  • Unlike checkinstall, it won't obliterate your perllocal.pod
  • Installs to Slackware's default perl directory (/usr/lib/perl5/5.8.0/i486-linux for Slackware 9.1)
  • Follow deps yourself; if Foo::Package requires Bar::Module the build process will tell you; break out and run this script on each Module, it makes things much nicer.

rm -rf /distroot
mkdir -p /distroot/usr
mkdir -p /distroot/install

perl Makefile.PL SITEPREFIX=/distroot/usr
make test
make install

mv /distroot/usr/lib/perl5/site_perl/5.8.0/i486-linux/perllocal.pod \
   /distroot/install/perllocal.pod.append

cat << EOF > /distroot/install/doinst.sh
#!/bin/sh

echo
cat install/perllocal.pod.append >> \
    usr/lib/perl5/site_perl/5.8.0/i486-linux/perllocal.pod

EOF

PKGNAME=`pwd | sed -e 's/.*\///'`
( cd /distroot ; makepkg -l y -c n /packages/perl/$PKGNAME-i386-1.tgz )
rm -rf /distroot