2010-05-11 20:00:58 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for libxmi
|
|
|
|
# Written by David Spencer <nobbutl@yahoo.co.uk>
|
|
|
|
# This script is dedicated to the public domain
|
|
|
|
|
|
|
|
PRGNAM=libxmi
|
|
|
|
VERSION=1.2
|
2010-05-13 00:32:14 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2010-05-11 20:00:58 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:09:03 +02:00
|
|
|
# Automatically determine the architecture we're building on:
|
|
|
|
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
|
|
|
|
|
2010-05-11 20:00:58 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 00:32:14 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:00:58 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:32:14 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:09:03 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:00:58 +02: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 .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
2010-05-13 00:32:14 +02:00
|
|
|
# Substitute newer automake files that know about x86_64
|
|
|
|
# (as for SBo's soundtouch)
|
|
|
|
am=$(automake --version | grep "1." | cut -d " " -f 4 | cut -d "." -f 2)
|
|
|
|
for i in config.guess config.sub depcomp install-sh missing; do
|
|
|
|
rm -f $i
|
|
|
|
ln -s /usr/share/automake-1.$am/$i $i
|
|
|
|
done
|
|
|
|
|
2010-05-11 20:00:58 +02:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2010-05-13 00:32:14 +02:00
|
|
|
--libdir=/usr/lib$LIBDIRSUFFIX \
|
2010-05-11 20:00:58 +02:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
2010-05-13 00:32:14 +02:00
|
|
|
--disable-static \
|
|
|
|
--build=$ARCH-slackware-linux \
|
|
|
|
--host=$ARCH-slackware-linux
|
2010-05-11 20:00:58 +02:00
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-05-19 08:38:17 +02: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-11 20:00:58 +02:00
|
|
|
|
|
|
|
rm -f $PKG/usr/info/dir
|
|
|
|
gzip -9 $PKG/usr/info/*.info*
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 00:32:14 +02:00
|
|
|
cp -a \
|
|
|
|
AUTHORS COPYING CUSTOMIZE ChangeLog INSTALL NEWS README* TODO VERSION \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 20:00:58 +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:32:14 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|