#!/bin/bash # author : BlunT # # source location : http://mesh.dl.sourceforge.net/sourceforge/pokerth/$NAME-$VERSION-linux.bin # # last revised : 12/02/2007 # # # what package is going to be built # softname='pokerth' softversion='0.3' packageversion='44.1' # # ZenWalk standard: CPU type and architecture, as well as the # version number of ZenWalk this package is made for (on?). # arch='i686' # # the package 'destination' # prefix=/usr # # parameters needed for the build process # buildir=$(pwd) srcpkg="$buildir/${softname}-${softversion}-linux.bin" src="$buildir/$" package="$softname-$softversion-$arch-$packageversion" dest="$buildir/$package" # # prepare the build result directory # dest="$buildir/$package" rm -rf $dest rm -fr $src mkdir -p $dest mkdir -p $dest/install mkdir -p $dest/$prefix/bin mkdir -p $dest/usr/share/applications mkdir -p $dest/usr/lib/$softname mkdir -p $dest/$prefix/src/$softname-$softversion # # put slack-desc in place. Either a supplied one, or some default # text. # cat < $dest/install/slack-desc |-----handy-ruler------------------------------------------------------| pokerth: PokerTH (Single-player Poker game) pokerth: pokerth: PokerTH is a single-player poker game written in C++/QT4. You can pokerth: play the popular "Texas Hold'em" poker variant against up to four pokerth: computer-opponents. This poker engine is open-source and available pokerth: for Linux and Windows. pokerth: pokerth: pokerth: pokerth: pokerth: EOF # # The others files # cd $buildir cp $softname-$softversion-linux.bin $dest/usr/lib/$softname/ # # Put the .desktop file # cat << EOF > $package/usr/share/applications/$softname.desktop [Desktop Entry] Type=Application Encoding=UTF-8 Name=PokerTH Name[fr]=PokerTH GenericName=Poker Game GenericName[fr]=Jeux de Poker Comment=Single-Player Poker Game Icon=xfce-games.svg TryExec=pokerth Exec=pokerth Terminal=false Categories=Game;CardGame; EOF # # Make the pokerth executable # cat < $dest/usr/bin/pokerth #!/bin/sh cd /usr/lib/pokerth/ exec ./pokerth-0.3-linux.bin EOF chmod 755 $dest/usr/bin/pokerth # # Strip Executables # (Comment out these lines if debugging info is needed) # ( cd $dest 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 ) # # put the ZenWalk build in the right directory # cd $buildir cp build.pokerth.sh $dest/$prefix/src/$softname-$softversion # # set target permissions # chown -R root:root $dest cd $dest find . -exec chmod a+r {} \; find . -name "*.bin" -exec chmod 755 {} \; # # real packaging work: # cd $dest makepkg -l y -c n $dest.tgz # # computes the md5sum signature for the package # cd $buildir md5sum $package.tgz > $package.md5 # #computes the .dep file for the package # requiredbuilder -z $package.tgz > $package.dep