slackbuilds/y/eliot/eliot.SlackBuild

114 lines
2.7 KiB
Text
Raw Normal View History

2010-04-13 06:44:15 +02:00
#!/bin/sh -x
# variables
CWD=$(pwd)
PRGNAM=$(basename $CWD)
2011-08-21 21:40:43 +02:00
VERSION=1.13
2010-04-13 06:44:15 +02:00
ARCH=$(uname -m)
2010-05-23 12:17:13 +02:00
BUILD=1
2010-04-14 09:54:38 +02:00
TAG=cyco
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
2010-04-14 11:31:37 +02:00
OUTPUT=/tmp
2010-04-13 06:44:15 +02:00
PREFIX=/usr
2010-04-14 09:55:36 +02:00
DOCS="ABOUT-NLS AUTHORS ChangeLog COPYING* INSTALL NEWS README THANKS TODO"
2010-04-13 06:44:15 +02:00
2010-04-14 09:54:38 +02:00
SLCKFLAGS="-O2"
2010-04-13 06:44:15 +02:00
case $ARCH in
"x86_64")
2010-04-14 09:54:38 +02:00
SLCKFLAGS="$SLCKFLAGS -fPIC"
2010-04-13 06:44:15 +02:00
;;
*)
esac
# nettoyage pr<70>alable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
2010-04-13 06:44:15 +02:00
mkdir -p $PKG
# mise en place
2010-04-14 09:54:38 +02:00
( cd $TMP
[ ! -e $CWD/$PRGNAM-$VERSION.tar.?z* ] && \
wget -c http://dl.sv.nongnu.org/releases-noredirect/eliot/releases/$PRGNAM-$VERSION.tar.gz \
-O $CWD/$PRGNAM-$VERSION.tar.gz
tar xf $CWD/$PRGNAM-$VERSION.tar.?z*
2010-04-14 09:54:38 +02:00
)
( cd $TMP/$PRGNAM-$VERSION
2010-04-14 09:54:38 +02:00
# configuration
2010-04-14 11:27:50 +02:00
CCPFLAGS=$SLCKFLAGS \
2010-04-14 09:54:38 +02:00
CFLAGS=$SLCKFLAGS \
2010-04-14 11:27:50 +02:00
LIBS="-lncursesw" \
LDFLAGS="-L$PREFIX/lib$(echo $ARCH | grep -o 64)" \
2010-04-14 11:51:28 +02:00
./configure \
2010-04-14 09:54:38 +02:00
--prefix=$PREFIX \
2010-04-14 09:57:43 +02:00
--mandir=$PREFIX/man \
--infodir=$PREFIX/info \
2010-04-14 11:27:50 +02:00
--libdir=$PREFIX/lib$(echo $ARCH | grep -o 64) \
--enable-text
2010-04-14 09:54:38 +02:00
2010-04-14 11:36:35 +02:00
# just close your eyes and let's pretend this doesn't exist
2010-04-14 09:54:38 +02:00
for m in qt/*.moc.cpp ; do
moc ${m%moc.cpp}h > $m ;
done
# compilation
make -j3 PREFIX=$PREFIX
2010-04-14 11:51:52 +02:00
( cd utils
2010-04-14 11:49:26 +02:00
make eliottxt
)
2010-04-14 09:54:38 +02:00
# installation
make install DESTDIR=$PKG
2010-04-14 11:49:26 +02:00
cp utils/eliottxt $PKG$PREFIX/bin/
2010-04-14 11:51:52 +02:00
2010-04-14 09:54:38 +02:00
# dictionaries
#note: ods5.dawg has been taken down from upstream due to legal requirement
DICOS="eliot-dic-fr.dawg twl06.dawg sowpods06.dawg"
mkdir -p $PKG$PREFIX/share/$PRGNAM
2010-04-14 09:54:38 +02:00
for d in $DICOS ; do
[ ! -e $CWD/$d ] && \
wget -c http://dl.sv.nongnu.org/releases/eliot/dict/$d -O $CWD/$d
done
cp $CWD/*.dawg $PKG$PREFIX/share/$PRGNAM/
2010-04-14 09:54:38 +02:00
)
2010-04-13 06:53:52 +02:00
2010-04-13 06:44:15 +02:00
# correction
2010-04-14 09:54:38 +02:00
chown -R root:root $PKG/*
2010-04-13 06:44:15 +02:00
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
( cd $TMP/$PRGNAM-$VERSION
cp -R $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
2010-04-14 09:54:38 +02:00
)
2010-04-13 06:44:15 +02:00
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
# Strip binaries
2010-04-14 09:57:43 +02:00
find $PKG | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find $PKG | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
2010-04-13 06:44:15 +02:00
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (Free Scrabble game)
$PRGNAM:
$PRGNAM: Eliot is an open source Scrabble game, freely available under the GNU GPL license.
$PRGNAM:
$PRGNAM: Dictionaries are installed in $PREFIX/share/$PRGNAM
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://www.nongnu.org/eliot/en/index.html
$PRGNAM:
2010-04-13 06:44:15 +02:00
EOF
# empaquetage
2010-04-14 09:54:38 +02:00
( cd $PKG
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d -)-$ARCH-$BUILD$TAG.txz
2010-04-14 09:54:38 +02:00
)