- #!/bin/bash
- # author : John Coghill <liberion> (liberion@gmail.com)
- # source location :
- # http://www.viewizard.com/astromenace/index_linux.php
- # last revised : 01/10
- # additional files :
- #
- #this is a binary to package conversion
- #
- # what package is going to be built
- #
- softversion='11'
- softname='astromenace'
- arch='i686'
- packageversion='48.1'
- #
- # parameters needed for the build process
- #
- buildir=$(pwd)
- package="$softname-$softversion-$arch-$packageversion"
- #uncomment this if you dont have the binary package,and have DSL/Cable
- wget http://www.viewizard.com/download/amenace$softversion.tar.bz2
- # prepare the build result directory
- #
- dest="$buildir/$package"
- rm -rf $dest
- mkdir -p $dest/usr/bin
- mkdir -p $dest/install
- mkdir -p $dest/usr/share/applications
- mkdir -p $dest/usr/share/astromenace
- mkdir -p $dest/usr/doc/$softname-$softversion
- mkdir -p $dest/usr/src/$softname-$softversion
- #
- # put slack-desc in place. Either a supplied one, or some default
- # text.
- #
- cat <<EOF > $dest/install/slack-desc
- |-----handy-ruler------------------------------------------------------|
- $softname: $softname
- $softname: Astromenace is a modern 3D scrolling space shooter with ship
- $softname: upgrade possibilities.You can improve your ship,you must earn
- $softname: money by destroying throngs of enemies on every level.A
- $softname: friendly interface,easy controls,and fancy 3D graphics will
- $softname: bring you straight into the heart of galactic way.Enjoy!
- $softname:
- $softname: Special thanks to the people at
- $softname: http://www.viewizard.com for making this package possible
- $softname:
- $softname:
- EOF
- #
- # loop over expanded package source files
- #
- cd $buildir
- tar xjvf amenace$softversion.tar.bz2
- #
- # configure package for compilation
- #
- cd $buildir
- cp -R astromenace/* $dest/usr/share/astromenace
- #
- # add 'default' files
- #
- cd $buildir/astromenace
- cp -a \
- License.txt ReadMe.txt ChangeLog.txt\
- $dest/usr/doc/$softname-$softversion
- # build the desktop file
- #
- # put the ZenWalk build in the right directory
- cat << "EOF" > $dest/usr/share/applications/astromenace.desktop
- [Desktop Entry]
- Name=Astromenace
- Comment=A Space Shooter
- Exec=astromenace
- Icon=/usr/share/astromenace/astromenace_64.png
- Categories=Application;Game
- Terminal=false
- EOF
- cd $buildir
- cp $buildir/build-$softname.sh $dest/usr/src/$softname-$softversion
- #create a launcher
- cat << "X" > $dest/usr/bin/astromenace
- export LD_LIBRARY_PATH=/usr/share/astromenace
- astro=/usr/share/astromenace
- cd $astro
- exec /usr/share/astromenace/AstroMenace $@
- X
- chmod +x $dest/usr/bin/astromenace
- # set target permissions
- #
- chown -R root.root $dest
- chown -R root.bin $dest/$prefix/bin
- cd $dest
- 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 {} \;
- #
- # 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