#!/bin/sh # 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. # Nothing compiled here. The INSTALL.sh in the sources is useless to a packager so we're going # to round up all the files and package them. Also the INSTALL.sh creates a directory tree that # makes absolutely no sense. We're gonna fix that. SHIM="# " # Add enough spaces between quotes to match quotes around name on next line NAME="childsplay" VERSION=0.85.1 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.tgz cd $TMP/$NAME-$VERSION 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 {} \; # we don't use the buggy provided install rm install.py # the translation is merged into the assetml file, so don't ship it seperatly rm -r assetml/childsplay/memory-136x136/po # fixup the python scripts to call python directly and make them executable sed -i 's!/usr/bin/env python!/usr/bin/python!' childsplay.py letters-trans.py chmod 755 childsplay.py letters-trans.py pyassetmlcreator.py # move these out of Data so our wildcard install doesn't install them mv Data/*.txt Data/logo_cp_*.png Data/childsplay.* . cat > BASEPATH.py << EOF ## Automated file please do not edit CPDIR="/usr/share/childsplay" SHAREDATADIR="/usr/share/childsplay/Data" SHARELIBDATADIR="/usr/share/childsplay/plugins" LIBDIR="/usr/share/childsplay/plugins" MODULESDIR="/usr/share/childsplay/plugins" RCDIR="/usr/share/childsplay/plugins/ConfigData" LOCALEDIR="/usr/share/locale" ASSETMLDIR="/usr/share" CHILDSPLAYRC="childsplayrc" HOME_DIR_NAME=".childsplay" SCOREDIR="/var/games" SCOREFILE="/var/games/childsplay.score" DOCDIR="/usr/share/doc/childsplay-0.85.1" MANDIR="/usr/man/man6" EOF mkdir -p $PKG/usr/bin mkdir -p $PKG/usr/share/childsplay/plugins mkdir -p $PKG/usr/share/locale mkdir -p $PKG/usr/man/man6 mkdir -p $PKG/var/games mkdir -p $PKG/usr/share/pixmaps mkdir -p $PKG/usr/share/applications mkdir -p $PKG/usr/share/doc/$NAME-$VERSION mkdir -p $PKG/install cp -a *.py $PKG/usr/share/childsplay ln -s ../share/childsplay/childsplay.py $PKG/usr/bin/childsplay ln -s ../share/childsplay/letters-trans.py $PKG/usr/bin/letters-trans cp -a Data $PKG/usr/share/childsplay cp -a lib/* $PKG/usr/share/childsplay/plugins cp -a assetml/childsplay/* $PKG/usr/share/childsplay cp -a locale/* $PKG/usr/share/locale cp -a man/* $PKG/usr/man/man6 cat > $PKG/usr/share/applications/childsplay.desktop << EOF [Desktop Entry] Encoding=UTF-8 Name=Childsplay GenericName=Educational games for young children Comment=Educational and at the same time be fun to play Exec=childsplay Icon=childsplay.png Terminal=false StartupNotify=false Type=Application Categories=Application;Game; EOF install -p -m 644 logo_cp_48x48.png $PKG/usr/share/pixmaps/childsplay.png cp README* doc/GPL* doc/README* License_*.ttf.txt $PKG/usr/share/doc/childsplay-0.85.1 cp $CWD/$NAME.SlackBuild $PKG/usr/share/doc/$NAME-$VERSION/ 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: Childsplay (Suite of educational games for young children) $NAME: $NAME: Childsplay is written in Python and uses the SDL-libraries. The aim $NAME: is to be educational and at the same time be fun to play. Two core $NAME: games are included. Childsplay-plugins may be installed to add more $NAME: games. $NAME: $NAME: $NAME: License: GPL $NAME: Author: Stas Z $NAME: Website: http://childsplay.sourceforge.net/ #---------------------------------------- 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 # No need to run requiredbuilder here as it won't be able to pick up the deps. # So we create the slack-required files manually cat > $PKG/install/slack-required << EOF python >= 2.5.1-i486-1 sdl >= 1.2.11-i586-3 SDL_image >= 1.2.6-i586-1vl59 SDL_mixer >= 1.2.8-i586-1vl59 SDL_ttf >= 2.0.9-i586-1vl59 pygame >= 1.7.1release-i586-1vl59 libogg >= 1.1.3-486-2 EOF cat $PKG/install/slack-required > $RELEASEDIR/slack-required echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz" makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz cd $CWD rm -rf $TMP echo "Done"