summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7734867312de5deaf283c1e25a6b8c282db91002 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Contributor: Calimero <calimeroteknik@free.fr>
# Contributor: jerry73204 <jerry73204@gmail.com>
# Maintainer: David Hummel <david dot hummel at gmail point com>

pkgname=('mod_tile-git' 'renderd-git')
pkgver=0.6.1.r49.g672969f
pkgrel=1
pkgdesc='Mod tile is a daemon and apache module for rendering and serving Mapnik raster tiles'
arch=('i686' 'x86_64')
url='https://github.com/openstreetmap/mod_tile'
license=('GPL2')
optdepends=('ceph-libs: RADOS tile storage support'
            'libmemcached: Memcached tile storage support')
makedepends=('apache' 'apr' 'cairo' 'cmake' 'git' 'glib2' 'iniparser' 'mapnik')
source=('git+https://github.com/openstreetmap/mod_tile.git'
        'mod_tile-use_ctest_rather_than_dart.patch::https://github.com/openstreetmap/mod_tile/pull/329.patch'
        'mod_tile-ctest_custom_test_ports.patch::https://github.com/openstreetmap/mod_tile/pull/331.patch'
        'renderd.service'
        'renderd-postgresql.service'
        'renderd.sysusers'
        'renderd.tmpfiles')
sha256sums=('SKIP'
            '0e4e96161c07283af6df1dd16ba15f89361ac40881a7d68e1d5fe7feda6d1f0f'
            'e86717b6819b069d6d7dfeff87ee33bef4a38b17ea17f4944fcbb8b2da5db4c4'
            '7bb1c67f92e9d253cecbb2f17048fba151a67e470c231fc33605937917b0567a'
            'd6c009e95380d8a9be41f0bd077638cb6adbebb74fff238a2bfc9fbbb3ed49fa'
            'cd6871cdb3e640912c95499e97fe1a2496ba95f102ec65f112bcd546ba736514'
            'cc450b47539d8a3e0d3d78634c78b0019a15097d2fb4e86fa3332957abd82d89')

pkgver() {
  cd mod_tile || exit
  git describe --long --tags | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
  cd mod_tile || exit
  patch -Np1 < ../mod_tile-use_ctest_rather_than_dart.patch
  patch -Np1 < ../mod_tile-ctest_custom_test_ports.patch
}

build() {
  cmake -B mod_tile_build -S mod_tile -DCMAKE_BUILD_TYPE:STRING=Release -DENABLE_TESTS:BOOL=ON
  cmake --build mod_tile_build
}

check() {
  ctest --output-on-failure --test-dir mod_tile_build
}

package_mod_tile-git() {
  depends=('apache' 'apr' 'cairo' 'curl' 'glib2')
  install="${pkgname}.install"
  pkgdesc='An Apache 2 module to deliver map tiles'
  provides=('mod_tile')

  DESTDIR="$pkgdir" cmake --install mod_tile_build --prefix /usr --strip

  # License
  install -Dm644 "$srcdir"/mod_tile/COPYING "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE

  # Example Map
  install -Dm644 "$srcdir"/mod_tile/etc/apache2/renderd-example-map.conf "$pkgdir"/etc/httpd/conf/extra/httpd-tile-renderd-example-map.conf
  install -dm755 "$pkgdir"/usr/share/renderd
  cp -av "$srcdir"/mod_tile/utils/example-map "$pkgdir"/usr/share/renderd/example-map

  # "/etc/renderd.conf", "/usr/bin", "/usr/share/man" & "/var" are contained in/handled by "renderd" package
  rm -rf "$pkgdir"/etc/renderd.conf "$pkgdir"/usr/bin "$pkgdir"/usr/share/man "$pkgdir"/var
}

package_renderd-git() {
  backup=('etc/renderd.conf')
  depends=('cairo' 'curl' 'glib2' 'iniparser' 'mapnik')
  pkgdesc='A daemon that renders map tiles using mapnik'
  provides=('renderd')

  DESTDIR="$pkgdir" cmake --install mod_tile_build --prefix /usr --strip

  # Systemd service units, sysusers.d & tmpfiles.d configuration files
  install -Dm644 -t "$pkgdir"/usr/lib/systemd/system/ "$srcdir"/renderd-postgresql.service "$srcdir"/renderd.service
  install -Dm644 "$srcdir"/renderd.sysusers "$pkgdir"/usr/lib/sysusers.d/renderd.conf
  install -Dm644 "$srcdir"/renderd.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/renderd.conf

  # License
  install -Dm644 "$srcdir"/mod_tile/COPYING "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE

  # The creation of "/var/cache/renderd/tiles" & "/var/run/renderd" will be handled by "renderd.tmpfiles"
  rm -rf "$pkgdir"/var

  # "/etc/httpd" & "/usr/lib/httpd" are contained in "mod_tile" package
  rm -rf "$pkgdir"/etc/httpd "$pkgdir"/usr/lib/httpd
}