#!/bin/sh # Heavily based on the Slackware 12.2 SlackBuild # http://www.glest.org # Packager Andrea Sciucca Gohanz ( gohanz at infinito.it) # http://www.slacky.it # # Required: lua, openal-soft, xerces-c = 2.8.0 # # Required only for compilation: jam # # Exit on most errors set -e CWD=`pwd` TMP=${TMP:-/tmp/tgz} PKG=$TMP/package/glest NAME=glest-source VERSION=3.2.1 CHOST=i486 ARCH=${ARCH:-i686} BUILD=1as SOURCE=http://www.titusgames.de/$NAME-$VERSION.tar.bz2 if [ ! -e $NAME-$VERSION.tar.bz2 ]; then wget -c $SOURCE fi SOURCE=http://surfnet.dl.sourceforge.net/sourceforge/glest/glest_data_$VERSION.zip if [ ! -e glest_data_$VERSION.zip ]; then wget -c $SOURCE fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi cd $TMP tar xvjf $CWD/$NAME-$VERSION.tar.bz2 echo -e "\E[0;32m+------------------------+\E[0;0m" echo -e "\E[0;32m| Start SlackBuild Glest |\E[0;0m" echo -e "\E[0;32m+------------------------+\E[0;0m" cd $NAME-$VERSION find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; chown -R root:root . CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --disable-static \ --program-prefix= \ --program-suffix= \ --build=$CHOST-slackware-linux jam # Installing data game files mkdir -p $PKG/usr/share ( cd $PKG/usr/share unzip -o $CWD/glest_data_3.2.1.zip ) mkdir -p $PKG/usr/bin cat << EOF > $PKG/usr/bin/glest #!/bin/bash cd /usr/share/glest_game exec /usr/share/glest_game/glest EOF chmod 755 $PKG/usr/bin/* install -m 755 glest $PKG/usr/share/glest_game cp $CWD/glest.ini $PKG/usr/share/glest_game touch $PKG/usr/share/glest_game/glest.log chmod 666 $PKG/usr/share/glest_game/glest.ini chmod 666 $PKG/usr/share/glest_game/glest.log chmod 666 $PKG/usr/share/glest_game/servers.ini # Installing some extra languages ( cd $PKG/usr/share/glest_game/data/lang for i in $CWD/lang/*.zip; do unzip $i; done ) mkdir -p $PKG/usr/share/applications cat << EOF > $PKG/usr/share/applications/glest.desktop [Desktop Entry] Encoding=UTF-8 Name=Glest Name[it]=Glest GenericName=3D Strategy Game GenericName[it]=Gioco di strategia in 3D Comment=Cross-platform 3D realtime strategy game Comment[it]=Gioco tridimensionale di strategia Icon=/usr/share/pixmaps/glest.png Exec=glest Terminal=false Type=Application Categories=Application;Game;StrategyGame; StartupNotify=false EOF mkdir -p $PKG/usr/share/pixmaps cp $CWD/glest.png $PKG/usr/share/pixmaps/glest.png mkdir -p $PKG/usr/doc/glest-$VERSION cp -a \ README* \ $PKG/usr/doc/glest-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/usr/doc/glest-$VERSION/slack-desc cat $CWD/glest.SlackBuild > $PKG/usr/doc/glest-$VERSION/glest.SlackBuild cd $PKG ADD=$(ls /var/log/packages/ | sed -ne 's/\(lua\)-\([^-]\+-[^-]\+-[^-]\+\)/\1 >= \2,/p' \ -e 's/\(openal-soft\)-\([^-]\+-[^-]\+-[^-]\+\)/\1 >= \2,/p' \ -e 's/\(xerces-c\)-\([^-]\+-[^-]\+-[^-]\+\)/\1 >= \2/p') \ requiredbuilder -y -v -s $CWD $PKG makepkg -l y -c n $CWD/glest-$VERSION-$ARCH-$BUILD.tgz if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi