BASH   78

build astromenace sh

Guest on 19th June 2022 05:25:48 AM

  1. #!/bin/bash
  2. # author           : John Coghill <liberion> (liberion@gmail.com)
  3. # source location  :
  4. # http://www.viewizard.com/astromenace/index_linux.php
  5. # last revised     : 01/10
  6. # additional files :
  7. #
  8. #this is a binary to package conversion
  9. #
  10. # what package is going to be built
  11. #
  12. softversion='11'
  13. softname='astromenace'
  14. arch='i686'
  15. packageversion='48.1'
  16. #
  17. # parameters needed for the build process
  18. #
  19. buildir=$(pwd)
  20. package="$softname-$softversion-$arch-$packageversion"
  21. #uncomment this if you dont have the binary package,and have DSL/Cable
  22. wget http://www.viewizard.com/download/amenace$softversion.tar.bz2
  23. # prepare the build result directory
  24. #
  25. dest="$buildir/$package"
  26. rm -rf $dest
  27. mkdir -p $dest/usr/bin
  28. mkdir -p $dest/install
  29. mkdir -p $dest/usr/share/applications
  30. mkdir -p $dest/usr/share/astromenace
  31. mkdir -p $dest/usr/doc/$softname-$softversion
  32. mkdir -p $dest/usr/src/$softname-$softversion
  33.  
  34. #
  35. # put slack-desc in place. Either a supplied one, or some default
  36. # text.
  37. #
  38. cat <<EOF > $dest/install/slack-desc
  39.    |-----handy-ruler------------------------------------------------------|
  40. $softname: $softname
  41. $softname: Astromenace is a modern 3D scrolling space shooter with ship
  42. $softname: upgrade possibilities.You can improve your ship,you must earn
  43. $softname: money by destroying throngs of enemies on every level.A
  44. $softname: friendly interface,easy controls,and fancy 3D graphics will
  45. $softname: bring you straight into the heart of galactic way.Enjoy!
  46. $softname:
  47. $softname:  Special thanks to the people at
  48. $softname:  http://www.viewizard.com for making this package possible
  49. $softname:
  50. $softname:
  51. EOF
  52. #
  53. # loop over expanded package source files
  54. #
  55. cd $buildir
  56. tar xjvf amenace$softversion.tar.bz2
  57. #
  58. # configure package for compilation
  59. #
  60.   cd $buildir
  61. cp -R astromenace/* $dest/usr/share/astromenace
  62. #
  63. # add 'default' files
  64. #
  65.     cd $buildir/astromenace
  66.     cp -a \
  67.       License.txt ReadMe.txt  ChangeLog.txt\
  68.       $dest/usr/doc/$softname-$softversion
  69. # build the desktop file
  70. #
  71. # put the ZenWalk build in the right directory
  72. cat << "EOF" > $dest/usr/share/applications/astromenace.desktop
  73. [Desktop Entry]
  74. Name=Astromenace
  75. Comment=A Space Shooter
  76. Exec=astromenace
  77. Icon=/usr/share/astromenace/astromenace_64.png
  78. Categories=Application;Game
  79. Terminal=false
  80. EOF
  81. cd $buildir
  82. cp $buildir/build-$softname.sh $dest/usr/src/$softname-$softversion
  83. #create a launcher
  84. cat << "X" > $dest/usr/bin/astromenace
  85. export LD_LIBRARY_PATH=/usr/share/astromenace
  86. astro=/usr/share/astromenace
  87. cd $astro
  88. exec /usr/share/astromenace/AstroMenace $@
  89. X
  90. chmod +x $dest/usr/bin/astromenace
  91. # set target permissions
  92. #
  93. chown -R root.root $dest
  94. chown -R root.bin $dest/$prefix/bin
  95.  
  96. cd $dest
  97. find . -perm 664 -exec chmod 644 {} \;
  98. find . -perm 600 -exec chmod 644 {} \;
  99. find . -perm 444 -exec chmod 644 {} \;
  100. find . -perm 400 -exec chmod 644 {} \;
  101. find . -perm 440 -exec chmod 644 {} \;
  102. find . -perm 777 -exec chmod 755 {} \;
  103. find . -perm 775 -exec chmod 755 {} \;
  104. find . -perm 511 -exec chmod 755 {} \;
  105. find . -perm 711 -exec chmod 755 {} \;
  106. find . -perm 555 -exec chmod 755 {} \;
  107. #
  108. # real packaging work:
  109. #
  110. cd $dest
  111. makepkg -l y -c n $dest.tgz
  112. #
  113. # computes the md5sum signature for the package
  114. #
  115. cd $buildir
  116. md5sum $package.tgz > $package.md5

Raw Paste


Login or Register to edit or fork this paste. It's free.