upgpkg: ufw 0.36.2-1
[ArchLinux/community.git] / dopewars / trunk / PKGBUILD
blob706b92adf082da7a2c2c730d0a941ed571b00096
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
2 # Contributor: schuay <jakob.gruber@gmail.com>
3 # Contributor: Alexander F. Rødseth <xyproto@archlinux.org>
4 # Contributor: Tom Newsom <Jeepster@gmx.co.uk>
5 # Contributor: Jeff Mickey <jeff@archlinux.org>
6 # Contributor: Thayer Williams <thayer@archlinux.org>
8 pkgname=dopewars
9 pkgver=1.6.2
10 pkgrel=2
11 pkgdesc='Turn based strategy game based on "Drug Wars" from 1984'
12 url='https://dopewars.sourceforge.io/'
13 license=('GPL')
14 arch=('x86_64')
15 backup=('srv/dopewars/dopewars.sco')
16 makedepends=(
17   'git'
18   'alsa-lib'
19   'audiofile'
20   'gendesk'
21   'gtk3'
22   'sdl2'
23   'sdl2_mixer'
25 optdepends=(
26   'sdl2: for the graphical interface'
27   'gtk3: for the graphical interface'
28   'alsa-lib: for audio'
29   'audiofile: for audio'
30   'sdl2_mixer: for audio'
32 _commit='86c3e8a841454440966693d571899fe4f738a4ae'
33 source=(
34   "git+https://github.com/benmwebb/dopewars#commit=$_commit"
35   'dopewars.service'
36   'dopewars.socket'
38 b2sums=('SKIP'
39         '094e4c569fb399ee8701855583db0acde19d13a1cec4c90e3ac21feee946c4f302563880d6be67433a57b30f9dc540b6d26d06121ecc88799c5c37d934a45ccd'
40         '438f7a315eb0af93051c2498b3d81823ce74a121c90a04e16f8d0c8f15d6aa4ddc569203100a38732a3c83a3b8a08c8880b7b9e4a2d23cdcac070e5567767d73')
42 pkgver() {
43   cd "$pkgname"
45   git describe --tags | sed 's/^v//'
48 prepare() {
49   gendesk -f -n \
50     --icon="$pkgname-pill" \
51     --pkgname "$pkgname" \
52     --pkgdesc "$pkgdesc"
55 build() {
56   cd "$pkgname"
58   autoreconf -vfi
60   ./configure \
61     --localstatedir=/srv/dopewars \
62     --mandir=/usr/share/man \
63     --prefix=/usr
65   make
68 package() {
69   make -C $pkgname \
70     DESKTOPDIR="$pkgdir/usr/share/applications" \
71     DESTDIR="$pkgdir" \
72     install
74   install -vDm644 -t "$pkgdir/usr/share/applications" dopewars.desktop
76   # systemd integration
77   install -vDm644 -t "$pkgdir/usr/lib/systemd/system" dopewars.{service,socket}
79   # Fix permissions
80   chmod 2755 "$pkgdir/usr/bin/dopewars"
81   chown root:games "$pkgdir/usr/bin/dopewars"
82   chown -R root:games "$pkgdir/srv/dopewars"
83   chmod 0775 "$pkgdir/srv/dopewars"
84   chmod 0664 "$pkgdir/srv/dopewars/dopewars.sco"