#!/usr/bin/bash # This SlackBuild like script is designed for Vector Linux packages by exeterdad. # This script assumes it will be launched within "/NAME/VERSION/src" dir. With all sources in "src" # Your Vector Linux .tlz package, slack-desc, and slack-required will be found in "VERSION" dir. # The extraction and build will be in a temp dir created in "NAME" dir, and then removed on exit. # Comment out last line to keep this dir intact. SHIM="# " # Add enough spaces between quotes to match quotes around name on next line NAME="monsterz" VERSION=0.7.0 ARCH=i586 BUILD=1vl59 VL_PACKAGER=exeterdad CWD=`pwd` cd ../ RELEASEDIR=`pwd` cd $CWD mkdir $RELEASEDIR/tmp TMP=$RELEASEDIR/tmp PKG=$TMP/package-$NAME 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 export CFLAGS="-O2 -march=i586 -mtune=i686" export CXXFLAGS="-O2 -march=i586 -mtune=i686" rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf $NAME-$VERSION tar xzvf $CWD/$NAME-$VERSION.tar.gz cd $TMP/$NAME-$VERSION # Dirs needed hardcoded to Makefile and needed to clean up a bit of foul language in sources. patch -Np1 -i $CWD/monsterz-0.7.0_vl58.patch chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 2777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 2755 -exec chmod 755 {} \; find . -perm 774 -exec chmod 644 {} \; find . -perm 666 -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 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; make || exit 1 make DESTDIR=$PKG install mkdir -p $PKG/usr/share/doc/$NAME-$VERSION cp $CWD/$NAME.SlackBuild $PKG/usr/share/doc/$NAME-$VERSION/ cp AUTHORS COPYING INSTALL README TODO $PKG/usr/share/doc/$NAME-$VERSION/ mkdir -p $PKG/usr/share/applications cat > $PKG/usr/share/applications/$NAME.desktop << EOF [Desktop Entry] Encoding=UTF-8 Name=Monsterz GenericName=Monsterz Puzzle Game Comment=Puzzle game, similar to Bejeweled or Zookeeper Exec=monsterz Icon=monsterz.xpm Terminal=false Type=Application Categories=Application;Game;StrategyGame;X-Fedora; X-Desktop-File-Install-Version=0.10 EOF mkdir -p $PKG/usr/share/pixmaps cp $CWD/monsterz.xpm $PKG/usr/share/pixmaps/monsterz.xpm mkdir -p $PKG/install cat > $RELEASEDIR/slack-desc << EOF # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $SHIM|-----handy-ruler------------------------------------------------------| $NAME: Monsterz (Bejeweled or Zookeep knockoff) $NAME: $NAME: Monsterz is a little arcade puzzle game, similar to the famous $NAME: Bejeweled or Zookeeper. The goal of the game is to create rows of $NAME: similar monsters, either horizontally or vertically. The only allowed $NAME: move is the swap of two adjacent monsters, on the condition that it $NAME: creates a row of three or more. Has three gaming modes. $NAME: $NAME: License: WTFPL $NAME: Author: Sam Hocevar, $NAME: Website: http://sam.zoy.org/monsterz/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: N/A EOF cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc cd $PKG echo " " echo "Stripping...." echo " " 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 echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz" requiredbuilder -v -y -s $RELEASEDIR $PKG cat >> $PKG/install/slack-required << EOF sdl >= 1.2.11-i486-3 SDL_image >= 1.2.6-i586-2vl59 SDL_mixer >= 1.2.8-i586-2vl58 pygame >= 1.7.1release-i586-1vl59 EOF cat >> $RELEASEDIR/slack-required << EOF sdl >= 1.2.11-i486-3 SDL_image >= 1.2.6-i586-2vl59 SDL_mixer >= 1.2.8-i586-2vl59 pygame >= 1.7.1release-i586-1vl59 EOF makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz cd $CWD rm -rf $TMP echo "Done"