updated on Tue Jan 17 08:05:08 UTC 2012
[aur-mirror.git] / sdlmess / PKGBUILD
blobb6bd460541f420f0590a465740680fba65c09ca5
1 # Contributor: robb_force <robb_force@holybuffalo.net>
2 # Maintainer: Anton Shestakov <engored*ya.ru>
4 pkgname=sdlmess
5 pkgver=0.144u6
6 pkgrel=1
8 _basever=0144
9 _patchlevel=6
11 pkgdesc='A port of the popular Multiple Emulator Super System using SDL.'
12 url='http://www.mess.org/'
13 license=('custom:MAME License')
14 arch=('i686' 'x86_64')
15 depends=('sdl>=1.2.11' 'sdl_ttf' 'libxinerama' 'gconf' 'zlib' 'expat' 'gtk2')
16 makedepends=('mesa')
17 [ "$CARCH" = 'i686' ] && makedepends=('mesa' 'nasm')
18 optdepends=('ttf-liberation: recommended UI font')
20 for i in `seq 1 ${_patchlevel}`; do
21   _patches="${_patches} mess${_basever}u${i}_diff.zip::http://mess.redump.net/_media/downloads:mess${_basever}u${i}_diff.zip"
22 done
24 source=("mess${_basever}s.zip::http://mess.redump.net/_media/downloads:mess${_basever}s.zip" 
25         sdlmess.sh ${_patches})
26 md5sums=('af4821f2575c7d8a241bc8e1243c3b20'
27          '141069e7019da5e33414dc8d4c421150'
28          '5dda3980fc97ded824c492f6ca7999bf'
29          'be8d654c794c6f7520cf342891b70652'
30          '6359e000db4c2b8af3d5f83e793edfdf'
31          '2a6270904717cc9491e98249bfeea4bc'
32          '130fcfe8fb3e72f88de11cef6cc75aff'
33          'd9f3d50f08177b24ff68004059cb334b')
34 install=sdlmess.install
36 build() {
37   cd "$srcdir"
38   
39   find . -type f -not -name '*.png' -exec perl -pi -e 's/\r\n?/\n/g' '{}' \;
41   for i in `seq 1 ${_patchlevel}`; do
42     msg2 "Applying patch: mess${_basever}u${i}.diff"
43     patch --silent -p0 -E < mess${_basever}u${i}.diff
44   done
46   # Adjusting make options according to target architecture
47   if [ "$CARCH" == 'x86_64' ]; then
48     echo 'Compiling for AMD64...'
49     make TARGET=mess AMD64=1 PTR64=1 SUFFIX64='' NOWERROR=1 BUILD_ZLIB=0 BUILD_EXPAT=0 ARCHOPTS="$CFLAGS"
50   elif [ "$CARCH" == 'i686' ]; then
51     echo 'Compiling for i686...'
52     make TARGET=mess I686=1 NOWERROR=1 BUILD_ZLIB=0 BUILD_EXPAT=0 ARCHOPTS="$CFLAGS"
53   else
54     echo 'Compiling for i386...'
55     make TARGET=mess PM=1 NOWERROR=1 BUILD_ZLIB=0 BUILD_EXPAT=0 ARCHOPTS="$CFLAGS"
56   fi
59 package() {
60   cd "$srcdir"
61     
62   # Installing the wrapper script
63   install -Dm755 "$srcdir/sdlmess.sh" "$pkgdir/usr/bin/sdlmess"
65   # Installing binaries
66   install -Dm755 mess "$pkgdir/usr/share/sdlmess/sdlmess"
68   # Installing extra bits
69   install -d "$pkgdir/usr/share/sdlmess/artwork"
70   install -m644 artwork/* "$pkgdir/usr/share/sdlmess/artwork/"
71   install -d "$pkgdir/usr/share/sdlmess/hash"
72   install -m644 hash/* "$pkgdir/usr/share/sdlmess/hash/"
74   # The license
75   install -Dm644 docs/license.txt "$pkgdir/usr/share/licenses/custom/sdlmess/license.txt"