2010-05-11 14:56:24 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for physfs
|
|
|
|
# Written by Erik Hanson erik@slackbuilds.org
|
2010-05-11 19:45:23 +02:00
|
|
|
# Modified for version 1.1.1 by Heinz Wiesinger <hmwiesinger@gmx.at>
|
2010-05-11 14:56:24 +02:00
|
|
|
|
|
|
|
PRGNAM=physfs
|
2010-05-11 19:45:23 +02:00
|
|
|
VERSION=1.1.1
|
2010-05-11 14:56:24 +02:00
|
|
|
ARCH=${ARCH:-i486}
|
2010-05-11 19:45:23 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2010-05-11 14:56:24 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-11 19:45:23 +02:00
|
|
|
|
|
|
|
CWD=$(pwd)
|
2010-05-11 14:56:24 +02:00
|
|
|
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"
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP || exit 1
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar zxvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
|
|
|
|
cd $PRGNAM-$VERSION || exit 1
|
|
|
|
chown -R root:root .
|
|
|
|
chmod -R a-s,u+w,go+r-w .
|
|
|
|
|
2010-05-11 19:45:23 +02:00
|
|
|
cmake \
|
|
|
|
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr || exit 1
|
2010-05-11 14:56:24 +02:00
|
|
|
|
|
|
|
make || exit 1
|
|
|
|
make install DESTDIR=$PKG || exit 1
|
|
|
|
|
|
|
|
( cd $PKG
|
2010-05-11 19:45:23 +02:00
|
|
|
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-11 14:56:24 +02:00
|
|
|
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
)
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 19:45:23 +02:00
|
|
|
cp -a CHANGELOG.txt CREDITS.txt INSTALL.txt LICENSE.txt TODO.txt \
|
|
|
|
lzma/LZMA-LICENSE.txt $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 14:56:24 +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
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
|