#!/bin/sh # Heavily based on the Slackware 11.0 SlackBuild # http://www.cstr.ed.ac.uk/projects/speech_tools/ # 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-speech_tools NAME=speech_tools VERSION=1.2.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 cd $TMP tar xvzf $CWD/$NAME-$VERSION.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" 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="" \ ( cd config sed -i "s|# SHARED=1|SHARED=1|g" config ) 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/usr/doc/$NAME-$VERSION cp -a \ INSTALL README \ $PKG/usr/doc/$NAME-$VERSION cd $CWD cp -a *.SlackBuild slack-desc $PKG/usr/doc/$NAME-$VERSION mkdir -p $PKG/usr/bin find $TMP/$NAME/bin/ -perm -755 -exec cp {} $PKG/usr/bin \; mkdir -p $PKG/usr/share/$NAME/config mkdir -p $PKG/usr/share/$NAME/lib/siod mkdir -p $PKG/usr/lib cp -a $TMP/$NAME/lib/lib* $PKG/usr/lib cp -a $TMP/$NAME/lib/lib* $PKG/usr/share/$NAME/lib cp -a $TMP/$NAME/lib/siod/* $PKG/usr/share/$NAME/lib/siod cp -a -r $TMP/$NAME/config/* $PKG/usr/share/$NAME/config cp -a -r $TMP/$NAME/base_class $PKG/usr/share/$NAME cp -a -r $TMP/$NAME/include $PKG/usr/share/$NAME mkdir -p $PKG/usr/share/$NAME/example_data cp -a $TMP/$NAME/lib/example_data/* $PKG/usr/share/$NAME/example_data ( cd $PKG find -iname 'Makefile' -exec rm -f {} \; find -iname 'config.in' -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 "shared object" | 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 # # 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 cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG chown -R root.root . requiredbuilder -y -v -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-1.2.95beta-$ARCH-$BUILD.tlz