summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ruhier2016-10-30 02:40:11 +0100
committerAnthony Ruhier2016-10-30 02:40:11 +0100
commitdf490b2dcb341c291b1247bda5e836e92a572725 (patch)
tree14c3d384029abc17a4603f327503563a7fca0317
parentfc317378cdc09a805bd370b21ea4a8b91330c069 (diff)
downloadaur-df490b2dcb341c291b1247bda5e836e92a572725.tar.gz
Add netbox config
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD8
-rw-r--r--netbox.install12
3 files changed, 16 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b07badb9d49..c9bab82db31 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = netbox
pkgdesc = IP address management (IPAM) and data center infrastructure management (DCIM) tool.
pkgver = 1.6.3
- pkgrel = 4
+ pkgrel = 5
url = https://github.com/digitalocean/netbox
install = netbox.install
arch = any
@@ -31,6 +31,7 @@ pkgbase = netbox
conflicts = netbox-git
replaces = netbox-git
backup = etc/netbox/gunicorn_config.py
+ backup = etc/netbox/configuration.py
source = https://github.com/digitalocean/netbox/archive/v1.6.3.tar.gz
source = netbox-system.service
source = netbox.tmpfile
diff --git a/PKGBUILD b/PKGBUILD
index 5642353000f..c81f8d35791 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_name=netbox
pkgname=${_name}
pkgver=1.6.3
-pkgrel=4
+pkgrel=5
pkgdesc="IP address management (IPAM) and data center infrastructure management (DCIM) tool."
arch=('any')
url="https://github.com/digitalocean/${_name}"
@@ -42,18 +42,20 @@ sha256sums=('426a7b31e15acaaa9286b423a26f6d6e262f6b94e9060c5acabee2e9c5685dd4'
'5aaf2eef73c77c64bd78a50a80b8f4b3af87b63c64b139d63aa4a95cd82b1ca4'
'b8f7030f570e7707eb9c0f41c382e37d54244e7885c795a9f31788efdd45914e'
'7a5ae05cad7ec14193a43ef080776b5525c80b6258762a6cb6a108db83861ff9')
-backup=('etc/netbox/gunicorn_config.py')
+backup=('etc/netbox/gunicorn_config.py' 'etc/netbox/configuration.py')
package() {
mkdir -p "${pkgdir}/opt/${_name}"
chmod 775 "${pkgdir}/opt/${_name}"
- cp -r ${_name}-${pkgver}/${_name} "$pkgdir/opt/${_name}"
+ cp -r ${_name}-${pkgver}/${_name} "$pkgdir/opt/"
install -D -m644 ${_name}-system.service "$pkgdir/usr/lib/systemd/system/${_name}.service"
install -D -m644 ${_name}.tmpfile "$pkgdir/usr/lib/tmpfiles.d/${_name}.conf"
mkdir -p "$pkgdir/etc/netbox"
install -D -m644 gunicorn_config.py "$pkgdir/etc/netbox/gunicorn_config.py"
+ install -D -m644 ${_name}-${pkgver}/configuration.example.py "$pkgdir/etc/netbox/configuration.py"
+ ln -s /etc/netbox/configuration.py /opt/netbox/netbox/configuration.py
find "$pkgdir" -type d -name '.git' -exec rm -r '{}' +
}
diff --git a/netbox.install b/netbox.install
index 92f08a7b725..17a1161f8bc 100644
--- a/netbox.install
+++ b/netbox.install
@@ -1,7 +1,11 @@
_NAME=netbox
-post_install() {
+_create_user() {
getent passwd ${_NAME} > /dev/null || useradd -d /opt/${_NAME} -s /bin/false -r ${_NAME} > /dev/null
+}
+
+post_install() {
+ _create_user
echo ""
echo -e "Follow the instructions on http://netbox.readthedocs.io/en/latest/installation/netbox/"
@@ -9,12 +13,14 @@ post_install() {
echo -e "service: "
echo " systemctl enable --now netbox.service"
echo ""
- echo "Tweak the gunicorn configuration in /etc/netbox/gunicorn_config.py"
+ echo -e "Tweak the netbox and gunicorn configuration in "
+ echo "/etc/netbox/configuration.py and /etc/netbox/gunicorn_config.py"
echo ""
}
post_upgrade() {
- post_install
+ _create_user
+
echo ""
echo "To end the migration, use the following commands:"
echo " /opt/netbox/manage.py migrate"