File openstack-neutron-vpnaas.spec of Package openstack-neutron-vpnaas
#
# spec file for package openstack-neutron-vpnaas
#
# Copyright (c) 2023 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 component neutron-vpnaas
%define groupname %{component}
%define username %{component}
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
%define version_unconverted 13.0.2.dev6
Name: openstack-neutron-vpnaas
Version: 13.0.2~dev6
Release: 0
Summary: Neutron VPN as a Service
License: Apache-2.0
Group: System/Management
URL: https://launchpad.net/neutron
Source: http://tarballs.openstack.org/neutron-vpnaas/neutron-vpnaas-stable-rocky.tar.gz
Source1: %{name}.logrotate
Source2: %name.conf
Source3: rpmlintrc
# systemd service files
Source11: openstack-neutron-vyatta-agent.service
BuildRequires: crudini
BuildRequires: fdupes
BuildRequires: openstack-neutron
BuildRequires: openstack-suse-macros
BuildRequires: openstack-suse-sudo
BuildRequires: python-devel
BuildRequires: python-pbr
# Test requirements
BuildRequires: python-WebTest
BuildRequires: python-fixtures
BuildRequires: python-mock
BuildRequires: python-neutron-lib
BuildRequires: python-oslo.config
BuildRequires: python-oslotest
BuildRequires: python-python-subunit
BuildRequires: python-requests-mock
BuildRequires: python-testrepository
BuildRequires: python-testscenarios
BuildRequires: python-testtools
# Documentation build requirements:
BuildRequires: python-Sphinx
BuildRequires: python-openstackdocstheme
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
Requires: logrotate
Requires: openstack-neutron
Requires: openstack-suse-sudo
Requires: python >= 2.7
Requires: python-%{component} = %{version}
Requires: python-oslo.concurrency >= 3.26.0
Requires: python-oslo.config >= 5.2.0
Requires: python-oslo.log >= 3.36.0
Requires(pre): pwdutils
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%if 0%{?suse_version}
BuildRequires: systemd-rpm-macros
Requires(pre): pwdutils
%{?systemd_requires}
%else
BuildRequires: systemd
Requires(post): systemd
Requires(postun):systemd
Requires(pre): shadow-utils
Requires(preun):systemd
%endif
%description
Neutron is a virtual network service for Openstack.
Just like OpenStack Nova provides an API to dynamically request and
configure virtual servers, Neutron provides an API to dynamically
request and configure virtual networks. These networks connect
"interfaces" from other OpenStack services (e.g., vNICs from Nova VMs).
The Neutron API supports extensions to provide advanced network
capabilities (e.g., QoS, ACLs, network monitoring, etc)
%package -n python-neutron-vpnaas
Summary: Neutron VPN as a Service - Python module
Group: Development/Languages/Python
Requires: python >= 2.7
Requires: python-Jinja2 >= 2.10
Requires: python-SQLAlchemy >= 1.2.0
Requires: python-WebOb >= 1.7.1
Requires: python-alembic >= 0.8.10
Requires: python-netaddr >= 0.7.18
Requires: python-neutron >= 13.0.0.0~xbeta2
Requires: python-oslo.config >= 5.2.0
Requires: python-oslo.db >= 4.27.0
Requires: python-oslo.messaging >= 5.29.0
Requires: python-oslo.reports >= 1.18.0
Requires: python-oslo.serialization >= 2.18.0
Requires: python-oslo.service >= 1.24.0
Requires: python-oslo.utils >= 3.33.0
Requires: python-pbr >= 2.0.0
Requires: python-requests >= 2.14.2
Requires: python-six >= 1.10.0
%description -n python-neutron-vpnaas
This package contains the core Python module of OpenStack Neutron VPNaaS
%package -n python-neutron-vpnaas-tempest-plugin
Summary: Neutron VPN as a Service - Python module
Group: Development/Languages/Python
Requires: python-neutron-tempest-plugin >= 0.2.0
Requires: python-neutron-vpnaas >= %{version}
%description -n python-neutron-vpnaas-tempest-plugin
This package contains the tests for the core Python module of OpenStack Neutron VPNaaS
%package -n openstack-neutron-vyatta-agent
Summary: Neutron VPN as a Service - Load Balancing Agent for Brocade Vyatta
Group: Development/Languages/Python
PreReq: %name = %version
Requires: haproxy
%description -n openstack-neutron-vyatta-agent
This package provides the Load Balancing as a Service Agent for Brocade Vyatta.
%prep
%setup -q -n neutron-vpnaas-%{version_unconverted}
%openstack_cleanup_prep
%build
python setup.py build
python setup.py build_sphinx -b man
### configuration files
for x in `ls etc/oslo-config-generator/*`; do
PYTHONPATH=. oslo-config-generator --config-file $x
done
%install
python setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot} --install-data=/
### directories
install -d -m 755 %{buildroot}%{_localstatedir}/{lib,log}/neutron
install -d -m 750 %{buildroot}%{_localstatedir}/cache/neutron
install -d -m 700 %{buildroot}%{_rundir}/neutron
install -D -m 644 %{SOURCE2} %{buildroot}/%_tmpfilesdir/%name.conf
### configuration files
# all needed files are installed automatically
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
install -p -D -m 644 etc/neutron_vpnaas.conf.sample %{buildroot}%{_sysconfdir}/neutron/neutron_vpnaas.conf
install -p -D -m 644 etc/vpn_agent.ini.sample %{buildroot}%{_sysconfdir}/neutron/vpn_agent.ini
# Install systemd unit services
mkdir -p %{buildroot}%{_sbindir} %{buildroot}%{_unitdir}
install -p -D -m 444 %{SOURCE11} %{buildroot}%{_unitdir}/openstack-neutron-vyatta-agent.service
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcopenstack-neutron-vyatta-agent
### documentation
install -d %{buildroot}%{_mandir}/man1
install -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1
## SUSE configuration defaults
%define neutron_conf %{buildroot}/etc/neutron/neutron.conf
#crudini --set %{neutron_conf} DEFAULT lock_path /var/run/%component
crudini --set %{buildroot}/etc/neutron/neutron_vpnaas.conf service_providers service_provider VPN:ipsec:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
### misc
%fdupes %{buildroot}%{python_sitelib}/%{component}
%fdupes %{buildroot}%{_bindir}
### authentication cache dir
mkdir -p %{buildroot}%{_localstatedir}/cache/neutron
## %check
## python setup.py testr
%pre
%openstack_pre_user_group_create %{username} %{groupname}
%post
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
%post -n openstack-neutron-vyatta-agent
%systemd_post openstack-neutron-vyatta-agent.service
%preun -n openstack-neutron-vyatta-agent
%systemd_preun openstack-neutron-vyatta-agent.service
%postun -n openstack-neutron-vyatta-agent
%systemd_postun_with_restart openstack-neutron-vyatta-agent.service
%files
%defattr(-,root,root,-)
%doc README.rst
%license LICENSE
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %attr(0755, neutron, neutron) %{_localstatedir}/lib/neutron
%dir %attr(0750, neutron, neutron) %{_localstatedir}/log/neutron
%dir %attr(0750, neutron, neutron) %{_localstatedir}/cache/neutron
%_tmpfilesdir/%name.conf
%config(noreplace) %{_sysconfdir}/neutron/neutron_vpnaas.conf
%config(noreplace) %{_sysconfdir}/neutron/vpn_agent.ini
%config %{_sysconfdir}/neutron/rootwrap.d/vpnaas.filters
%{_mandir}/man1/neutron-vpnaas.1%{?ext_man}
%{_bindir}/neutron-vpn-netns-wrapper
%files -n openstack-neutron-vyatta-agent
%defattr(-,root,root,-)
%license LICENSE
%{_unitdir}/openstack-neutron-vyatta-agent.service
%{_sbindir}/rcopenstack-neutron-vyatta-agent
%files -n python-neutron-vpnaas
%defattr(-,root,root,-)
%license LICENSE
%dir %{python_sitelib}/neutron_vpnaas
%dir %{python_sitelib}/neutron_vpnaas/tests
%exclude %{python_sitelib}/neutron_vpnaas/tests
%{python_sitelib}/neutron_vpnaas/*
%{python_sitelib}/neutron_vpnaas-*.egg-info
%files -n python-neutron-vpnaas-tempest-plugin
%defattr(-,root,root,-)
%license LICENSE
%dir %{python_sitelib}/neutron_vpnaas/tests
%{python_sitelib}/neutron_vpnaas/tests/*
%changelog