2010-05-13 06:59:16 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for pypoppler
|
|
|
|
|
|
|
|
# Written by Larry Hajali <larryhaja[at]gmail[dot]com>
|
|
|
|
|
|
|
|
PRGNAM=pypoppler
|
2010-06-14 13:50:37 +08:00
|
|
|
VERSION=0.12.1
|
2012-09-04 18:39:27 +08:00
|
|
|
BUILD=${BUILD:-4}
|
2010-05-13 06:59:16 +08:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 13:10:08 +08:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-13 06:59:16 +08:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-06-14 13:50:37 +08:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
2010-05-13 06:59:16 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
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 {} \;
|
|
|
|
|
2011-03-28 13:26:21 +08:00
|
|
|
# Fix building with poppler 0.15+ and some upstream fixes.
|
|
|
|
patch -p0 < $CWD/patches/pypoppler-0.12.1-75_74.diff
|
|
|
|
patch -p0 < $CWD/patches/pypoppler-0.12.1-79_78.diff
|
|
|
|
patch -p0 < $CWD/patches/poppler0.15.0-changes.patch
|
2012-09-04 18:39:27 +08:00
|
|
|
patch -p1 < $CWD/patches/pypoppler-0.12.1-poppler-0.18.0-minimal-fix-revisited.patch
|
2011-03-28 13:26:21 +08:00
|
|
|
|
2011-07-28 13:25:26 +08:00
|
|
|
autoreconf -ivf
|
|
|
|
|
2010-05-13 06:59:16 +08:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-05-19 14:39:11 +08:00
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-13 06:59:16 +08:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
|
|
|
AUTHORS ChangeLog COPYING INSTALL NEWS \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|