summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e6e4fce270e724fcfbf2905ba19eb335236a9d41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
# Contributor: grimi <grimi at poczta dot fm>

pkgname=xrick
pkgver=021212
pkgrel=11
pkgdesc='Clone of Rick Dangerous, a classic platform game'
arch=('i686' 'x86_64')
url='http://www.bigorno.net/xrick'
license=('custom: spirit of GPL')
depends=('sdl' 'zlib')
makedepends=('imagemagick')
source=("http://www.bigorno.net/xrick/$pkgname-$pkgver.zip"
        "$pkgname.desktop"
        "$pkgname-fs.desktop")
sha256sums=('2a167169ccdb2c108e97d5d021da9be29356d756283f1c20d5a7ad121b4accf0'
            '3dda77a8017e35767c8339fb92ce0a554912c98af33fb75e986ca1d30d40c320'
            '5d8c57aeb0b4e445576f86aaa8b851315c4c31d03544f7ad4b95c9507551a625')

prepare() {
  cd $pkgname-$pkgver

  # change data path
  sed 's|"data.zip"|"/usr/share/xrick/data.zip"|' -i src/xrick.c
  # add our build flags and gcc10+ fix
  sed "s|CFLAGS=|CFLAGS+=-fcommon |;s|LDFLAGS=|LDFLAGS+=|" -i Makefile
  # fix format-security
  sed 's|printf(s)|printf("%s\\n", s)|' -i src/system.c

  # create icon
  convert src/xrickST.ico xrick.png

  # change data path in manual page
  gunzip xrick.6.gz
  sed 's|where xrick is|/usr/share/xrick.|;s|run from.||' -i xrick.6
  gzip xrick.6
}

build() {
  cd $pkgname-$pkgver

  make
}

package() {
  cd $pkgname-$pkgver

  # binary
  install -Dm755 xrick "$pkgdir"/usr/bin/xrick
  # data
  install -d "$pkgdir"/usr/share/xrick
  install -m644 {data.zip,KeyCodes} "$pkgdir"/usr/share/xrick/
  # doc + license
  install -Dm644 xrick.6.gz "$pkgdir"/usr/share/man/man6/xrick.6.gz
  install -Dm644 README "$pkgdir"/usr/share/doc/$pkgname/README
  install -Dm644 README "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
  sed '5,27!d' -i "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
  # .desktop files
  install -Dm644 ../xrick.desktop "$pkgdir"/usr/share/applications/xrick.desktop
  install -m644 ../xrick-fs.desktop "$pkgdir"/usr/share/applications
  install -Dm644 xrick.png "$pkgdir"/usr/share/pixmaps/xrick.png
}