Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/netbox/files/, www-apps/netbox/
Date: Wed, 01 May 2019 21:56:35
Message-Id: 1556747703.a1673d48e60c63fb893b1ffeda18133b632c5f72.williamh@gentoo
1 commit: a1673d48e60c63fb893b1ffeda18133b632c5f72
2 Author: William Hubbs <william.hubbs <AT> sony <DOT> com>
3 AuthorDate: Wed May 1 21:54:10 2019 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Wed May 1 21:55:03 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1673d48
7
8 www-apps/netbox: 2.5.12 bump
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-2.3.62, Repoman-2.3.12
12 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
13
14 www-apps/netbox/Manifest | 1 +
15 www-apps/netbox/files/netbox-2.5.12-no-pip.patch | 27 ++++++
16 www-apps/netbox/netbox-2.5.12.ebuild | 118 +++++++++++++++++++++++
17 3 files changed, 146 insertions(+)
18
19 diff --git a/www-apps/netbox/Manifest b/www-apps/netbox/Manifest
20 index 2f26f7d2126..fedbeb9fccb 100644
21 --- a/www-apps/netbox/Manifest
22 +++ b/www-apps/netbox/Manifest
23 @@ -1,2 +1,3 @@
24 DIST netbox-2.5.10.tar.gz 2363340 BLAKE2B 9bc946398ac75b585f2bc6fdb01bfb7545c92ccbb239e9ac0309b66be435134a87cde5fcf876cec4c3354e7aedf5af1d9e1976574689dfb0af34404e9c9f907f SHA512 ed71b0efaffd8bad6e53f7b281d1933234161f031110fa901e1b789a964f000f2ff13897685e79193cbee9294c1f50b8c6edef7d0ef6f829a7357640c8034525
25 DIST netbox-2.5.11.tar.gz 2364831 BLAKE2B e5117b2d4c3f33b231715a8b192e7954dc0611fcb270937c5c8abda3abc9f9925bd7db2c7306847428b5a24014d0c0b07ee404294b389a708d0dc7963c250691 SHA512 dfd19af01bf096ee7d8790981853d7e94d8926a4f0eeb00a061f805d56486670c058752b9a9fb23882b0b8d33e4a2d62f50a35b56c28eb2782be47e6f4b13b7d
26 +DIST netbox-2.5.12.tar.gz 2364874 BLAKE2B efe1360fd7c1105e5c6010ee22a882fb4fc796ff0f907974984dba35a0ab6da7724fd6042b102cebe3e3e291c3a1c65c347a5967edbaf443ece6fe61648a93be SHA512 e105a351f1150139c5bce36527ea650f95504ccc1c7b6a82c41396d69bc8671758cc3b33789c95c81785c5ff54d34c7310cd3e03e65bd006606e85021dcd1795
27
28 diff --git a/www-apps/netbox/files/netbox-2.5.12-no-pip.patch b/www-apps/netbox/files/netbox-2.5.12-no-pip.patch
29 new file mode 100644
30 index 00000000000..5d1fa595f4e
31 --- /dev/null
32 +++ b/www-apps/netbox/files/netbox-2.5.12-no-pip.patch
33 @@ -0,0 +1,27 @@
34 +diff --git a/upgrade.sh b/upgrade.sh
35 +index 24e79f5b..248e1cb5 100755
36 +--- a/upgrade.sh
37 ++++ b/upgrade.sh
38 +@@ -8,22 +8,6 @@
39 + PYTHON="python3"
40 + PIP="pip3"
41 +
42 +-# TODO: Remove this in v2.6 as it is no longer needed under Python 3
43 +-# Delete stale bytecode
44 +-COMMAND="find . -name \"*.pyc\" -delete"
45 +-echo "Cleaning up stale Python bytecode ($COMMAND)..."
46 +-eval $COMMAND
47 +-
48 +-# Uninstall any Python packages which are no longer needed
49 +-COMMAND="${PIP} uninstall -r old_requirements.txt -y"
50 +-echo "Removing old Python packages ($COMMAND)..."
51 +-eval $COMMAND
52 +-
53 +-# Install any new Python packages
54 +-COMMAND="${PIP} install -r requirements.txt --upgrade"
55 +-echo "Updating required Python packages ($COMMAND)..."
56 +-eval $COMMAND
57 +-
58 + # Apply any database migrations
59 + COMMAND="${PYTHON} netbox/manage.py migrate"
60 + echo "Applying database migrations ($COMMAND)..."
61
62 diff --git a/www-apps/netbox/netbox-2.5.12.ebuild b/www-apps/netbox/netbox-2.5.12.ebuild
63 new file mode 100644
64 index 00000000000..02a00a2c553
65 --- /dev/null
66 +++ b/www-apps/netbox/netbox-2.5.12.ebuild
67 @@ -0,0 +1,118 @@
68 +# Copyright 1999-2019 Gentoo Authors
69 +# Distributed under the terms of the GNU General Public License v2
70 +
71 +EAPI=7
72 +PYTHON_COMPAT=( python3_6 )
73 +inherit python-single-r1 user readme.gentoo-r1
74 +
75 +DESCRIPTION="IP address and data center infrastructure management tool"
76 +HOMEPAGE="https://github.com/digitalocean/netbox"
77 +SRC_URI="https://github.com/digitalocean/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
78 +
79 +LICENSE="Apache-2.0"
80 +SLOT="0"
81 +KEYWORDS="~amd64"
82 +IUSE="ldap webhooks"
83 +
84 +RDEPEND=">=dev-python/django-2.2[${PYTHON_USEDEP}]
85 + >=dev-python/django-cors-headers-2.4.0[${PYTHON_USEDEP}]
86 + >=dev-python/django-debug-toolbar-1.11[${PYTHON_USEDEP}]
87 + >=dev-python/django-filter-2.0.0[${PYTHON_USEDEP}]
88 + >=dev-python/django-mptt-0.9.1[${PYTHON_USEDEP}]
89 + >=dev-python/django-tables2-2.0.3[${PYTHON_USEDEP}]
90 + >=dev-python/django-taggit-0.23.0[${PYTHON_USEDEP}]
91 + >=dev-python/django-taggit-serializer-0.1.7[${PYTHON_USEDEP}]
92 + >=dev-python/django-timezone-field-3.0[${PYTHON_USEDEP}]
93 + >=dev-python/djangorestframework-3.9.0[${PYTHON_USEDEP}]
94 + >=dev-python/drf-yasg-1.14.0[${PYTHON_USEDEP},validation]
95 + >=dev-python/graphviz-0.10.1[${PYTHON_USEDEP}]
96 + >=dev-python/jinja-2.10[${PYTHON_USEDEP}]
97 + >=dev-python/markdown-2.6.11[${PYTHON_USEDEP}]
98 + >=dev-python/netaddr-0.7.19[${PYTHON_USEDEP}]
99 + >=dev-python/pillow-5.3.0[${PYTHON_USEDEP}]
100 + >=dev-python/psycopg-2.7.6.1[${PYTHON_USEDEP}]
101 + >=dev-python/py-gfm-0.1.4[${PYTHON_USEDEP}]
102 + >=dev-python/pycryptodome-3.7.2[${PYTHON_USEDEP}]
103 + www-servers/gunicorn[${PYTHON_USEDEP}]
104 + ldap? ( >=dev-python/django-auth-ldap-1.7[${PYTHON_USEDEP}] )
105 + webhooks? ( dev-python/django-rq )"
106 +DEPEND="${RDEPEND}"
107 +
108 +PATCHES=(
109 + "${FILESDIR}"/${P}-no-pip.patch
110 + )
111 +
112 +DISABLE_AUTOFORMATTING=YES
113 +DOC_CONTENTS="
114 +netbox is installed on your system. However, there are some manual steps
115 +you need to complete from the installation guide [1].
116 +
117 +On Gentoo, the configuration files you need to edit are located in
118 +/etc/netbox, not /opt/netbox as shown in the installation guide.
119 +
120 +If this is a new installation, please follow the installation guide
121 +other than this difference. Also, if you need ldap or webhooks, set the
122 +appropriate use flags when you emerge netbox to install the
123 +dependencies.
124 +
125 +Once that is done, you should be able to add the netbox service to the
126 +default runlevel and start it.
127 +
128 +If you have webhooks turned on, you should also add the netbox-rqworker
129 +service to the default runlevel and start it.
130 +
131 +If this is an upgrade, follow these instructions:
132 +
133 +Stop the netbox service. If the netbox-rqworker service is running,
134 +stop it as well.
135 +
136 +Next, run the upgrade script as described in the upgrading guide[2].
137 +
138 +Next, check for new configuration options and set them as appropriate
139 +for your system.
140 +
141 +Next, start the netbox service.
142 +
143 +Finally, if you are using webhooks, start the netbox-rqworker service.
144 +
145 +[1] https://netbox.readthedocs.io/en/stable/installation/
146 +[2] https://netbox.readthedocs.io/en/stable/installation/upgrading/
147 +"
148 +
149 +pkg_setup() {
150 + enewgroup ${PN}
151 + enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
152 +}
153 +
154 +src_install() {
155 + dodir /opt
156 + cp -a ../${P} "${ED}"/opt
157 + dosym ${P} /opt/netbox
158 +dosym ../../etc/netbox/gunicorn_config.py /opt/netbox/gunicorn_config.py
159 + dosym ../../../../etc/netbox/configuration.py \
160 + /opt/netbox/netbox/netbox/configuration.py
161 + dodir /etc/netbox
162 + insinto /etc/netbox
163 + newins netbox/netbox/configuration.example.py configuration.py
164 + doins "${FILESDIR}"/gunicorn_config.py
165 + fowners -R netbox:netbox /etc/netbox /opt/${P}
166 + fowners -h netbox:netbox /opt/netbox
167 + fperms o= /etc/netbox/configuration.py /etc/netbox/gunicorn_config.py
168 + newinitd "${FILESDIR}"/${PN}.initd ${PN}
169 + use webhooks &&
170 + newinitd "${FILESDIR}"/${PN}-rqworker.initd ${PN}-rqworker
171 + keepdir /var/log/netbox
172 + fowners -R netbox:netbox /var/log/netbox
173 + readme.gentoo_create_doc
174 +}
175 +
176 +pkg_postinst() {
177 + readme.gentoo_print_elog
178 + local r
179 + for r in $REPLACING_VERSIONS; do
180 + if [[ $r = "2.5.10" ]]; then
181 + ewarn "The home directory of the netbox user is now /var/lib/netbox"
182 + ewarn "Please adjust your system."
183 + fi
184 + done
185 +}