File openstack-neutron-vpnaas.spec of Package openstack-neutron-vpnaas
#
# spec file for package openstack-neutron-vpnaas
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
%define component neutron-vpnaas
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
%if 0%{?suse_version} > 1230 || 0%{?rhel} > 6
%define using_systemd 1
%else
%define using_systemd 0
%endif
%define version_unconverted 7.1.3.dev3
Name: openstack-neutron-vpnaas
Version: 7.1.3~a0~dev3
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-liberty.tar.gz
Source1: openstack-neutron-vpnaas.init
Source2: %{name}.logrotate
# PATCH-FIX-UPSTREAM 0001-Use-strongswan-piddir-when-bind-mount-the-run-dir.patch -- https://review.openstack.org/#/c/321601/
Patch1: 0001-Use-strongswan-piddir-when-bind-mount-the-run-dir.patch
# PATCH-FIX-UPSTREAM 0001-Copy-remove-the-strongswan.d-config-as-root.patch -- https://review.openstack.org/#/c/322743/
Patch2: 0001-Copy-remove-the-strongswan.d-config-as-root.patch
%if 0%{?using_systemd}
Source10: %name.conf
BuildRequires: systemd
%endif
Source90: systemd-override.conf
Source99: rpmlintrc
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-discover
BuildRequires: python-fixtures
BuildRequires: python-mock
BuildRequires: python-oslotest
BuildRequires: python-python-subunit
BuildRequires: python-requests-mock
BuildRequires: python-tempest-lib
BuildRequires: python-testrepository
BuildRequires: python-testscenarios
BuildRequires: python-testtools
# Documentation build requirements:
BuildRequires: python-Sphinx
BuildRequires: python-oslosphinx
Requires: logrotate
Requires: openstack-neutron
Requires: openstack-suse-sudo
Requires: python >= 2.7
Requires: python-%{component} = %{version}
Requires: python-oslo.concurrency >= 2.3.0
Requires: python-oslo.config >= 2.3.0
Requires: python-oslo.log >= 1.8.0
%if 0%{?suse_version}
Requires(pre): pwdutils
%else
Requires(pre): /usr/bin/getent /usr/sbin/useradd /usr/sbin/userdel /usr/sbin/groupadd /usr/sbin/groupdel
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%py_requires
%else
BuildArch: noarch
%endif
PreReq: %fillup_prereq
%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.6.8
Requires: python-Jinja2 >= 2.6
Requires: python-SQLAlchemy >= 0.9.9
Requires: python-WebOb >= 1.2.3
Requires: python-alembic >= 0.8.0
Requires: python-netaddr >= 0.7.12
Requires: python-oslo.config >= 2.3.0
Requires: python-oslo.db >= 2.4.1
Requires: python-oslo.messaging >= 1.16.0
Requires: python-oslo.serialization >= 1.4.0
Requires: python-oslo.utils >= 2.0.0
Requires: python-pbr >= 1.6
Requires: python-requests >= 2.5.2
Requires: python-six >= 1.9.0
Requires: python-oslo.service >= 0.7.0
Requires: python-neutron
# Split-provides for upgrading from pre-liberty releases
# For upgrades from SLE11:
Provides: python-neutron:/%{_libdir}/python2.6/site-packages/neutron/services/vpn/plugin.py
# And for openSUSE/SLE12:
Provides: python-neutron:/usr/lib/python2.7/site-packages/neutron/services/vpn/plugin.py
%description -n python-neutron-vpnaas
This package contains the core Python module of OpenStack Neutron LBaaS
%package -n openstack-neutron-vpn-agent
Summary: Neutron VPN as a Service - Load Balancing Agent
Group: Development/Languages/Python
PreReq: %name = %version
Requires: haproxy
%description -n openstack-neutron-vpn-agent
This package provides the Load Balancing as a Service Agent.
%prep
%setup -q -n neutron-vpnaas-%{version_unconverted}
%patch1 -p1
%patch2 -p1
%openstack_cleanup_prep
%build
python setup.py build
python setup.py build_sphinx -b man
%check
testr init
#testr list-tests
%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/
%if 0%{?using_systemd}
install -D -m 644 %{SOURCE10} %{buildroot}/%_tmpfilesdir/%name.conf
%endif
### configuration files
# all needed files are installed automatically
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron/
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
### init scripts
install -p -D -m 755 %{SOURCE1} %{buildroot}%{_initddir}/openstack-neutron-vpn-agent
mkdir -p %{buildroot}%{_sbindir}
ln -s ../..%{_initddir}/openstack-neutron-vpn-agent %{buildroot}%{_sbindir}/rcopenstack-neutron-vpn-agent
# systemd overrides
install -D -m 644 %{SOURCE90} %{buildroot}%{_unitdir}/openstack-neutron-vpn-agent.service.d/custom.conf
### 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
### misc
%fdupes %{buildroot}%{python_sitelib}/%{component}
%fdupes %{buildroot}%{_bindir}
### authentication cache dir
mkdir -p %{buildroot}%{_localstatedir}/cache/neutron/
%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %{_sysconfdir}/neutron
%dir %attr(0755, neutron , neutron) %{_localstatedir}/lib/neutron/
%dir %attr(0750, neutron, neutron) %{_localstatedir}/log/neutron/
%dir %attr(0750, neutron, neutron) %{_localstatedir}/cache/neutron/
%if 0%{?using_systemd}
%_tmpfilesdir/%name.conf
%else
%dir %attr(0700, neutron, neutron) %{_rundir}/neutron
%endif
%config(noreplace) %{_sysconfdir}/neutron/neutron_vpnaas.conf
%{_mandir}/man1/neutron-vpnaas.1%{?ext_man}
%files -n openstack-neutron-vpn-agent
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/neutron-vpn-agent
%{_bindir}/neutron-vpn-netns-wrapper
%config(noreplace) %{_sysconfdir}/neutron/vpn_agent.ini
%config %{_sysconfdir}/neutron/rootwrap.d/vpnaas.filters
%{_initddir}/openstack-neutron-vpn-agent
%{_sbindir}/rcopenstack-neutron-vpn-agent
%dir %{_unitdir}/openstack-neutron-vpn-agent.service.d/
%{_unitdir}/openstack-neutron-vpn-agent.service.d/custom.conf
%files -n python-neutron-vpnaas
%defattr(-,root,root,-)
%doc LICENSE
%{python_sitelib}/neutron_vpnaas/
%{python_sitelib}/neutron_vpnaas-*.egg-info
%changelog