summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cc25f1d74d5d8664d0e54418a4fb83bba2b71abf (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
# Maintainer: Aleksandr <contact at via dot aur>
# Contributor: Anthony Ruhier <anthony.ruhier@gmail.com>

pkgname=netbox-git
pkgver=v2.10.4.r28.b1cd634ab
pkgrel=2
pkgdesc="IP address management (IPAM) and data center infrastructure management (DCIM) tool."
arch=('any')
url="https://github.com/netbox-community/netbox.git"
license=('Apache-2.0')
depends=('python'
         'gunicorn'
         'libffi'
         'libpgf'
         'openssl'
         'python-coreapi'
         'python-pycryptodomex'
         'python-django'
         'python-django-cors-headers'
         'python-django-debug-toolbar'
         'python-django-filter'
         'python-django-mptt'
         'python-django-rest-framework'
         'python-django-rest-swagger'
         'python-django-tables2'
         'python-graphviz'
         'python-lxml'
         'python-markdown'
         'python-natsort'
         'python-ncclient'
         'python-netaddr'
         'python-openapi-codec'
         'python-paramiko'
         'python-pillow'
         'python-py-gfm'
         'python-pytz'
         'python-psycopg2'
         'python-simplejson'
         'python-xmltodict'
         'python-yaml')

provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=("${pkgname%-git}")
install="${pkgname%-git}.install"

source=("netbox::git+$url"
        "${pkgname%-git}.service"
        "${pkgname%-git}-rq.service"
        "${pkgname%-git}.tmpfile"
		    "${pkgname%-git}.sysuser"
	      'gunicorn_config.py')
backup=('etc/netbox/gunicorn.py' 'etc/netbox/configuration.py')

md5sums=('SKIP'
         '1e44aed0029d2e3e2995bcec253586ca'
         '90ea43c475c3d2b6f2e3990e8a3d9899'
         '38488c7c89e416f70e5694b67d1c735c'
         '16c9be659fa0449794edf98b37a54454'
         '054ce4db516adc2147f5180ea56e4653')

pkgver() {
	cd "$srcdir/${pkgname%-git}"
	
  printf "%s" "$(git describe --long --tags | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"

}

package() {
	cd "$srcdir/${pkgname%-git}"
	
	install -d -m775 "$pkgdir/etc/${pkgname%-git}"
	install -d "$pkgdir/opt/"${pkgname%-git}
	cp -r . "$pkgdir/opt/${pkgname%-git}"

	install -D -m644 ../${pkgname%-git}.service "$pkgdir/usr/lib/systemd/system/${pkgname%-git}.service"
	install -D -m644 ../${pkgname%-git}-rq.service "$pkgdir/usr/lib/systemd/system/${pkgname%-git}-rq.service"
	install -D -m644 ../${pkgname%-git}.tmpfile "$pkgdir/usr/lib/tmpfiles.d/${pkgname%-git}.conf"
	install -D -m644 ../${pkgname%-git}.sysuser "$pkgdir/usr/lib/sysusers.d/${pkgname%-git}.conf"

	install -d "$pkgdir/etc/${pkgname%-git}"
	install -D -m644 ../gunicorn_config.py "$pkgdir/etc/${pkgname%-git}/gunicorn.py"
	install -D -m644 ${pkgname%-git}/${pkgname%-git}/configuration.example.py "$pkgdir/etc/${pkgname%-git}/configuration.py"
	ln -s /etc/netbox/configuration.py "$pkgdir/opt/${pkgname%-git}/${pkgname%-git}/configuration.py"
}

# vim: set ts=2 sw=2 ft=sh noet: