capricorn2001

eternallands PKGBUILD

Mar 4th, 2016
233
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Contributor: Adam Griffiths <adam_griffithsAATTdart.net.au>
  2. # Contributor: Todd Maynard <arch@toddmaynard.com>
  3. # Many thanks to AlexExtreme <alex@alex-smith.me.uk> (Frugalware pkg maintainer) from which much of this was borrowed.
  4. # Many thanks to Stefan for patch for x86_64 support and el.ini fix.
  5. # Contributor: Angelo Theodorou <encelo@users.sourceforge.net>
  6.  
  7. pkgname=eternallands
  8. pkgver=1.9.5.4
  9. pkgrel=1
  10. pkgdesc="A free 3D MMORPG game with thousands of on-line players"
  11. arch=('i686' 'x86_64')
  12. license=('custom')
  13. url="http://www.eternal-lands.com/"
  14. depends=('sdl_net' 'sdl_image' 'openal' 'cal3d' 'libxml2' 'libvorbis' 'glu')
  15. makedepends=('gzip' 'git')
  16. optdepends=('zenity: to use the launch script')
  17. options=('!emptydirs')
  18. changelog=eternallands.changelog
  19. source=('https://github.com/raduprv/Eternal-Lands/releases/download/1.9.5.4/el_195_p4_data_files.zip')
  20. md5sums=('468dca610695271f0356e91c6e2f9f08')
  21.  
  22. build()
  23. {
  24. # Local to the function to avoid version bumping
  25. _gitroot="git://github.com/raduprv/Eternal-Lands.git"
  26. _gitname="elc"
  27.  
  28. cd "$srcdir"
  29. msg "Connecting to GIT server...."
  30.  
  31. if [ -d $_gitname ] ; then
  32. cd $_gitname && git pull $_gitroot
  33. msg "The local files are updated."
  34. else
  35. git clone $_gitroot $_gitname
  36. fi
  37.  
  38. msg "GIT checkout done or server timeout"
  39. msg "Starting make..."
  40.  
  41. rm -rf "$srcdir/$_gitname-build"
  42. git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  43. cd "$srcdir/$_gitname-build"
  44. git checkout ${pkgver}
  45.  
  46. sed -i "s|/usr/games/|/usr/bin/|" pkgfiles/eternallands
  47. sed -i "s|/usr/share/games/EternalLands/|/usr/share/eternallands/|" pkgfiles/eternallands
  48. sed -i "s|#data_dir = /usr/share/games/EternalLands|#data_dir = /usr/share/eternallands|" pkgfiles/eternallands
  49. sed -i "s|#data_dir = \\\/usr\\\/share\\\/games\\\/EternalLands|#data_dir = \\\/usr\\\/share\\\/eternallands|" pkgfiles/eternallands
  50. rm -f gen_git_version
  51. make -f Makefile.linux release
  52. }
  53.  
  54. package() {
  55. cd "$srcdir"
  56.  
  57. mkdir -p "${pkgdir}/usr/bin"
  58. mkdir -p "${pkgdir}/usr/share/man/man6"
  59. mkdir -p "${pkgdir}/usr/share/pixmaps"
  60. mkdir -p "${pkgdir}/usr/share/applications"
  61. mkdir -p "${pkgdir}/usr/share/licenses/eternallands/"
  62. mkdir -p "${pkgdir}/usr/share/eternallands"
  63.  
  64. install -m755 elc-build/el.x86.linux.bin "${pkgdir}/usr/bin/"
  65. install -m755 elc-build/pkgfiles/eternallands "${pkgdir}/usr/bin/"
  66. install -m644 elc-build/pkgfiles/eternallands.6 "${pkgdir}/usr/share/man/man6"
  67. install -m644 elc-build/pkgfiles/el.x86.linux.bin.6 "${pkgdir}/usr/share/man/man6"
  68. install -m644 elc-build/pkgfiles/eternallands.png "${pkgdir}/usr/share/pixmaps/"
  69. install -m644 elc-build/pkgfiles/eternallands.xpm "${pkgdir}/usr/share/pixmaps/"
  70. install -m644 elc-build/pkgfiles/eternallands.desktop "${pkgdir}/usr/share/applications"
  71. install -m644 elc-build/eternal_lands_license.txt "${pkgdir}/usr/share/licenses/eternallands/"
  72.  
  73. unzip -d instarchive_uncompressed el_195_p4_data_files.zip
  74. cd instarchive_uncompressed/el_data
  75.  
  76. # Compress textures and maps
  77. find \( -name *.bmp -or -name *.elm \) -exec gzip -f {} \;
  78.  
  79. for dir in 2dobjects 3dobjects actor_defs animations languages maps meshes particles shaders skeletons skybox textures; do
  80. cp -R ${dir} "${pkgdir}/usr/share/eternallands/"
  81. done
  82.  
  83. sed -i "s|^#data_dir = \"c:\\\Program Files\\\Eternal Lands\\\\\"|#data_dir = /usr/share/eternallands|" el.ini
  84. sed -i "s|^#use_new_selection.*$|#use_new_selection = 1|g" el.ini
  85.  
  86. for file in *.ini *.txt *.lst *.xml; do
  87. install -m644 ${file} "${pkgdir}/usr/share/eternallands/"
  88. done
  89.  
  90. install -m644 ${srcdir}/elc-build/el.ini "${pkgdir}/usr/share/eternallands/"
  91. }
RAW Paste Data