summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ruhier2016-12-18 13:15:52 +0100
committerAnthony Ruhier2016-12-18 13:17:31 +0100
commit37edea28a0f2eb596d5c98bfb376918beb552848 (patch)
treee42ad42867380791c7d37974c80c452c76a0d12d
parentc5780fe1021ea764140b9767e516e7a43df0166c (diff)
downloadaur-37edea28a0f2eb596d5c98bfb376918beb552848.tar.gz
Add django debug toolbar to middlewares
The version in the netbox requirements apparently does not need it, but the one in Arch repos does.
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD16
-rw-r--r--debug_toolbar_middleware.patch10
3 files changed, 24 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3cd77483fcd7..061529f36fdc 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.7.3
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/digitalocean/netbox
install = netbox.install
arch = any
@@ -37,10 +37,12 @@ pkgbase = netbox
source = https://github.com/digitalocean/netbox/archive/v1.7.3.tar.gz
source = netbox-system.service
source = netbox.tmpfile
+ source = debug_toolbar_middleware.patch
source = gunicorn_config.py
sha256sums = ae00c63fb7cf6a5df3f17fd849c796041a91a24d54af472c4ebd0ccbc59d2854
sha256sums = 12bb0253aea3dd763ee8bb1a17064256155b79e904a4350abf89cf4c65235951
sha256sums = 1028bac96ddcd18c10646dff26027b4891fcab4381436e2b6ea3302887a5586f
+ sha256sums = 2d6d55cad836eca187a7dfe40227f994e9b2f565e71fd39e296bc8bb73bf259a
sha256sums = 7a5ae05cad7ec14193a43ef080776b5525c80b6258762a6cb6a108db83861ff9
pkgname = netbox
diff --git a/PKGBUILD b/PKGBUILD
index dca892bf409a..ca05a4bc58a0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_name=netbox
pkgname=${_name}
pkgver=1.7.3
-pkgrel=1
+pkgrel=2
pkgdesc="IP address management (IPAM) and data center infrastructure management (DCIM) tool."
arch=('any')
url="https://github.com/digitalocean/${_name}"
@@ -39,18 +39,26 @@ install="${_name}.install"
source=("${url}/archive/v${pkgver}.tar.gz"
"${_name}-system.service"
"${_name}.tmpfile"
+ "debug_toolbar_middleware.patch"
"gunicorn_config.py")
sha256sums=('ae00c63fb7cf6a5df3f17fd849c796041a91a24d54af472c4ebd0ccbc59d2854'
'12bb0253aea3dd763ee8bb1a17064256155b79e904a4350abf89cf4c65235951'
'1028bac96ddcd18c10646dff26027b4891fcab4381436e2b6ea3302887a5586f'
+ '2d6d55cad836eca187a7dfe40227f994e9b2f565e71fd39e296bc8bb73bf259a'
'7a5ae05cad7ec14193a43ef080776b5525c80b6258762a6cb6a108db83861ff9')
backup=('etc/netbox/gunicorn_config.py' 'etc/netbox/configuration.py')
+prepare() {
+ cd "${srcdir}/${_name}-${pkgver}"
+
+ patch -p0 -i "${srcdir}"/debug_toolbar_middleware.patch
+ sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
+ $(find "${_name}" -name '*.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"
@@ -60,8 +68,6 @@ package() {
install -D -m644 gunicorn_config.py "$pkgdir/etc/netbox/gunicorn_config.py"
install -D -m644 ${_name}-${pkgver}/${_name}/${_name}/configuration.example.py "$pkgdir/etc/netbox/configuration.py"
ln -s /etc/netbox/configuration.py "$pkgdir/opt/netbox/netbox/configuration.py"
-
- find "$pkgdir" -type d -name '.git' -exec rm -r '{}' +
}
# vim: set ts=2 sw=2 ft=sh noet:
diff --git a/debug_toolbar_middleware.patch b/debug_toolbar_middleware.patch
new file mode 100644
index 000000000000..1fa52c8b8fff
--- /dev/null
+++ b/debug_toolbar_middleware.patch
@@ -0,0 +1,10 @@
+--- netbox/netbox/settings.py.old
++++ netbox/netbox/settings.py
+@@ -127,6 +127,7 @@
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
+ 'django.middleware.security.SecurityMiddleware',
+ 'utilities.middleware.LoginRequiredMiddleware',
++ 'debug_toolbar.middleware.DebugToolbarMiddleware',
+ )
+
+ ROOT_URLCONF = 'netbox.urls'