#!/bin/bash set -xe ###################################################### # Configure extension creation parameters # ###################################################### S=$(basename $0) PACKAGE=${S%%.build} VERSION=0.7.2 SRCNAM=$PACKAGE-$VERSION.tar.bz2 WRKDIR=$PACKAGE-$VERSION EXTNAM=$PACKAGE TMPDIR=/tmp/$PACKAGE-$VERSION OUTDIR=$PWD/../../build/$(version) SRCDIR=$PWD ###################################################### # Prepare extension creation ###################################################### # Remove dirs and files left from previous creation rm -r -f $WRKDIR rm -r -f $TMPDIR # Crete temporary directory mkdir -p $TMPDIR $OUTDIR ###################################################### # Compile extension ###################################################### # Export variables needed for compilation export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig export CPPFLAGS="-I/usr/local/include -I/usr/include" export CFLAGS="-O2 -march=i486 -mtune=i486" export CXXFLAGS="-O2 -fno-exceptions -fno-rtti -march=i486 -mtune=i486" export LDFLAGS="-Wl,-O2" # Unpack source in to WRK directory tar -xf $SRCNAM pushd $WRKDIR patch -p1 -bz .qf-inline < $SRCDIR/qf-inline.patch patch -p0 -bz .qf-x11-fullscreen < $SRCDIR/qf-x11-fullscreen.patch ./configure --prefix=/usr/local --disable-static --disable-debug --without-tools \ --disable-vidmode --disable-dga --disable-curses \ --disable-sun --disable-jack --disable-oss --disable-sdl \ --with-x --with-clients=x11 \ --without-servers \ --with-global-cfg=/usr/local/etc/quakeforge.conf \ --with-user-cfg=~/.quakeforge/quakeforge.conf \ --with-userpath=~/.quakeforge \ --without-ipv6 \ --with-plugin-path=/usr/local/lib/qf-plugins make ###################################################### # install to $TMPDIR ###################################################### make install DESTDIR=$TMPDIR mkdir -p $TMPDIR/usr/local/share/doc/$PACKAGE cp COPYING NEWS $TMPDIR/usr/local/share/doc/$PACKAGE/ sed -rne 's/Author: */ - /p' < ChangeLog | sed -re 's/<.*>//' | sort | uniq >$TMPDIR/usr/local/share/doc/$PACKAGE/AUTHORS install -Dm644 $SRCDIR/quakeforge-x11.desktop $TMPDIR/usr/local/share/applications/quakeforge-x11.desktop install -Dm644 $SRCDIR/quakeforge-x11.png $TMPDIR/usr/local/share/pixmaps/quakeforge-x11.png install -Dm644 $SRCDIR/menu.dat $TMPDIR/usr/local/share/quakeforge/id1/menu.dat install -Dm644 $SRCDIR/menu.plist $TMPDIR/usr/local/share/quakeforge/id1/menu.plist install -Dm644 $SRCDIR/quakeforge.conf $TMPDIR/usr/local/etc/quakeforge.conf # Delete compilation work directory popd rm -r -f $WRKDIR # Strip executables find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded ###################################################### # Clear unusefull files ###################################################### #remove unused file(s) rm -Rf $TMPDIR/usr/local/include rm -Rf $TMPDIR/usr/local/lib/pkgconfig rm -f $TMPDIR/usr/local/lib/*.a $TMPDIR/usr/local/lib/*.la rm -f $TMPDIR/usr/local/lib/qf-plugins/*.a $TMPDIR/usr/local/lib/qf-plugins/*.la ################################################### # Startup script ################################################### mkdir -p $TMPDIR/usr/local/tce.installed cat >$TMPDIR/usr/local/tce.installed/$PACKAGE <$OUTDIR/$INFO if [ -f $TCZ.tree ]; then cp $TCZ.tree $OUTDIR/$TCZ.tree cat $TCZ.tree | grep -wv "$TCZ" | sed -re 's/^[ \t]+//' | sort | uniq > $OUTDIR/$TCZ.dep fi done ################################################### pushd $OUTDIR submitqc --libs --tcz=$EXTNAM.tcz popd