summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 89bcd8c90000184af19f89d6f3d8974faae6bfce (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
# Maintainer: jerry73204 <jerry73204 at gmail dot com>
pkgname=tilecache
pkgver=2.11
pkgrel=3
pkgdesc='TileCache is an implementation of a WMS-C compliant server made available under the BSD license by MetaCarta.'
arch=('x86_64')
url='http://tilecache.org/'
license=('BSD')
depends=('python2')
optdepends=(
  'memcached'
  'mapserver'
  'python2-pillow'
  'python2-boto'
  'python2-flup'
  'python2-mapnik'
  'python2-memcached'
  'python2-wsgiref'
  'python2-paste'
)
makedepends=(
  'python-sphinx'
)
backup=('etc/tilecache.cfg')
source=("http://tilecache.org/${pkgname}-${pkgver}.tar.gz"
        'apache.example.conf')
sha256sums=('b46dc2731a19b40e3207cf3c9b43ea59b899a622a586aaa3c397c3b5aa00f887'
            '06583b0fdbee9a057d8e8aeb3591a4cd1d5dbe230c71f4f0f0588042dc0dce57')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  sed -i 's_#!/usr/bin/python_#!/usr/bin/env python2_g' \
      ez_setup.py \
      setup.py \
      tilecache_clean.py \
      tilecache_http_server.py \
      tilecache_install_config.py \
      tilecache_seed.py \
      tilecache.cgi \
      tilecache.fcgi
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # compile Python scripts
  python2 setup.py build

  # build docs
  cd docs
  make html
}

package() {
  # install Python scripts
  cd "${srcdir}/${pkgname}-${pkgver}"
  python2 setup.py install --root="${pkgdir}" --optimize=1

  install -dm0755 "${pkgdir}/etc"
  install -m0644 tilecache.cfg "${pkgdir}/etc/tilecache.cfg"
  rm -v "${pkgdir}/usr/dev.ini"  # remove unused dev.ini

  # install docs
  cd "${srcdir}/${pkgname}-${pkgver}/docs/_build"
  local DOCS_DIR="${pkgdir}/usr/share/doc/tilecache"
  install -dm0755 "$DOCS_DIR"
  cp -rv html "$DOCS_DIR/html"

  # install example apache config
  cd "${srcdir}"
  local CONFIG_DIR="${pkgdir}/etc/webapps/tilecache"
  install -dm0755 "$CONFIG_DIR"
  install -m0644 apache.example.conf "$CONFIG_DIR/apache.example.conf"

  # build CGI directory
  local CGI_DIR="${pkgdir}/usr/share/tilecache/sbin"
  install -dm0755 "$CGI_DIR"
  mv -v "${pkgdir}/usr/bin/tilecache.cgi" "${CGI_DIR}/tilecache.cgi"
  mv -v "${pkgdir}/usr/bin/tilecache.fcgi" "${CGI_DIR}/tilecache.fcgi"
}

# vim:set ts=2 sw=2 et: