aboutsummaryrefslogtreecommitdiffstats
path: root/testing/netbox/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/netbox/APKBUILD')
-rw-r--r--testing/netbox/APKBUILD77
1 files changed, 77 insertions, 0 deletions
diff --git a/testing/netbox/APKBUILD b/testing/netbox/APKBUILD
new file mode 100644
index 0000000000..6a9a139706
--- /dev/null
+++ b/testing/netbox/APKBUILD
@@ -0,0 +1,77 @@
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer:
+pkgname=netbox
+pkgver=2.2.8
+pkgrel=0
+pkgdesc="IP address management and data center infrastructure management tool"
+url="https://netbox.io"
+arch="noarch"
+license="Apache-2.0"
+depends="py3-django py3-django-cors-headers py3-django-debug-toolbar
+ py3-django-filter py3-django-mptt py3-django-rest-swagger py3-django-tables2
+ py3-django-rest-framework py3-napalm py3-graphviz py3-markdown py3-natsort
+ py3-ncclient py3-netaddr py3-paramiko py3-pillow py3-psycopg2 py3-pygfm
+ py3-pycryptodome py3-xmltodict py3-gunicorn"
+install="$pkgname.pre-install $pkgname.post-upgrade"
+subpackages="$pkgname-doc"
+options="!check" # no testsuite
+pkgusers="netbox"
+pkggroups="netbox"
+source="$pkgname-$pkgver.tar.gz::https://github.com/digitalocean/netbox/archive/v$pkgver.tar.gz
+ gunicorn_config.py
+ netbox.nginx-sample
+ $pkgname.initd
+ $pkgname.logrotated
+ set-config-defaults.patch
+ "
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ return 0
+}
+
+package() {
+ cd "$builddir"
+ local destdir=usr/share/webapps
+ local conffile=etc/$pkgname/configuration.py
+ mkdir -p "$pkgdir"/$destdir \
+ "$pkgdir"/usr/share/doc \
+ "$pkgdir"/etc/$pkgname
+ mv $pkgname "$pkgdir"/$destdir
+ mkdir -p "$pkgdir"/$destdir/$pkgname/static
+ mv docs "$pkgdir"/usr/share/doc/$pkgname
+ mv "$pkgdir"/$destdir/$pkgname/$pkgname/configuration.example.py \
+ "$pkgdir"/$conffile
+
+ # in order to install the static files we need a working config file
+ # and temporarily set minimum settings in config file
+ ln -s "$pkgdir"/$conffile \
+ "$pkgdir"/$destdir/$pkgname/$pkgname/configuration.py
+ sed -i "s/SECRET_KEY.*/SECRET_KEY = \'abcdefghk123456789\'/" \
+ "$pkgdir"/$conffile
+
+ # install static files
+ python3 "$pkgdir"/$destdir/$pkgname/manage.py collectstatic --noinput --clear --link
+ # let's move instead of linking static files originating from netbox
+ local dir; for dir in "$pkgdir"/$destdir/$pkgname/project-static/*; do
+ rm -rf "$pkgdir"/$destdir/$pkgname/static/$(basename $dir)
+ mv $dir "$pkgdir"/$destdir/$pkgname/static
+ done
+
+ install -m644 "$srcdir"/gunicorn_config.py "$pkgdir"/$destdir/$pkgname
+ install -D -m644 "$srcdir"/netbox.nginx-sample "$pkgdir"/etc/nginx/netbox.sample
+ install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ install -D -m644 "$srcdir"/$pkgname.logrotated "$pkgdir"/etc/logrotate.d/$pkgname
+ install -d -m755 -o netbox -g netbox "$pkgdir"/var/lib/$pkgname/media
+
+ # undo temp stuff
+ ln -sf /$conffile "$pkgdir"/$destdir/$pkgname/$pkgname/configuration.py
+ sed -i "s/SECRET_KEY.*/SECRET_KEY = \'\'/" "$pkgdir"/$conffile
+}
+
+sha512sums="3e5014ff240404e33ac50a700f3c31dc86ff3693c1f26caa681db7b5d14e8d7237f6b2d918c519e47818efc2384ef279196943f86c256a9a8bf7aa7f8084d1a2 netbox-2.2.8.tar.gz
+09d8e40d98d113458ee602de85306ac1a24fbb0015fbc4bb77812dae05096cb7b9c50770f650fd2ac78a388f35d7752ce8021790e952234a39c8b3e73a4ea3db gunicorn_config.py
+b5c3dc0ad2ebaacf43dfa41880dc7d677a763a3fadf1ccd0a6a9ec744d1648ca72f6a55893d09fd843b399559e2411a98b0ded597669f18a34f305f5ccb57c06 netbox.nginx-sample
+d4467109d803f42f8d9b088951d6123b9088f0069a4db280c2ca5e5a57bf746d1faa70d0f542154149e60f21891876f7c15da360e07eec8c8a36f5aac65509d3 netbox.initd
+a87dd52264f5ea00dbb774e54332480615850aa0056e60e13963481e8390bee73ceb519873fa11d357a29911c4e34a30c4623f4c206f765af6e64f379314e5a8 netbox.logrotated
+6b9eb0dcf8d5a267c3c88b81468d1fd7a7971cc084370a44f1ea5b61b08a30e9339f838e97947a0c65f385ed69fc5122592eca0ee5ff6e00cf5ec0f2dbe4c59f set-config-defaults.patch"