97 lines
3.4 KiB
Bash
97 lines
3.4 KiB
Bash
# Copyright 1999-2022 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
PYTHON_COMPAT=( python3_{10,11,12} )
|
|
|
|
inherit python-r1 systemd
|
|
|
|
DESCRIPTION="IP address and data center infrastructure management tool"
|
|
HOMEPAGE="https://github.com/netbox-community/netbox"
|
|
SRC_URI="https://github.com/netbox-community/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
|
|
LICENSE="Apache-2.0"
|
|
SLOT="0"
|
|
KEYWORDS="amd64"
|
|
IUSE="ldap"
|
|
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
|
|
|
RDEPEND="acct-user/netbox
|
|
${PYTHON_DEPS}
|
|
dev-python/django[${PYTHON_USEDEP}]
|
|
dev-python/django-cors-headers[${PYTHON_USEDEP}]
|
|
dev-python/django-debug-toolbar[${PYTHON_USEDEP}]
|
|
dev-python/django-filter[${PYTHON_USEDEP}]
|
|
dev-python/django-graphiql-debug-toolbar[${PYTHON_USEDEP}]
|
|
dev-python/django-htmx[${PYTHON_USEDEP}]
|
|
dev-python/django-mptt[${PYTHON_USEDEP}]
|
|
dev-python/django-pglocks[${PYTHON_USEDEP}]
|
|
dev-python/django-prometheus[${PYTHON_USEDEP}]
|
|
dev-python/django-redis[${PYTHON_USEDEP}]
|
|
dev-python/django-rich[${PYTHON_USEDEP}]
|
|
dev-python/django-rq[${PYTHON_USEDEP}]
|
|
dev-python/django-tables2[${PYTHON_USEDEP}]
|
|
dev-python/django-taggit[${PYTHON_USEDEP}]
|
|
dev-python/django-timezone-field[${PYTHON_USEDEP}]
|
|
dev-python/djangorestframework[${PYTHON_USEDEP}]
|
|
dev-python/drf-spectacular[${PYTHON_USEDEP}]
|
|
dev-python/drf-spectacular-sidecar[${PYTHON_USEDEP}]
|
|
dev-python/feedparser[${PYTHON_USEDEP}]
|
|
dev-python/jinja2[${PYTHON_USEDEP}]
|
|
dev-python/markdown[${PYTHON_USEDEP}]
|
|
dev-python/markdown-include[${PYTHON_USEDEP}]
|
|
dev-python/mkdocs-material[${PYTHON_USEDEP}]
|
|
dev-python/mkdocstrings[${PYTHON_USEDEP}]
|
|
dev-python/mkdocstrings-python[${PYTHON_USEDEP}]
|
|
dev-python/netaddr[${PYTHON_USEDEP}]
|
|
dev-python/nh3[${PYTHON_USEDEP}]
|
|
dev-python/pillow[${PYTHON_USEDEP}]
|
|
>=dev-python/psycopg-3[${PYTHON_USEDEP}]
|
|
dev-python/pyyaml[${PYTHON_USEDEP}]
|
|
dev-python/requests[${PYTHON_USEDEP}]
|
|
dev-python/social-auth-core[${PYTHON_USEDEP}]
|
|
dev-python/social-auth-app-django[${PYTHON_USEDEP}]
|
|
dev-python/strawberry-graphql[${PYTHON_USEDEP}]
|
|
dev-python/strawberry-graphql-django[${PYTHON_USEDEP}]
|
|
dev-python/svgwrite[${PYTHON_USEDEP}]
|
|
dev-python/tablib[${PYTHON_USEDEP}]
|
|
dev-python/tzdata[${PYTHON_USEDEP}]
|
|
ldap? ( dev-python/django-auth-ldap[${PYTHON_USEDEP}] )"
|
|
DEPEND="${RDEPEND}"
|
|
|
|
DOCS=( {CHANGELOG,CONTRIBUTING,README}.md )
|
|
|
|
src_install() {
|
|
insinto /etc/netbox
|
|
doins "${FILESDIR}/nginx.conf"
|
|
doins "${FILESDIR}/uwsgi.ini"
|
|
doins netbox/netbox/configuration_example.py
|
|
newins netbox/netbox/configuration_example.py configuration.py
|
|
|
|
rm -rf netbox/media netbox/reports netbox/scripts
|
|
insinto "/usr/lib/netbox"
|
|
doins -r netbox/.
|
|
dosym /etc/netbox/configuration.py /usr/lib/netbox/netbox/configuration.py
|
|
keepdir /var/lib/netbox/media
|
|
keepdir /var/lib/netbox/reports
|
|
keepdir /var/lib/netbox/scripts
|
|
fowners -R netbox:netbox /var/lib/netbox
|
|
dosym /var/lib/netbox/media /usr/lib/netbox/media
|
|
dosym /var/lib/netbox/reports /usr/lib/netbox/reports
|
|
dosym /var/lib/netbox/scripts /usr/lib/netbox/scripts
|
|
|
|
exeinto "/usr/lib/netbox"
|
|
doexe netbox/generate_secret_key.py
|
|
doexe netbox/manage.py
|
|
|
|
newinitd "${FILESDIR}"/netbox-rqworker.initd netbox-rqworker
|
|
newconfd "${FILESDIR}"/netbox-rqworker.confd netbox-rqworker
|
|
systemd_dounit "${FILESDIR}/netbox.service"
|
|
systemd_dounit "${FILESDIR}/netbox-rq.service"
|
|
systemd_dounit "${FILESDIR}/netbox-housekeeping.service"
|
|
systemd_dounit "${FILESDIR}/netbox-housekeeping.timer"
|
|
diropts -o netbox -g netbox -m 0700
|
|
keepdir /var/log/netbox
|
|
}
|