slackbuilds_ponce/network/sphinx/sphinx.SlackBuild

73 lines
1.5 KiB
Text
Raw Normal View History

2010-05-11 15:01:36 +02:00
#!/bin/sh
# Slackware build script for Sphinx
# Written by <youngmug@animeneko.net>
# Modified by the SlackBuilds.org project
PRGNAM=sphinx
VERSION=0.9.9
2010-05-11 15:01:36 +02:00
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
2010-05-11 15:01:36 +02:00
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-sphinx
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
2010-05-11 15:01:36 +02:00
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
2010-05-11 15:01:36 +02:00
fi
set -e
2010-05-11 15:01:36 +02:00
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
2010-05-11 15:01:36 +02:00
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $TMP/$PRGNAM-$VERSION
2010-05-11 15:01:36 +02:00
chown -R root:root .
chmod -R a-s,u+w,go+r-w .
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
2010-05-11 15:01:36 +02:00
--sysconfdir=/etc/sphinx \
--localstatedir=/var \
--build=$ARCH-slackware-linux
2010-05-11 15:01:36 +02:00
make
make install DESTDIR=$PKG
2010-05-11 15:01:36 +02:00
2010-05-19 08:45:52 +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 15:01:36 +02:00
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING INSTALL doc/* $PKG/usr/doc/$PRGNAM-$VERSION
2010-05-11 15:01:36 +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.${PKGTYPE:-tgz}