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

# spec file for package openstack-neutron-gbp
# Copyright (c) 2021 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

%define component gbpservice

%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run

%define version_unconverted 12.0.1.dev26

Name:           openstack-neutron-gbp
Version:        12.0.1~dev26
Release:        0
Summary:        Openstack Group Based Policy
License:        Apache-2.0
Group:          System/Management
BuildRequires:  crudini
BuildRequires:  fdupes
BuildRequires:  openstack-suse-macros
BuildRequires:  python-Sphinx
BuildRequires:  python-devel
BuildRequires:  python-oslosphinx
BuildRequires:  python-pbr
Requires:       python >= 2.6.8
Requires:       python-neutron-gbp = %{version}
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()")}
BuildArch:      noarch
PreReq:         %fillup_prereq

Group Based Policy (GBP) provides declarative abstractions for achieving
scalable intent-based infrastructure automation.
GBP complements the OpenStack networking model with the notion of policies
that can be applied between groups of network endpoints. As users look beyond
basic connectivity, richer network services with diverse implementations and
network properties are naturally expressed as policies. Examples include
service chaining, QoS, path properties, access control, etc.

%package -n     python-neutron-gbp
Summary:        OpenStack Group Based Policy - Python module
Group:          Development/Languages/Python
Requires:       python >= 2.6.8
Requires:       python-httplib2 >= 0.9.1
Requires:       python-pbr >= 4.0.0

%description -n python-neutron-gbp
This package contains the core Python module of Group Based Policy (GBP)

%package test
Summary:        OpenStack Group Based Policy - Testsuite
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
Requires:       openstack-tempest
Requires:       python-WebTest >= 2.0.27
Requires:       python-cliff >= 2.8.0
Requires:       python-ddt >= 1.0.1
Requires:       python-fixtures >= 3.0.0
Requires:       python-mock >= 2.0
Requires:       python-os-testr >= 1.0.0
Requires:       python-oslotest >= 3.2.0
Requires:       python-python-subunit >= 1.0.0
Requires:       python-reno >= 2.5.0
Requires:       python-requests-mock >= 1.1
Requires:       python-testrepository >= 0.0.18
Requires:       python-testresources >= 2.0.0
Requires:       python-testscenarios >= 0.4
Requires:       python-testtools >= 2.2.0

%description test
OpenStack Group Based Policy - Testsuite

%setup -q -n group-based-policy-%{version_unconverted}

python build
python build_sphinx -b man
#tools/config/ -p gbpservice

python install --skip-build --prefix=%{_prefix} --root=%{buildroot} --install-data=/

# move configfiles into the probper location
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron
mv %{buildroot}%{_sysconfdir}/group-based-policy %{buildroot}%{_sysconfdir}/neutron/

### test subpackage
%fdupes %{buildroot}%{_localstatedir}/lib/%{name}-test

### misc
%fdupes %{buildroot}%{python_sitelib}/%{component}
%fdupes %{buildroot}%{_bindir}

%dir %{_sysconfdir}/neutron
%dir %{_sysconfdir}/neutron/group-based-policy
%dir %{_sysconfdir}/neutron/group-based-policy/policy.d/
%config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/neutron/group-based-policy/*.ini
%config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/neutron/group-based-policy/policy.d/policy.json
%dir %{_sysconfdir}/neutron/group-based-policy/drivers
%config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/neutron/group-based-policy/drivers/*.ini
%config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/*.ini

%files -n python-neutron-gbp
# Part of test subpackage
%exclude %{python_sitelib}/%{component}/tests/

%files test

openSUSE Build Service is sponsored by