#!/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. NAME="scourge" VERSION=0.19 # ARCH=i586 "Obsolete now, with Uelsk8s code snippet" BUILD=2vl59 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 # Architechture and appropriate configure triplet: # Thanks to Uelsk8s for this useful code snippet. [ -z "$ARCH" ] && ARCH=$(uname -m) case "$ARCH" in (i?86) ARCH=i586 CFLAGS="-O2 -march=i586 -mtune=i686" CONFIGURE_TRIPLET=i486-slackware-linux ;; (x86_64) CFLAGS="-O2 -fPIC" CONFIGURE_TRIPLET=x86_64-pc-linux ;; esac # CFLAGS: export CFLAGS export CXXFLAGS=$CFLAGS rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf $NAME #tar xjvf $CWD/$NAME-$VERSION.tar.bz2 || exit 1 tar zxvf $CWD/$NAME-$VERSION.src.tar.gz || exit 1 # need data extracted nearby, to build engine correctly. Going to package anyway. tar zxvf $CWD/$NAME-$VERSION.data.tar.gz || exit 1 cd $TMP/$NAME autoreconf -i echo "Setting permissions..." 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 {} \; echo "Here we go!" ./configure \ --prefix=/usr \ --bindir=/usr/bin \ --with-data-dir=/usr/share/$NAME \ --mandir=/usr/man \ --with-included-gettext \ --localedir=/usr/share/locale \ --build=$CONFIGURE_TRIPLET || exit 1 make || exit 1 make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS README $PKG/usr/doc/$NAME-$VERSION cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild mkdir -p $PKG/usr/share/{applications,pixmaps} cp assets/$NAME.png $PKG/usr/share/pixmaps/$NAME.png cp assets/$NAME.desktop $PKG/usr/share/applications/$NAME.desktop mkdir -p $PKG/install # This creates the white space in front of "handy-ruler" in slack-desc below. LENGTH=`expr length "$NAME"` SPACES=0 SHIM="" until [ "$SPACES" = "$LENGTH" ]; do SHIM="$SHIM " let SPACES=$SPACES+1 done 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: $NAME (roguelike rpg game with a 3D user interface) $NAME: $NAME: S.c.o.u.r.g.e. is a rogue-like rpg with a 3D user interface. The game $NAME: allows a group of four characters to search for treasure, kill $NAME: enemies, gain levels, etc. The code is C++ using SDL, OpenGL and $NAME: freetype. Uses Squirrel for scripting. Scourge-data is a required $NAME: (about 77 MB) package also. $NAME: $NAME: License: GPL 2.0 $NAME: Author: Gabor Torok, Daroth-U, Toofan Hosseinnezhad $NAME: Website: http://scourge.sourceforge.net/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: `awk "/\.\/configure\ /" $TMP/$NAME/config.log` 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 "Finding dependancies..." requiredbuilder -v -y -s $RELEASEDIR $PKG cat >> $PKG/install/slack-required << EOF $NAME-data >= $VERSION-noarch-$BUILD EOF cat >> $RELEASEDIR/slack-required << EOF $NAME-data >= $VERSION-noarch-$BUILD EOF echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz" makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz echo "Creating Data package..." PKG2=$TMP/package-$NAME-data mkdir -p $PKG2/usr/share/$NAME mkdir -p $PKG2/install cp -R $TMP/${NAME}_data/* $PKG2/usr/share/$NAME/ # This creates the white space in front of "handy-ruler" in slack-desc below. LENGTH=`expr length "${NAME}-data"` SPACES=0 SHIM="" until [ "$SPACES" = "$LENGTH" ]; do SHIM="$SHIM " let SPACES=$SPACES+1 done cat > $RELEASEDIR/$NAME-data-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}-data: $NAME-data (data files for S.c.o.u.r.g.e. game) ${NAME}-data: ${NAME}-data: Images, maps, sound files etc. for the S.c.o.u.r.g.e. game. ${NAME}-data: ${NAME}-data: ${NAME}-data: ${NAME}-data: ${NAME}-data: ${NAME}-data: License: GPL 2.0 ${NAME}-data: Author: Gabor Torok, Daroth-U, Toofan Hosseinnezhad ${NAME}-data: Website: http://scourge.sourceforge.net/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: N/A EOF cp $RELEASEDIR/$NAME-data-slack-desc $PKG2/install/slack-desc cat > $PKG2/install/slack-required << EOF $NAME >= $VERSION-$ARCH-$BUILD EOF cd $PKG2 makepkg -l y -c n $RELEASEDIR/$NAME-data-$VERSION-noarch-$BUILD.tlz cd $CWD echo "Cleaning up temp files..." #rm -rf $TMP echo "Done"