#!/bin/sh # variables CWD=$(pwd) PRGNAM=$(basename $CWD) VERSION=2.0 ARCH=$(uname -m) BUILD=1 TAG=gwh TMP=/tmp/$TAG PKG=$TMP/pkg-$PRGNAM OUTPUT=/tmp PREFIX=/usr DOCS="ABOUT-NLS AUTHORS ChangeLog COPYING* INSTALL NEWS README THANKS TODO" SLCKFLAGS="-O2" case $ARCH in "x86_64") SLCKFLAGS="$SLCKFLAGS -fPIC" ;; *) esac # nettoyage préalable rm -fr $PKG $TMP/$PRGNAM-$VERSION mkdir -p $PKG # mise en place ( cd $TMP [ ! -e $CWD/$PRGNAM-$VERSION.tar.?z* ] && \ wget -c http://dl.sv.nongnu.org/releases-noredirect/eliot/releases/$VERSION/$PRGNAM-$VERSION.tar.gz \ -O $CWD/$PRGNAM-$VERSION.tar.gz tar xf $CWD/$PRGNAM-$VERSION.tar.?z* ) ( cd $TMP/$PRGNAM-$VERSION # configuration CCPFLAGS=$SLCKFLAGS \ CFLAGS=$SLCKFLAGS \ LIBS="-lncursesw" \ LDFLAGS="-L$PREFIX/lib$(echo $ARCH | grep -o 64)" \ ./configure \ --prefix=$PREFIX \ --mandir=$PREFIX/man \ --infodir=$PREFIX/info \ --libdir=$PREFIX/lib$(echo $ARCH | grep -o 64) \ --enable-text # just close your eyes and let's pretend this doesn't exist for m in qt/*.moc.cpp ; do moc ${m%moc.cpp}h > $m ; done # compilation make -j3 PREFIX=$PREFIX ( cd utils make eliottxt ) # installation make install DESTDIR=$PKG cp utils/eliottxt $PKG$PREFIX/bin/ # 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 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/ ) # correction chown -R root:root $PKG/* mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION ( cd $TMP/$PRGNAM-$VERSION cp -R $DOCS $PKG/usr/doc/$PRGNAM-$VERSION ) [ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; # Strip binaries 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 # embaumement mkdir -p $PKG/install cat < $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: EOF # empaquetage ( cd $PKG makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d -)-$ARCH-$BUILD$TAG.txz )