#!/bin/bash ##SlackBuild style build script CWD=`pwd` NAME=axel-modeler VERSION=0.3.4 ARCH=i586 BUILD=1vl58 VL_PACKAGER=easuter if [ "$TMP" = "" ]; then TMP=/tmp fi if [ $UID != 0 ]; then echo "You need to be root to run this script." exit fi if [ ! -x /usr/bin/requiredbuilder ]; then echo "Requiredbuilder not installed, or not executable." exit fi if [ ! -d $TMP/finished-packages ]; then mkdir -p $TMP/finished-packages fi PKG=$TMP/package-$NAME rm -rf $PKG mkdir -p $PKG/usr mkdir $PKG/install if [ "$ARCH" = "i386" ]; then export CFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then export CFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i586" ]; then export CFLAGS="-O2 -march=i586 -mtune=i686" elif [ "$ARCH" = "s390" ]; then export CFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then export CFLAGS="-O2" fi CXXFLAGS="$CFLAGS" cd $TMP rm -rf $NAME-$VERSION tar xvf $CWD/$NAME-$VERSION.tar.bz2 cd $NAME-$VERSION chown -R root:root . #Build new plugins for gcc-3 compatability rm -f plugins/*.so cd src/QSisl qmake4 rm Makefile cp $CWD/Makefile.QSisl-plugin Makefile make if ( ! make ); then echo "QSisl plugin failed to build." exit fi cd ../QSynaps qmake4 rm Makefile cp $CWD/Makefile.QSynaps_plugin Makefile make if ( ! make ); then echo "QSynaps plugin failed to build." exit fi cd ../QCore qmake4 rm Makefile cp $CWD/Makefile.QCore-plugin Makefile make if ( ! make ); then echo "QCore plugin failed to build." exit fi cd ../../ ./configure --prefix=/usr \ --qtdir=/usr/lib/qt4 gmake if ( ! gmake ); then echo "make failed" exit fi cp $CWD/slack-desc . cat >> slack-desc << EOF #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: `awk "/\.\/configure\ /" config.log` EOF mkdir -p $PKG/usr/bin mkdir -p $PKG/usr/share/Inria/Axel mkdir $PKG/usr/share/Inria/Axel/bin mkdir $PKG/usr/share/Inria/Axel/plugins mkdir $PKG/usr/share/Inria/Axel/samples mkdir $PKG/usr/share/pixmaps mkdir $PKG/usr/share/applications cp -r samples/* $PKG/usr/share/Inria/Axel/samples/ cp src/axel $PKG/usr/share/Inria/Axel/bin/ chmod 755 $PKG/usr/share/Inria/Axel/bin/axel cp $CWD/axel.sh $PKG/usr/bin/axel chmod 755 $PKG/usr/bin/axel cp bin/unix/p5server $PKG/usr/share/Inria/Axel/bin chmod 755 $PKG/usr/share/Inria/Axel/bin/p5server cp plugins/*.so $PKG/usr/share/Inria/Axel/plugins chmod 755 $PKG/usr/share/Inria/Axel/plugins/* cp $CWD/axel-modeler.desktop $PKG/usr/share/applications cp $CWD/axel_logo.png $PKG/usr/share/pixmaps ( 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 ) mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a \ AUTHORS COPYING CHANGELOG VERSION NEWS README TODO \ $PKG/usr/doc/$NAME-$VERSION cp slack-desc $PKG/install mkdir $PKG/usr/doc/$NAME-$VERSION/html cp doc/template/* $PKG/usr/doc/$NAME-$VERSION/html/ cd $PKG cp $CWD/slack-required install/ makepkg -p -l y -c n $NAME-$VERSION-$ARCH-$BUILD.tlz cp $NAME-$VERSION-$ARCH-$BUILD.tlz $TMP/finished-packages echo "$NAME-$VERSION package is in $TMP/finished-packages" rm -rf $TMP/$NAME-$VERSION rm -rf $PKG