File openstack-neutron-fwaas.spec of Package openstack-neutron-fwaas

#
# spec file for package openstack-neutron-fwaas
#
# Copyright (c) 2019 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 https://bugs.opensuse.org/
#


%define component neutron-fwaas

%define version_unconverted 13.0.2.dev14

Name:           openstack-%{component}
Version:        13.0.2~dev14
Release:        0
Summary:        OpenStack Network - firewall as a service
License:        Apache-2.0
Group:          System/Management
Url:            https://launchpad.net/neutron
Source:         http://tarballs.openstack.org/%{component}/%{component}-stable-rocky.tar.gz
Source99:       rpmlintrc
BuildRequires:  crudini
BuildRequires:  fdupes
BuildRequires:  openstack-neutron
BuildRequires:  openstack-suse-macros
BuildRequires:  python-devel
BuildRequires:  python-pbr
# Documentation build requirements:
BuildRequires:  python-Sphinx
BuildRequires:  python-oslosphinx
# Test requirements
BuildRequires:  python-WebTest >= 2.0
BuildRequires:  python-cliff >= 1.10.0
BuildRequires:  python-fixtures >= 0.3.14
BuildRequires:  python-mock >= 1.0
BuildRequires:  python-neutron-lib
BuildRequires:  python-openstackdocstheme
BuildRequires:  python-oslo.config
BuildRequires:  python-oslotest >= 1.5.1
BuildRequires:  python-psycopg2
BuildRequires:  python-python-subunit >= 0.0.18
BuildRequires:  python-requests-mock >= 0.6.0
BuildRequires:  python-testrepository >= 0.0.18
BuildRequires:  python-testscenarios >= 0.4
BuildRequires:  python-testtools >= 0.9.36
Requires:       openstack-neutron
Requires:       python
Requires:       python >= 2.7
Requires:       python-neutron-fwaas = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%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)

This package contains the firewall as as service (fwaas) component for Neutron.

%package -n python-%{component}
Summary:        OpenStack Network fwaas - Python module
Group:          Development/Languages/Python
Requires:       python >= 2.7
Requires:       python-SQLAlchemy >= 1.0.10
Requires:       python-alembic >= 0.8.10
Requires:       python-eventlet >= 0.18.2
Requires:       python-httplib2 >= 0.7.5
Requires:       python-netaddr >= 0.7.18
Requires:       python-neutron-lib >= 1.18.0
Requires:       python-oslo.concurrency >= 3.26.0
Requires:       python-oslo.config >= 5.2.0
Requires:       python-oslo.db >= 4.27.0
Requires:       python-oslo.log >= 3.36.0
Requires:       python-oslo.messaging >= 5.29.0
Requires:       python-oslo.privsep >= 1.23.0
Requires:       python-oslo.serialization >= 1.10.0
Requires:       python-oslo.service >= 1.24.0
Requires:       python-oslo.utils >= 3.33.0
Requires:       python-pbr >= 2.0.0
Requires:       python-pyroute2 >= 0.4.21
Requires:       python-six >= 1.10.0

%description -n python-%{component}
This package contains the core Python module of OpenStack Neutron fwaas


%package test
Summary:        OpenStack Network fwaas - Testsuite
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
Requires:       python-WebOb >= 1.7.1
Requires:       python-testresources >= 2.0.0

%description test
The OpenStack Neutron fwaas testsuite. It is used to verify the functionality
of OpenStack Neutron.


%prep
%setup -q -n %{component}-%{version_unconverted}

%openstack_cleanup_prep

%build
python setup.py build
#python setup.py build_sphinx -b man

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=/

### configuration files
install -p -D -m 644 etc/fwaas_driver.ini.sample %{buildroot}%{_sysconfdir}/neutron/fwaas_driver.ini

## SUSE configuration defaults
crudini --set %{buildroot}/etc/neutron/fwaas_driver.ini fwaas driver neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver
crudini --set %{buildroot}/etc/neutron/fwaas_driver.ini fwaas enabled True

### misc
%fdupes %{buildroot}%{python_sitelib}/neutron_fwaas

%check
testr init
###
#testr list-tests

%files
%defattr(-,root,root,-)
%doc README.rst
%license LICENSE
%config(noreplace) %{_sysconfdir}/neutron/fwaas_driver.ini
%config(noreplace) %{_sysconfdir}/neutron/rootwrap.d/fwaas-privsep.filters

%files -n python-%{component}
%defattr(-,root,root,-)
%license LICENSE
%{python_sitelib}/neutron_fwaas/
%{python_sitelib}/*.egg-info
%{python_sitelib}/neutron_fwaas/tests/tempest_plugin
# tempest test must be in python-neutron (because of entry point)
%exclude %{python_sitelib}/neutron_fwaas/tests/contrib
%exclude %{python_sitelib}/neutron_fwaas/tests/etc
%exclude %{python_sitelib}/neutron_fwaas/tests/fullstack
%exclude %{python_sitelib}/neutron_fwaas/tests/functional
%exclude %{python_sitelib}/neutron_fwaas/tests/unit

%files test
%defattr(-,root,root,-)
%license LICENSE
%exclude %{python_sitelib}/neutron_fwaas/tests/tempest_plugin
%{python_sitelib}/neutron_fwaas/tests/contrib
%{python_sitelib}/neutron_fwaas/tests/etc
%{python_sitelib}/neutron_fwaas/tests/fullstack
%{python_sitelib}/neutron_fwaas/tests/functional
%{python_sitelib}/neutron_fwaas/tests/unit

%changelog
openSUSE Build Service is sponsored by