Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:dmolkentin:netbox
netbox
netbox.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File netbox.spec of Package netbox
# # spec file for package netbox # # Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define netbox_services %{name}.target %{name}-update.service %{name}-gunicorn.service %{name}-rqworker.service %define app_dir %{_datadir}/%{name} %define home_dir %{_localstatedir}/lib/netbox %define log_dir %{_localstatedir}/log/netbox Name: netbox Version: 3.1.5 Release: 0 Summary: Web based IPAM and DCIM tool License: Apache-2.0 Group: Productivity/Networking/Other URL: https://github.com/netbox-community/netbox Source: https://github.com/netbox-community/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: %{name}-rpmlintrc Source2: ldap_config.py Source3: netbox.target Source4: netbox-update.service Source5: netbox-gunicorn.service Source7: netbox-rqworker.service Source8: netbox-gunicorn.config Source9: netbox.tmpfiles.d Source10: %{name}.firewalld Source11: %{name}.firewall Source12: %{name}.vhost-apache Source13: %{name}.vhost-nginx BuildRequires: apache-rpm-macros BuildRequires: fdupes BuildRequires: pkgconfig BuildRequires: python-rpm-macros # Upstream use python >= 3.7 BuildRequires: python3 >= 3.6 BuildRequires: python3-Django >= 3.2.5 BuildRequires: python3-Jinja2 >= 2.11.2 BuildRequires: python3-Markdown >= 3.2.2 BuildRequires: python3-Pillow >= 8.3.0 BuildRequires: python3-PyYAML >= 5.4.1 BuildRequires: python3-django-auth-ldap BuildRequires: python3-django-cacheops >= 6.0 BuildRequires: python3-django-cors-headers >= 3.7.0 BuildRequires: python3-django-debug-toolbar >= 3.2.1 BuildRequires: python3-django-filter >= 2.4.0 BuildRequires: python3-django-mptt >= 0.12.0 BuildRequires: python3-django-pglocks >= 1.0.4 BuildRequires: python3-django-prometheus >= 2.1.0 BuildRequires: python3-django-rq >= 2.4.1 BuildRequires: python3-django-storages BuildRequires: python3-django-tables2 >= 2.3.4 BuildRequires: python3-django-taggit >= 1.5.1 BuildRequires: python3-django-taggit-serializer >= 0.1.7 BuildRequires: python3-django-timezone-field >= 4.1.2 BuildRequires: python3-djangorestframework >= 3.12.4 BuildRequires: python3-drf-yasg >= 1.20.0 BuildRequires: python3-gunicorn >= 20.1.0 BuildRequires: python3-ldap BuildRequires: python3-napalm BuildRequires: python3-netaddr >= 0.8.0 BuildRequires: python3-psycopg2 >= 2.9.1 BuildRequires: python3-py-gfm >= 0.1.4 BuildRequires: python3-pycryptodome >= 3.10.1 BuildRequires: python3-redis >= 3.4.1 BuildRequires: python3-svgwrite >= 1.4.1 BuildRequires: python3-tablib >= 3.0.0 BuildRequires: pkgconfig(systemd) # Upstream use python >= 3.7 %requires_ge python3 >= 3.6 %requires_ge python3-Django %requires_ge python3-Jinja2 %requires_ge python3-Markdown %requires_ge python3-Pillow %requires_ge python3-PyYAML %requires_ge python3-django-auth-ldap %requires_ge python3-django-cacheops %requires_ge python3-django-cors-headers %requires_ge python3-django-debug-toolbar %requires_ge python3-django-filter %requires_ge python3-django-mptt %requires_ge python3-django-pglocks %requires_ge python3-django-prometheus %requires_ge python3-django-rq %requires_ge python3-django-storages %requires_ge python3-django-tables2 %requires_ge python3-django-taggit %requires_ge python3-django-taggit-serializer %requires_ge python3-django-timezone-field %requires_ge python3-djangorestframework %requires_ge python3-drf-yasg %requires_ge python3-gunicorn %requires_ge python3-ldap %requires_ge python3-napalm %requires_ge python3-netaddr %requires_ge python3-psycopg2 %requires_ge python3-py-gfm %requires_ge python3-pycryptodome %requires_ge python3-redis %requires_ge python3-svgwrite %requires_ge python3-tablib Recommends: postgresql-server >= 10.0 BuildArch: noarch %description NetBox is an IP address management (IPAM) and data center infrastructure management (DCIM) tool. NetBox was developed specifically to address the needs of network and infrastructure engineers. %package ldap Summary: LDAP configuration for Netbox Requires: netbox = %{version} Requires: python3-django-auth-ldap Requires: python3-ldap BuildArch: noarch %description ldap LDAP configuration files for Netbox %package nginx Summary: Nginx configuration for Netbox BuildRequires: nginx Requires: netbox = %{version} Requires: nginx Supplements: (nginx and %name) BuildArch: noarch %description nginx Nginx configuration files for Netbox. %package apache Summary: Apache configuration for Netbox BuildRequires: apache2 Requires: apache2 Requires: netbox = %{version} Supplements: (apache2 and %name) BuildArch: noarch %description apache Apache configuration files for Netbox. %prep %setup -q echo napalm >> local_requirements.txt echo django-storages >> local_requirements.txt %build # Upstream sadly ships git meta files find \( -name .gitignore -or -name .gitkeep \) -delete rm -r `find . -name ".github" -or -name ".editorconfig" -or -name ".jshintignore" -or -name ".jshintrc"` # js, css and md files should not be executable find -type f \( -name '*.js' -o -name '*.css' -o -name '*.md' \) -exec chmod -x {} \; # fix shebang lines find -name *.py -exec sed -i 's,\#\!%{_bindir}/env python,\#\!%{_bindir}/python3,g' {} \; mv netbox/netbox/configuration.example.py . cat >> configuration.example.py << EOF # SUSE packages need to adjust the documentation root # to account for the standardized documentation pathes DOCS_ROOT = '%{_docdir}/netbox/docs' EOF pushd netbox/ %if %{with build_assets} sed -e "s|SECRET_KEY = ''|SECRET_KEY = 'justforbuilding'|g" < ../configuration.example.py > netbox/configuration.py python3 manage.py collectstatic --no-input rm -f netbox/configuration.py netbox/__pycache__/configuration.cpython-*.pyc %endif python3 -m compileall -x '.*/migrations/.*' . popd mkdir %{name}/{tmp,public,static} %install install -D -d -m 0750 %{buildroot}%{home_dir} %{buildroot}%{log_dir} mkdir -p %{buildroot}%{_datadir} cp -a %{name} %{buildroot}%{_datadir} install -D -d -m 0750 %{buildroot}%{_sysconfdir}/%{name} install -m 0640 %{SOURCE8} %{buildroot}%{_sysconfdir}/%{name}/gunicorn.py install -m 0640 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/ldap_config.py install -m 0640 configuration.example.py %{buildroot}%{_sysconfdir}/%{name}/configuration.py ln -s %{_sysconfdir}/%{name}/configuration.py %{buildroot}%{app_dir}/%{name}/configuration.py ln -s %{_sysconfdir}/%{name}/ldap_config.py %{buildroot}%{app_dir}/%{name}/ldap_config.py mkdir -p %{buildroot}%{_unitdir} cp %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE7} %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_sbindir} for i in gunicorn rqworker update ; do ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-$i done install -D -m 0644 %{SOURCE9} %{buildroot}%{_tmpfilesdir}/%{name}.conf cat > %{buildroot}%{_sbindir}/netbox-build-assets <<EOF #!/bin/bash cd %{app_dir} python3 manage.py collectstatic --no-input EOF chmod a+rx %{buildroot}%{_sbindir}/netbox-build-assets cat > %{buildroot}%{_sbindir}/netbox-manage<<EOF #!/bin/bash cd %{app_dir} sudo -u _%{name} ./manage.py \$@ EOF chmod a+rx %{buildroot}%{_sbindir}/netbox-manage # Apache install -D -m 0644 %{SOURCE12} %{buildroot}%{apache_sysconfdir}/vhosts.d/%{name}.conf # nginx install -D -m 0644 %{SOURCE13} %{buildroot}%{_sysconfdir}/nginx/vhosts.d/%{name}.conf # firewall %if %{with firewall_files} %if 0%{?suse_version} >= 1500 install -d %{buildroot}%{_libexecdir}/firewalld/services/ install -D -m 0644 %{SOURCE10} %{buildroot}%{_libexecdir}/firewalld/services/%{name}.xml %else install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2/services/ install -D -m 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2/services/%{name} %endif %endif %fdupes %{buildroot}%{app_dir} %pre %{_sbindir}/groupadd -r _%{name} &>/dev/null || : %{_sbindir}/useradd -g _%{name} -s /bin/false -r -c "Netbox" -d %{home_dir} _%{name} &>/dev/null || : # move homedir %{_sbindir}/usermod --home %{home_dir} _%{name} ||: %service_add_pre %{netbox_services} %post %tmpfiles_create %{_tmpfilesdir}/%{name}.conf %service_add_post %{netbox_services} %preun %service_del_preun %{netbox_services} %postun %service_del_postun %{netbox_services} %files %license LICENSE.txt %doc README.md CONTRIBUTING.md %doc docs/ %doc configuration.example.py # %config(noreplace) %attr(-,root,_netbox) %{_sysconfdir}/%{name} # %dir %attr(-,_netbox,_netbox) %{app_dir}/media %dir %attr(-,_netbox,_netbox) %{app_dir}/tmp %{app_dir}/ %exclude %{_sysconfdir}/%{name}/ldap_config.py %exclude %{app_dir}/%{name}/ldap_config.py # %{_tmpfilesdir}/%{name}.conf %{_unitdir}/%{name}* %{_sbindir}/rc%{name}* %{_sbindir}/netbox-build-assets %{_sbindir}/netbox-manage # %dir %attr(-,_netbox,_netbox) %{home_dir} %dir %attr(-,_netbox,_netbox) %{log_dir} # %ghost %dir %attr(755,_netbox,_netbox) /run/netbox %ghost %dir %attr(755,_netbox,_netbox) /run/netbox/gunicorn %files ldap %config(noreplace) %attr(-,root,_netbox) %{_sysconfdir}/%{name}/ldap_config.py %{app_dir}/%{name}/ldap_config.py %files nginx %config(noreplace) %{_sysconfdir}/nginx/vhosts.d/%{name}.conf %files apache %config(noreplace) %{apache_sysconfdir}/vhosts.d/%{name}.conf %if %{with firewall_files} %files firewall %if 0%{?suse_version} >= 1500 %dir %{_libexecdir}/firewalld %dir %{_libexecdir}/firewalld/services %config(noreplace) %{_libexecdir}/firewalld/services/%{name}.xml %else %config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} %endif %endif %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor