1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_6 )
6 inherit python-single-r1 user readme.gentoo-r1
8 DESCRIPTION="IP address and data center infrastructure management tool"
9 HOMEPAGE="https://github.com/digitalocean/netbox"
10 SRC_URI="https://github.com/digitalocean/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
16 REQUIRED_USE=${PYTHON_REQUIRED_USE}
20 >=dev-python/django-2.2[${PYTHON_USEDEP}]
21 >=dev-python/django-cors-headers-2.4.0[${PYTHON_USEDEP}]
22 >=dev-python/django-debug-toolbar-1.11[${PYTHON_USEDEP}]
23 >=dev-python/django-filter-2.0.0[${PYTHON_USEDEP}]
24 >=dev-python/django-mptt-0.9.1[${PYTHON_USEDEP}]
25 >=dev-python/django-tables2-2.0.3[${PYTHON_USEDEP}]
26 >=dev-python/django-taggit-0.23.0[${PYTHON_USEDEP}]
27 >=dev-python/django-taggit-serializer-0.1.7[${PYTHON_USEDEP}]
28 >=dev-python/django-timezone-field-3.0[${PYTHON_USEDEP}]
29 >=dev-python/djangorestframework-3.9.0[${PYTHON_USEDEP}]
30 >=dev-python/drf-yasg-1.14.0[${PYTHON_USEDEP},validation]
31 >=dev-python/graphviz-0.10.1[${PYTHON_USEDEP}]
32 >=dev-python/jinja-2.10[${PYTHON_USEDEP}]
33 >=dev-python/markdown-2.6.11[${PYTHON_USEDEP}]
34 >=dev-python/netaddr-0.7.19[${PYTHON_USEDEP}]
35 >=dev-python/pillow-5.3.0[${PYTHON_USEDEP}]
36 >=dev-python/psycopg-2.7.6.1[${PYTHON_USEDEP}]
37 >=dev-python/py-gfm-0.1.4[${PYTHON_USEDEP}]
38 >=dev-python/pycryptodome-3.7.2[${PYTHON_USEDEP}]
39 www-servers/gunicorn[${PYTHON_USEDEP}]
40 ldap? ( >=dev-python/django-auth-ldap-1.7[${PYTHON_USEDEP}] )
41 webhooks? ( dev-python/django-rq )"
45 "${FILESDIR}"/${P}-no-pip.patch
48 DISABLE_AUTOFORMATTING=YES
50 netbox is installed on your system. However, there are some manual steps
51 you need to complete from the installation guide [1].
53 On Gentoo, the configuration files you need to edit are located in
54 /etc/netbox, not /opt/netbox as shown in the installation guide.
56 If this is a new installation, please follow the installation guide
57 other than this difference. Also, if you need ldap or webhooks, set the
58 appropriate use flags when you emerge netbox to install the
61 Once that is done, you should be able to add the netbox service to the
62 default runlevel and start it.
64 If you have webhooks turned on, you should also add the netbox-rqworker
65 service to the default runlevel and start it.
67 If this is an upgrade, follow these instructions:
69 Stop the netbox service. If the netbox-rqworker service is running,
72 Next, run the upgrade script as described in the upgrading guide[2].
74 Next, check for new configuration options and set them as appropriate
77 Next, start the netbox service.
79 Finally, if you are using webhooks, start the netbox-rqworker service.
81 [1] https://netbox.readthedocs.io/en/stable/installation/
82 [2] https://netbox.readthedocs.io/en/stable/installation/upgrading/
87 enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
92 cp -a ../${P} "${ED}"/opt
93 dosym ${P} /opt/netbox
94 dosym ../../etc/netbox/gunicorn_config.py /opt/netbox/gunicorn_config.py
95 dosym ../../../../etc/netbox/configuration.py \
96 /opt/netbox/netbox/netbox/configuration.py
99 newins netbox/netbox/configuration.example.py configuration.py
100 doins "${FILESDIR}"/gunicorn_config.py
101 fowners -R netbox:netbox /etc/netbox /opt/${P}
102 fowners -h netbox:netbox /opt/netbox
103 fperms o= /etc/netbox/configuration.py /etc/netbox/gunicorn_config.py
104 newinitd "${FILESDIR}"/${PN}.initd ${PN}
106 newinitd "${FILESDIR}"/${PN}-rqworker.initd ${PN}-rqworker
107 keepdir /var/log/netbox
108 fowners -R netbox:netbox /var/log/netbox
109 readme.gentoo_create_doc
113 readme.gentoo_print_elog
115 for r in $REPLACING_VERSIONS; do
116 if [[ $r = "2.5.10" ]]; then
117 ewarn "The home directory of the netbox user is now /var/lib/netbox"
118 ewarn "Please adjust your system."