2010-05-11 14:55:18 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for potrace
|
|
|
|
# Written by Kyle Guinn
|
|
|
|
|
|
|
|
PRGNAM=potrace
|
2010-05-11 19:44:53 +02:00
|
|
|
VERSION=1.8
|
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
|
|
|
# Automatically determine the architecture we're building on:
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2010-06-04 07:05:32 +02:00
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
2010-05-23 03:44:19 +02:00
|
|
|
# Unless $ARCH is already set, use uname -m for all other archs:
|
2010-06-04 07:05:32 +02:00
|
|
|
*) 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}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
2010-05-13 00:28:11 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 14:55:18 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2010-05-13 00:28:11 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-23 03:44:19 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
2010-05-13 00:28:11 +02:00
|
|
|
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 .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
2010-05-11 19:44:53 +02:00
|
|
|
# Apply the xfig patch
|
2010-12-30 00:21:54 +01:00
|
|
|
patch -p0 < $CWD/potrace-1.8-xfig.patch
|
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 \
|
2010-05-13 00:28:11 +02: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 \
|
|
|
|
--build=$ARCH-slackware-linux
|
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
|
|
|
|
cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README \
|
|
|
|
$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
|
2010-05-13 00:28:11 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|