#!/bin/sh # Build and install Perl on Slackware # originally by: David Cantrell # maintained by: # modified by: Mario Stabrey CWD=`pwd` TMP=/tmp PKG=$TMP/package-perl VERSION=5.10.1 ARCH=alpha BUILD=1 # Additional required modules: DBI=1.609 DBDMYSQL=4.013 XMLPARSER=2.36 XMLSIMPLE=2.18 DB_F=1.820 URI=1.40 # needed by XFCE if [ -x /usr/bin/perl ]; then echo "Perl detected." echo "It's a good idea to remove your existing perl first." sleep 5 fi rm -rf /usr/bin/perl # Clear build location: rm -rf $PKG mkdir -p $PKG # Extract the source code: ( cd $TMP rm -rf perl-$VERSION tar xzf $CWD/perl-$VERSION.tar.gz || exit # Change into the source directory: cd perl-$VERSION rm -rf ext/DB_File tar xzf $CWD/DB_File-$DB_F.tar.gz -C $TMP/perl-$VERSION/ext cd ext ; ln -s DB_File-$DB_F DB_File ; cd .. # Adjust owner/perms to standard values: chown -R root.root . find . -perm 555 -exec chmod 755 {} \; find . -perm 444 -exec chmod 644 {} \; # Configure perl: ./Configure -de \ -Dprefix=/usr \ -Dcccdlflags='-fPIC' \ -Dinstallprefix=/usr \ -Doptimize="-O3" \ -Dusethreads \ -Duseithreads \ -Dpager='/usr/bin/less -isr' \ -Dinc_version_list='5.10.0 5.9.5 5.9.4 5.8.8 5.8.7 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0' \ -Darchname=$ARCH-alphaslack-linux # Build perl make || exit 1 make test # Install perl (needed to build modules): make install || exit ( cd /usr/bin ln -sf perl$VERSION perl ln -sf c2ph pstruct ln -sf s2p psed ) # Install perl package: make install DESTDIR=$PKG # Add additional modules: ( cd ext ( tar xzf $CWD/DBI-${DBI}.tar.gz cd DBI-${DBI} chown -R root.root . perl Makefile.PL make || exit 1 make test make install || exit 1 make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/perl-$VERSION/DBI-${DBI} cp -a README $PKG/usr/doc/perl-$VERSION/DBI-${DBI} chmod 644 $PKG/usr/doc/perl-$VERSION/DBI-${DBI}/README ) ( tar xzf $CWD/DBD-mysql-${DBDMYSQL}.tar.gz cd DBD-mysql-${DBDMYSQL} chown -R root.root . perl Makefile.PL make || exit 1 make test make install || exit 1 make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL} cp -a INSTALL.html README TODO $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL} chmod 644 $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL}/* ) ( tar xzf $CWD/XML-Parser-${XMLPARSER}.tar.gz cd XML-Parser-${XMLPARSER} chown -R root.root . perl Makefile.PL make || exit 1 make test make install || exit 1 make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER} cp -a README $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER} chmod 644 $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER}/* ) ( tar xzf $CWD/XML-Simple-${XMLSIMPLE}.tar.gz cd XML-Simple-${XMLSIMPLE} chown -R root:root . perl Makefile.PL make make test make install || exit 1 make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/perl-$VERSION/XML-Simple${XMLSIMPLE} cp -a README $PKG/usr/doc/perl-$VERSION/XML-Simple${XMLSIMPLE} chmod 644 $PKG/usr/doc/perl-$VERSION/XML-Simple${XMLSIMPLE}/* ) ( tar xzf $CWD/URI-${URI}.tar.gz cd URI-${URI} chown -R root.root . perl Makefile.PL make || exit 1 make test make install || exit 1 make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/perl-$VERSION/URI-${URI} cp -a README $PKG/usr/doc/perl-$VERSION/URI-${URI} chmod 644 $PKG/usr/doc/perl-$VERSION/URI-${URI}/* ) ) # Strip everything: ( cd $PKG find . -type f | xargs file | grep "not strip" | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # 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 ) gzip -9 $PKG/usr/man/man3/* chown -R root.bin $PKG/usr/bin chmod 755 $PKG/usr/bin/* chmod 644 $PKG/usr/man/man?/* rmdir $PKG/usr/share # Insert the slack-desc: mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # Build the package: cd $PKG makepkg -l y -c n $TMP/perl-$VERSION-$ARCH-$BUILD.tgz ) 2>&1 | tee $TMP/perl.build.log