#!/bin/bash # # author : George Vlahavas (vlahavas~AT~gmail~DOT~com) # project web page : http://www.adom.de/adom/roguelike.php3 # source : http://www.adom.de/adom/download/linux/adom-111-elf.tar.gz # # This game is postcardware # Package name NAME="adom" # Package version VERSION="1.1.1" # Files that should be placed in /usr/doc/package-version/ DOCS="adomfaq.txt manual.doc readme.1st" CWD=`pwd` PKG="$CWD/$NAME-install" ARCH="i486" CPU="i686" BUILD="1gv" rm -rf $PKG mkdir -p $PKG # Create package install directory mkdir $PKG/install # Create the slack-desc file cat > $PKG/install/slack-desc << END $NAME: adom (a roguelike game) $NAME: $NAME: Ancient Domains of Mystery (ADOM for short) is a roguelike game $NAME: which means that it is a single-user game featuring the exploration $NAME: of a dungeon complex (and in the case of ADOM and a few other games $NAME: of this genre: the exploration of a large wilderness area with $NAME: villages and many special locations). You control a fictional $NAME: character described by race, class, attributes, skills, and $NAME: equipment. Your character is trying to achieve a specific goal $NAME: and succeed in a difficult quest. $NAME: This game is postcardware. END rm -rf $NAME # Unpack source tar xf $NAME-`echo $VERSION | sed "s/\.//g"`-elf.tar.gz # Create the desktop entry mkdir -p $PKG/usr/share/applications cat > $PKG/usr/share/applications/$NAME.desktop < /dev/null # Copy icon to the right place mkdir -p $PKG/usr/share/icons/hicolor/48x48/apps cp -a $CWD/$NAME.png $PKG/usr/share/icons/hicolor/48x48/apps # Copy Docs mkdir -p $PKG/usr/doc/$NAME-$VERSION cd $CWD/$NAME cp -a $DOCS $PKG/usr/doc/$NAME-$VERSION # Make sure ownerships and permissions are sane cd $PKG chown -R root:root . 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 {} \; # Make the package /sbin/makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.txz # Calculate md5sum cd $CWD/ md5sum $NAME-$VERSION-$ARCH-$BUILD.tgz > $NAME-$VERSION-$ARCH-$BUILD.md5 # Remove source-code and temporary install directories # since they are not needed anymore rm -rf $CWD/$NAME rm -rf $PKG