slackbuilds/l/arabica/arabica.SlackBuild

91 lines
1.8 KiB
Text
Raw Normal View History

2010-04-13 06:00:37 +02:00
#!/bin/sh -x
# variables
TAG=cyco
OUTPUT=/tmp
TMP=/tmp/$TAG
2010-04-13 06:00:37 +02:00
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
2010-04-13 06:00:37 +02:00
2010-10-24 19:32:20 +02:00
VERSION=2010-November
2010-04-13 06:00:37 +02:00
DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README TODO"
ARCH=$(uname -m)
BUILD=1
2010-04-13 06:00:37 +02:00
PREFIX=/usr
case $ARCH in
"x86_64")
SLCKFLAGS="-fPIC -O2"
;;
*)
SLCKFLAGS="-O2"
esac
# nettoyage pr<70>alable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
2010-04-13 06:00:37 +02:00
mkdir -p $PKG
# mise en place
cd $TMP
[ ! -e $CWD/$PRGNAM-$VERSION.tar.?z* ] && wget -c http://downloads.sourceforge.net/project/arabica/arabica/November-10/$PRGNAM-$VERSION.tar.bz2 -O $CWD/$PRGNAM-$VERSION.tar.bz2
tar xf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
2010-04-13 06:00:37 +02:00
# configuration
CFLAGS=$SLCKFLAGS \
CPPFLAGS=$SLCKFLAGS \
./configure \
--prefix=$PREFIX \
--mandir=$PREFIX/man \
--libdir=$PREFIX/lib$( [ $ARCH = "x86_64" ] && echo 64 )
# compilation
make -j3 PREFIX=$PREFIX
# installation
make install DESTDIR=$PKG
# correction
cd $PKG
chown -R root:root *
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cd $TMP/$PRGNAM-$VERSION
cp -R $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
2010-04-13 06:00:37 +02:00
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
# Strip binaries
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://www.jezuk.co.uk/cgi-bin/view/arabica
$PRGNAM:
$PRGNAM: see /usr/doc/$PRGNAM-$VERSION for more details
$PRGNAM:
2010-04-13 06:00:37 +02:00
EOF
# empaquetage
cd $PKG
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz