#!/bin/sh # Build and install Perl on Slackware # originally by: David Cantrell # maintained by: CWD=`pwd` TMP=/tmp PKG=$TMP/package-perl VERSION=5.8.0 ARCH=sparc BUILD=1 DBI=1.37 DBDMYSQL=2.9002 # We remove the old Perl from the system before building # rm -rf /usr/lib/perl5 (Isn't this Slackware?) removepkg perl # Extract the source code: cd $TMP rm -rf perl-$VERSION tar xvzf $CWD/perl-$VERSION.tar.gz # Configure the source code: cd perl-$VERSION # Adjust owner/perms to standard values: chown -R root.root . find . -perm 555 -exec chmod 755 {} \; find . -perm 444 -exec chmod 644 {} \; # It is often suggested that we add this to the ./Configure: # -Dusethreads \ # However, this option is considered experimental, and is not # recommended for production systems. As such, we can't add # to our default perl build. If you want the option anyway, # just add it below and rebuild perl. # We no longer include suidperl. To quote the INSTALL file: # # Because of the buggy history of suidperl, and the difficulty # of properly security auditing as large and complex piece of # software as Perl, we cannot recommend using suidperl and the feature # should be considered deprecated. # Instead use for example 'sudo': http://www.courtesan.com/sudo/ # Configure perl: # -Dinstallprefix=/tmp/package-perl/usr ./Configure -de \ -Dprefix=/usr \ -Dcccdlflags='-fPIC' \ -Darchname=sparc-linux \ -Dinstallprefix=/tmp/package-perl/usr # Build perl make make test # Install perl make install # There are also miniperl and microperl. # I haven't had any requests for them, but would be willing # to consider adding one or both to the package if anyone # actually needs them for some reason. #make microperl # Symlinks that replace hard links ( cd $PKG/usr/bin ln -sf perl$VERSION perl ln -sf c2ph pstruct ln -sf s2p psed ) # Install documentation mkdir -p $PKG/usr/doc/perl-$VERSION cp -a \ AUTHORS Artistic Copying INSTALL MANIFEST README README.Y2K README.cn README.jp README.ko README.micro README.tw Todo.micro \ $PKG/usr/doc/perl-$VERSION ## We follow LSB with symlinks in /usr/share: ( cd $PKG/usr/share mv man .. ) ( cd $PKG/usr/man/man1 mkdir foo cp *.1 foo rm *.1 mv foo/* . rmdir foo gzip -9 * ln -sf c2ph.1.gz pstruct.1.gz ln -sf s2p.1.gz psed.1.gz ) ( cd $PKG/usr/man/man3 gzip -9 * ) #( cd $PKG/usr/man/man1 # rm -f pstruct.1 psed.1 # gzip -9 --force c2ph.1 s2p.1 # ln -sf c2ph.1.gz pstruct.1.gz # ln -sf s2p.1.gz psed.1.gz #) # Strip everything: ( cd $PKG find . -type f | xargs file | grep "not strip" | cut -f 1 -d : | xargs strip --strip-unneeded ) chown -R root.bin $PKG/usr/bin rmdir $PKG/usr/share # I'll disable this two modules for a while. At least until I make mysql # packages #later## Install DBD and DBI-mysql: #later# #later#cd $TMP #later#tar xzf $CWD/DBI-${DBI}.tar.gz #later#cd DBI-${DBI} #later#chown -R root.root . #later#perl Makefile.PL #later#make #later#make install #later#cp -a README $PKG/usr/doc/perl-$VERSION/README.DBI-${DBI} #later#chmod 644 $PKG/usr/doc/perl-$VERSION/README.DBI-${DBI} #later#cd $TMP #later#tar xzf $CWD/DBD-mysql-${DBDMYSQL}.tar.gz #later#cd DBD-mysql-${DBDMYSQL} #later#chown -R root.root . #later#perl Makefile.PL #later#make #later#make install #later#cp -a README $PKG/usr/doc/perl-$VERSION/README.DBD-mysql-${DBDMYSQL} #later#chmod 644 $PKG/usr/doc/perl-$VERSION/README.DBD-mysql-${DBDMYSQL} # Insert the slack-desc: mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # make the package cd $PKG makepkg -l y -c n $TMP/perl-${VERSION}-${ARCH}-${BUILD}.tgz # clean up if [ "$1" = "--cleanup" ]; then cd $CWD # rm -rf $TMP/ # Place here DBI and DBI-mysql rm -rf $TMP/perl-${VERSION} rm -rf $PKG fi