2010-05-11 14:55:18 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for potrace
|
|
|
|
# Written by Kyle Guinn
|
|
|
|
|
|
|
|
PRGNAM=potrace
|
2011-09-21 13:45:51 +02:00
|
|
|
VERSION=1.10
|
2010-05-11 14:55:18 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-13 00:28:11 +02:00
|
|
|
|
2010-05-23 03:44:19 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2010-06-04 07:05:32 +02:00
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
2010-05-23 03:44:19 +02:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 19:44:53 +02:00
|
|
|
CWD=$(pwd)
|
2010-05-11 14:55:18 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
2011-09-21 13:45:51 +02:00
|
|
|
PKG=$TMP/package-$PRGNAM
|
2010-05-11 14:55:18 +02:00
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2011-01-18 06:57:23 +01:00
|
|
|
DOCS="AUTHORS COPYING ChangeLog INSTALL NEWS README*"
|
|
|
|
|
2010-05-11 14:55:18 +02:00
|
|
|
if [ "$ARCH" = "i486" ]; then
|
2011-01-18 06:57:23 +01:00
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 14:55:18 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2011-01-18 06:57:23 +01:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 00:28:11 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
2011-01-18 06:57:23 +01:00
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-05-23 03:44:19 +02:00
|
|
|
else
|
2011-01-18 06:57:23 +01:00
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 14:55:18 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-23 03:44:19 +02:00
|
|
|
set -e
|
|
|
|
|
2010-05-11 14:55:18 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
2010-05-11 19:44:53 +02:00
|
|
|
cd $TMP
|
2010-05-11 14:55:18 +02:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-23 03:44:19 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
2010-05-11 19:44:53 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-11 14:55:18 +02:00
|
|
|
chown -R root:root .
|
2011-01-18 06:57:23 +01:00
|
|
|
chmod -R u+w,go+r-w,a-st .
|
2010-05-11 19:44:53 +02:00
|
|
|
|
|
|
|
# For metric units and papersizes, use the following flags to configure:
|
|
|
|
# --enable-metric Use metric units (centimeters) as default
|
|
|
|
# --enable-a4 Use A4 as the default papersize
|
|
|
|
|
2010-05-11 14:55:18 +02:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2011-01-18 06:57:23 +01:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 14:55:18 +02:00
|
|
|
--sysconfdir=/etc \
|
2010-05-23 03:44:19 +02:00
|
|
|
--localstatedir=/var \
|
2011-09-21 13:45:51 +02:00
|
|
|
--infodir=/usr/info \
|
2011-01-18 06:57:23 +01:00
|
|
|
--mandir=/usr/man \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--build=$ARCH-slackware-linux \
|
2011-09-21 13:45:51 +02:00
|
|
|
--enable-shared \
|
|
|
|
--disable-static \
|
2011-01-18 06:57:23 +01:00
|
|
|
--with-libpotrace
|
2010-05-13 00:28:11 +02:00
|
|
|
|
2010-05-11 19:44:53 +02:00
|
|
|
make
|
|
|
|
make install-strip DESTDIR=$PKG
|
2010-05-11 14:55:18 +02:00
|
|
|
|
2010-05-23 03:44:19 +02:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
2010-05-11 14:55:18 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-01-18 06:57:23 +01:00
|
|
|
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 14:55:18 +02:00
|
|
|
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
|
2010-05-13 00:28:11 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|