summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 659e793fb5a154591d208117c09a8fb31478c139 (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
# Maintainer: Steven De Bondt <egnappah at gmail dot com>

pkgname=graphite-web
pkgver=1.1.10
pkgrel=1
pkgdesc="a Django-based web application that renders graphs and dashboards"
url="https://github.com/graphite-project/graphite-web/"
license=('Apache')
depends=('python-pytz' 'python-six' 'python-flask' 'python-structlog'
         'python-yaml' 'python-tzlocal' 'python-cairocffi' 'python-pyparsing'
         'python-django')
makedepends=('python-setuptools')
optdepends=('python-flask-cache: For caching'
            'python-raven: For sentry support')
arch=('any')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/graphite-project/${pkgname}/archive/${pkgver}.tar.gz"
        "graphite-web.service")
sha256sums=('SKIP'
            '5e2d2a0b026e07d1f50baeef4526ba7f44bb300a3e89d2c1fd18300d5a952694')

build() {
        cd "$srcdir/$pkgname-$pkgver"
        python setup.py build

	#Dirty Fixing old django references
	sed -i 's/url\b/re_path/g' webapp/graphite/urls.py
	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/render/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/render/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/composer/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/composer/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/metrics/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/metrics/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/browser/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/browser/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/account/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/account/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/dashboard/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/dashboard/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/whitelist/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/whitelist/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/version/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/version/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/events/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/events/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/tags/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/tags/urls.py

	sed -i 's/django.conf.urls/django.urls/g' webapp/graphite/functions/urls.py
	sed -i 's/url\b/re_path/g' webapp/graphite/functions/urls.py
}

package() {
        cd "$srcdir/$pkgname-$pkgver"
        python setup.py install --root="${pkgdir}/" --optimize=1
        mkdir -p "$pkgdir/var/lib/graphite"
        install -Dm0644 "$srcdir/graphite-web.service" "$pkgdir/usr/lib/systemd/system/graphite-web.service"
}