updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / starwars-chess / PKGBUILD
blob4208fc4022a1ed718392f76fd5ca7cd7b537e773
1 # Contributor: Jens Staal <staal1978@gmail.com>
3 pkgname="starwars-chess"
4 pkgver="1.0"
5 pkgrel=2
6 pkgdesc="A classic board game from Abandonia, played in DosBox."
7 url='http://www.abandonia.com/en/games/5205/Star+Wars+Chess.html'
8 arch=('any')
9 license=('custom-freeware' 'Abandonware')
10 install='sw-chess.install'
11 depends=('dosbox')
12 optdepends=('abandonia-menu')
13 source=('http://files.abandonia.com/download.php?game=Star+Wars+Chess&secure=125b31951f5eeee46906b9561cf1ece6&td=1298144186' 'sw-chess.png')
14 md5sums=('27ebd9fbbbd22b7c0f1b6117f2464a58' 'b890bf1804f3dee268158e04c4e1a841')
15 _pkgabbrev="sw-chess"
16 _exe="SWC.EXE"
17 _icon="sw-chess.png"
19 build() {
20         mkdir -p -m755 "$pkgdir/opt/" 
21         mkdir -p -m755 "$pkgdir/opt/abandonia" 
22         mkdir -p -m755 "$pkgdir/opt/abandonia/$_pkgabbrev" 
23         rm -f $srcdir/download* 
24         cp -ar $srcdir/SWCHESS/* "$pkgdir/opt/abandonia/$_pkgabbrev" 
26         #ok, let's use a script to start the game
28         mkdir -p -m755 /$pkgdir/usr/bin/ 
29         printf "#!${SHELL}
31 mkdir -p ~/.abandonia/$_pkgabbrev
33 if whereis dosbox>/dev/null 2>&1;
34         then
35                 dosbox /opt/abandonia/$_pkgabbrev/$_exe mount c ~/.abandonia/$_pkgabbrev
36         else
37                 echo '==> Please get sure to have dosbox installed and have it in your PATH array.'
39 return \$?" >> /$pkgdir/usr/bin/$_pkgabbrev.sh 
40         chmod +x /$pkgdir/usr/bin/$_pkgabbrev.sh 
41         ln -s $_pkgabbrev.sh /$pkgdir/usr/bin/$_pkgabbrev 
43         # Automatic generation of a .desktop file
45         mkdir -p -m644 "$pkgdir/usr/share/" 
46         mkdir -p -m644 "$pkgdir/usr/share/applications/" 
48         printf "[Desktop Entry]
49 Version=$pkgver
50 Type=Application
51 Name=$pkgname
52 Comment=$pkgdesc
53 Exec=/usr/bin/$_pkgabbrev
54 Icon=/opt/abandonia/$_pkgabbrev/$_icon
55 Categories=Game;Abandonia;
56 Terminal=false
57 StartupNotify=false" >> /$pkgdir/usr/share/applications/$_pkgabbrev.desktop
59