#!/bin/bash ##SlackBuild style build script CWD=`pwd` NAME=qt4-qsa VERSION=1.2.2 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 . cp $CWD/qt4_qtdir_VL-patch.diff . patch -Np0 -i qt4_qtdir_VL-patch.diff #Both dbug and release QSA libraries must be built, since some apps #like Axel need both to compile #Build the dbug libraries first QTDIR="/usr/lib/qt4" ./configure -prefix /usr/lib/qt4 -debug make if ( ! make ); then echo "dbug buiuld failed" exit fi make clean #Build the release libraries QTDIR="/usr/lib/qt4" ./configure -prefix /usr/lib/qt4 -release make if ( ! make ); then echo "release build 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 #Since the QSA Makefile doesn't support a DESTDIR installation, the files #must be installed manually. #This procedure was taken from an actual installation of QSA to the #the filesystem (with a few modifications of course): mkdir -p $PKG/usr/lib/qt4/lib mkdir -p $PKG/usr/lib/qt4/mkspecs/features mkdir -p $PKG/usr/lib/qt4/doc/html mkdir $PKG/usr/lib/qt4/include install -m 644 -p src/qsa/qsaglobal.h $PKG/usr/lib/qt4/include/ install -m 644 -p src/qsa/qsconfig.h $PKG/usr/lib/qt4/include/ install -m 644 -p src/qsa/qsobjectfactory.h $PKG/usr/lib/qt4/include/ install -m 644 -p src/qsa/qswrapperfactory.h $PKG/usr/lib/qt4/include/ install -m 644 -p src/qsa/qseditor.h $PKG/usr/lib/qt4/include/ install -m 644 -p src/qsa/qsproject.h $PKG/usr/lib/qt4/include/ install -m 644 -p src/qsa/qsinterpreter.h $PKG/usr/lib/qt4/include/ install -m 644 -p src/qsa/qsinputdialogfactory.h $PKG/usr/lib/qt4/include/ install -m 644 -p src/qsa/qsscript.h $PKG/usr/lib/qt4/include/ install -m 644 -p src/qsa/../ide/qsworkbench.h $PKG/usr/lib/qt4/include/ install -m 755 -p lib/libqsa.so.1.2.1 $PKG/usr/lib/qt4/lib/libqsa.so.1.2.1 install -m 755 -p lib/libqsa_debug.so.1.2.1 $PKG/usr/lib/qt4/lib/libqsa_debug.so.1.2.1 install -m 644 -p src/qsa/qsa.prf $PKG/usr/lib/qt4/mkspecs/features/ install -m 644 -p doc/html/assistant.dcf $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/classes.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/console.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/credits.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/designer.dcf $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/example-scriptbutton.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/example-spreadsheet.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/examples.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/extensions-framework.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/filter.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/functions.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/game.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/getting-started.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/headers.html $PKG/usr/lib/qt4/doc/html/ cp -f -r doc/html/images $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/importscript.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/index.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/language.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/linguist.dcf $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qmake.dcf $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsa.dcf $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsa.index $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qseditor-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qseditor.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsinputdialogfactory-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsinputdialogfactory.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsinterpreter-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsinterpreter.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsobjectfactory-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsobjectfactory.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsproject-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsproject.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsscript-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsscript.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsstackframe-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsstackframe.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsutilfactory-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsutilfactory.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsworkbench-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qsworkbench.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qswrapperfactory-members.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/qswrapperfactory.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/scribblescripter.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/workbench-reference.html $PKG/usr/lib/qt4/doc/html/ install -m 644 -p doc/html/wrappers.html $PKG/usr/lib/qt4/doc/html/ ( cd $PKG/usr/lib/qt4/lib ln -sf libqsa.so.1.2.1 libqsa.so ln -sf libqsa.so.1.2.1 libqsa.so.1 ln -sf libqsa.so.1.2.1 libqsa.so.1.2 ln -sf libqsa_debug.so.1.2.1 libqsa_debug.so ln -sf libqsa_debug.so.1.2.1 libqsa_debug.so.1 ln -sf libqsa_debug.so.1.2.1 libqsa_debug.so.1.2 ) ( 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 NEWS README TODO \ $PKG/usr/doc/$NAME-$VERSION cp slack-desc $PKG/install cp $CWD/doinst.sh $PKG/install cd $PKG requiredbuilder -v -y . 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