perl/perl-xml-sax: Fix doinst.sh path and clean up build.

Fix doinst.sh to use the correct perl path.
    Thanks to Thomas Morper for the report.
  Clean up the build.

Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
This commit is contained in:
dsomero 2011-09-09 20:13:37 -04:00 committed by Niels Horn
parent c24b50e810
commit 5925bf810b
2 changed files with 31 additions and 21 deletions

View file

@ -1,4 +1,4 @@
if [ -f usr/lib/perl5/vendor_perl/5.10.0/XML/SAX/ParserDetails.ini ]; then
if [ -f @PERLPATH@/XML/SAX/ParserDetails.ini ]; then
echo "ParserDetails.ini file already installed.";
else
perl -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()"

View file

@ -1,22 +1,21 @@
#!/bin/sh
# Slackware build script for perl-xml-namespacesupport
# Written by Murat D. Kadirov <banderols@gmail.com>
# Modified by SlackBuils.org
PRGNAM=perl-xml-sax
SRCNAM=XML-SAX
VERSION=0.16
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
# Automatically determine the architecture we're building on:
SRCNAM=XML-SAX
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
@ -28,29 +27,38 @@ OUTPUT=${OUTPUT:-/tmp}
DOCS="Changes README LICENSE"
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP || exit 1
cd $TMP
rm -rf $SRCNAM-$VERSION
tar -xzvf $CWD/$SRCNAM-$VERSION.tar.gz || exit 1
cd $SRCNAM-$VERSION || exit 1
tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
cd $SRCNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
perl Makefile.PL || exit 1
perl Makefile.PL \
PREFIX=/usr \
INSTALLDIRS=vendor \
INSTALLVENDORMAN3DIR=/usr/man/man3
# Comment out the test for ParserDetails.ini, we'll do this from the doinst.sh
sed -i -e 's,@\$(PERL),#@\$(PERL),' Makefile
make || exit 1
make install INSTALLDIRS=vendor DESTDIR=$PKG || exit 1
mv $PKG/usr/share/man $PKG/usr && rm -rf $PKG/usr/share
gzip -9 $PKG/usr/man/man3/* 2> /dev/null
make
make test
make install DESTDIR=$PKG
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
# Remove perlocal.pod and .packlist from $PKG
( cd $PKG
find . -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f
)
find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true
# Remove empty directories
find $PKG -depth -type d -empty -exec rm -rf {} \;
@ -58,11 +66,13 @@ find $PKG -depth -type d -empty -exec rm -rf {} \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
chmod 644 $PKG/usr/doc/$PRGNAM-$VERSION/*
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
# Add the correct perl path in the doinst.sh file.
PERLPATH=$(perl -V:installvendorlib | cut -f2- -d/ | cut -f1 -d\')
sed s#@PERLPATH@#$PERLPATH# $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}