#!/bin/sh # Heavily based on the Slackware 11.0 SlackBuild # http://www.cstr.ed.ac.uk/projects/festival/ # Packager Andrea Sciucca Gohanz ( gohanz at infinito.it) # Script borrowed and modified to be compatable with Vectorlinux by exeterdad if [ $UID != 0 ]; then echo -e "\E[0;32m+-----------------------------------------+\E[0;0m" echo -e "\E[0;32m| You need to be root to run this script. |\E[0;0m" echo -e "\E[0;32m+-----------------------------------------+\E[0;0m" exit fi if [ ! -x /usr/bin/requiredbuilder ]; then echo -e "\E[0;32m+---------------------------------------------------+\E[0;0m" echo -e "\E[0;32m| Requiredbuilder not installed, or not executable. |\E[0;0m" echo -e "\E[0;32m+---------------------------------------------------+\E[0;0m" exit fi CWD=`pwd` if ["$TMP" = ""]; then TMP=/usr/share fi PKG=/tmp/package-festival NAME=festival VERSION=1.95-beta ARCH=i586 BUILD=1vl58 VL_PACKAGER=exeterdad if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi chmod +x festival festival_client festival_server_control rc.festival saytime text2pos text2wave cd $TMP tar xvzf $CWD/$NAME-$VERSION.tar.gz # tar xvzf $CWD/festlex_CMU.tar.gz # tar xvzf $CWD/festlex_OALD.tar.gz # tar xvzf $CWD/festlex_POSLEX.tar.gz # tar xvzf $CWD/festvox_don.tar.gz tar xvzf $CWD/festvox_kallpc16k.tar.gz # tar xvzf $CWD/festvox_kedlpc16k.tar.gz tar xvzf $CWD/festvox_rablpc16k.tar.gz tar xvzf $CWD/festvox_cmu_us_awb_arctic_hts.tar.gz tar xvzf $CWD/festvox_cmu_us_bdl_arctic_hts.tar.gz tar xvzf $CWD/festvox_cmu_us_jmk_arctic_hts.tar.gz tar xvzf $CWD/festvox_cmu_us_slt_arctic_hts.tar.gz echo -e "\E[0;32m+-------------------------------------+\E[0;0m" echo -e "\E[0;32m| Start SlackBuild $NAME-$VERSION |\E[0;0m" echo -e "\E[0;32m+-------------------------------------+\E[0;0m" ###Asterisk Patch patch -p1 <$CWD/festival-1.95.diff cd $NAME find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; chown -R root.root . export CFLAGS="-O2 -march=i586 -mtune=i686" export CXXFLAGS="-O2 -march=i586 -mtune=i686" ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --program-prefix="" \ --program-suffix="" make if ( ! make ); then echo -e "\E[0;32m+------------------------------+\E[0;0m" echo -e "\E[0;32m| Make failed for some reason. |\E[0;0m" echo -e "\E[0;32m| Refer to make-$NAME.log |\E[0;0m" echo -e "\E[0;32m+------------------------------+\E[0;0m" exit fi make test mkdir -p $PKG/etc/rc.d cp -a $CWD/rc.festival $PKG/etc/rc.d mkdir -p $PKG/var/log/festival mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a \ ACKNOWLEDGMENTS COPYING INSTALL NEWS README \ $PKG/usr/doc/$NAME-$VERSION cd $CWD # # append build information to the end of the slack-desc file # cat >> $CWD/slack-desc << EOF #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --program-prefix="" --program-suffix="" EOF cp -a *.SlackBuild slack-desc text2wave text2pos saytime rc.festival festival_* festival $PKG/usr/doc/$NAME-$VERSION mkdir -p $PKG/usr/bin ( cd $TMP/$NAME/src/main cp -a festival $PKG/usr/bin/festival.bin cp -a festival_client $PKG/usr/bin/festival_client.bin ) cp -a $CWD/festival $PKG/usr/bin cp -a $CWD/festival_client $PKG/usr/bin cp -a $CWD/text2wave $PKG/usr/bin cp -a $CWD/saytime $PKG/usr/bin cp -a $CWD/festival_server $PKG/usr/bin cp -a $CWD/festival_server_control $PKG/usr/bin ( cd $TMP/$NAME/bin cp -a festival_server festival_server_control $PKG/usr/bin ) mkdir -p $PKG/usr/share/festival/lib cp -a -r $TMP/$NAME/lib/* $PKG/usr/share/festival/lib cp -a $TMP/$NAME/src/lib/* $PKG/usr/share/festival/lib mkdir -p $PKG/usr/include/festival cp -a $TMP/$NAME/src/include/* $PKG/usr/include/festival mkdir -p $PKG/usr/man/man1 ( cd $TMP/$NAME/doc cp -a festival.1 festival_client.1 $PKG/usr/man/man1 ) ( cd $PKG find -iname 'Makefile' -exec rm -f {} \; find -iname '.made' -exec rm -f {} \; ) ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null ) mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc gzip -9 $PKG/usr/man/man1/* cd $PKG chown -R root.root . requiredbuilder -y -v -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-1.95beta-$ARCH-$BUILD.tlz if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$NAME-$VERSION rm -rf $PKG fi