summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ruhier2016-10-30 04:20:36 +0100
committerAnthony Ruhier2016-10-30 04:20:36 +0100
commit025648dbdca67139891fd5b4e4eb81f0065964a3 (patch)
tree483d59dc64babd08312033295414f1db07cb2a8f
parentd74b3c0314b2adaf82877ba5a6a5617157c419ee (diff)
downloadaur-025648dbdca67139891fd5b4e4eb81f0065964a3.tar.gz
Fix dependencies and bugs
Replace /usr/bin/python by /usr/bin/python2
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD11
-rw-r--r--netbox-system.service4
-rw-r--r--netbox.install7
-rw-r--r--netbox.tmpfile2
5 files changed, 22 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bfcbe236b13..460fb21f91b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,12 @@
pkgbase = netbox
pkgdesc = IP address management (IPAM) and data center infrastructure management (DCIM) tool.
pkgver = 1.6.3
- pkgrel = 8
+ pkgrel = 9
url = https://github.com/digitalocean/netbox
install = netbox.install
arch = any
license = Apache-2.0
depends = python2
- depends = graphviz
depends = gunicorn-python2
depends = libffi
depends = libpgf
@@ -18,15 +17,17 @@ pkgbase = netbox
depends = python2-django-debug-toolbar-git
depends = python2-django-filter
depends = python2-django-rest-framework
- depends = python2-django-rest-swagger
+ depends = python2-django-rest-swagger0.3.10
depends = python2-django-tables2
+ depends = python2-graphviz
depends = python2-lxml
depends = python2-markdown
depends = python2-natsort
depends = python2-ncclient
depends = python2-netaddr
- depends = python-paramiko
+ depends = python2-paramiko
depends = python2-py-gfm
+ depends = python2-psycopg2
depends = python2-sqlparse
depends = python2-xmltodict
conflicts = netbox-git
diff --git a/PKGBUILD b/PKGBUILD
index 2416211e51f..6ad44a42d11 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,13 +3,12 @@
_name=netbox
pkgname=${_name}
pkgver=1.6.3
-pkgrel=8
+pkgrel=9
pkgdesc="IP address management (IPAM) and data center infrastructure management (DCIM) tool."
arch=('any')
url="https://github.com/digitalocean/${_name}"
license=('Apache-2.0')
depends=('python2'
- 'graphviz'
'gunicorn-python2'
'libffi'
'libpgf'
@@ -20,15 +19,17 @@ depends=('python2'
'python2-django-debug-toolbar-git'
'python2-django-filter'
'python2-django-rest-framework'
- 'python2-django-rest-swagger'
+ 'python2-django-rest-swagger0.3.10'
'python2-django-tables2'
+ 'python2-graphviz'
'python2-lxml'
'python2-markdown'
'python2-natsort'
'python2-ncclient'
'python2-netaddr'
- 'python-paramiko'
+ 'python2-paramiko'
'python2-py-gfm'
+ 'python2-psycopg2'
'python2-sqlparse'
'python2-xmltodict')
@@ -48,6 +49,8 @@ backup=('etc/netbox/gunicorn_config.py' 'etc/netbox/configuration.py')
package() {
mkdir -p "${pkgdir}/opt/${_name}"
chmod 775 "${pkgdir}/opt/${_name}"
+ sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
+ $(find "${_name}-${pkgver}/${_name}" -name '*.py')
cp -r ${_name}-${pkgver}/${_name} "$pkgdir/opt/"
install -D -m644 ${_name}-system.service "$pkgdir/usr/lib/systemd/system/${_name}.service"
diff --git a/netbox-system.service b/netbox-system.service
index 303b4813784..520924d27ee 100644
--- a/netbox-system.service
+++ b/netbox-system.service
@@ -4,9 +4,9 @@ After=network.target
[Service]
User=netbox
-Type=forking
+Type=simple
PIDFile=/run/netbox/netbox.pid
-ExecStart=/usr/bin/gunicorn -c /etc/netbox/gunicorn_config.py netbox.wsgi
+ExecStart=/usr/bin/gunicorn-python2 -c /etc/netbox/gunicorn_config.py --pythonpath /opt/netbox -p /run/netbox/netbox.pid netbox.wsgi
[Install]
WantedBy=multi-user.target
diff --git a/netbox.install b/netbox.install
index 17a1161f8bc..9745fd71152 100644
--- a/netbox.install
+++ b/netbox.install
@@ -7,6 +7,13 @@ _create_user() {
post_install() {
_create_user
+ # Create a directory in /run if it does not exist
+ if [ ! -d /run/${_NAME} ]; then
+ mkdir /run/${_NAME}
+ chown ${_NAME}. /run/${_NAME}
+ chmod 775 /run/${_NAME}
+ fi
+
echo ""
echo -e "Follow the instructions on http://netbox.readthedocs.io/en/latest/installation/netbox/"
echo -e "to finish the configuration, and enable and start the systemd "
diff --git a/netbox.tmpfile b/netbox.tmpfile
index d5194efaa14..f1ac6975f79 100644
--- a/netbox.tmpfile
+++ b/netbox.tmpfile
@@ -1 +1 @@
-d /run/headphones 0775 headphones headphones
+d /run/netbox 0775 netbox netbox