File openstack-neutron-gbp.spec of Package openstack-neutron-gbp
#
# spec file for package openstack-neutron-gbp
#
# Copyright (c) 2016 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 gbpservice
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
%define version_unconverted 2015.2.7
Name: openstack-neutron-gbp
Version: 2015.2.7
Release: 0
Summary: Openstack Group Based Policy
License: Apache-2.0
Group: System/Management
Url: https://launchpad.net/group-based-policy
# NOTE(rhafer): source tarball generated from git checkout of
# https://github.com/noironetworks/group-base-policy/
# using python setup.py sdist
Source: group-based-policy-%{version}.tar.gz
BuildRequires: crudini
BuildRequires: fdupes
BuildRequires: openstack-suse-macros
BuildRequires: python-devel
BuildRequires: python-pbr
BuildRequires: python-Sphinx
BuildRequires: python-oslosphinx
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()")}
%py_requires
%else
BuildArch: noarch
%endif
PreReq: %fillup_prereq
%description
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.7.5
Requires: python-pbr >= 1.6
%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: python-tempest-lib >= 0.8.0
Requires: python-reno >= 0.1.1
Requires: python-oslotest >= 1.10.0
Requires: python-testresources >= 0.2.4
Requires: python-os-testr >= 0.1.0
Requires: python-cliff >= 1.14.0
Requires: python-testscenarios >= 0.4
Requires: python-testrepository >= 0.0.18
Requires: python-fixtures >= 1.3.1
Requires: python-WebTest >= 2.0
Requires: python-python-subunit >= 0.0.18
Requires: python-testtools >= 1.4.0
Requires: python-requests-mock >= 0.6.0
Requires: python-ddt >= 0.7.0
Requires: python-mock >= 1.2
%description test
OpenStack Group Based Policy - Testsuite
%prep
%setup -q -n group-based-policy-%{version_unconverted}
%openstack_cleanup_prep
%build
python setup.py build
python setup.py build_sphinx -b man
#tools/config/generate_sample.sh -p gbpservice
%install
python setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot} --install-data=/
# move configfiles into the probper location
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron/group-based-policy
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron/group-based-policy/policy.d
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron/servicechain
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron/servicechain/plugins
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron/servicechain/plugins/msc
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron/group-based-policy/drivers
mv %{buildroot}%{_sysconfdir}/group-based-policy/drivers/*.ini %{buildroot}%{_sysconfdir}/neutron/group-based-policy/drivers/
mv %{buildroot}%{_sysconfdir}/servicechain/plugins/msc/*.ini %{buildroot}%{_sysconfdir}/neutron/servicechain/plugins/msc/
mv %{buildroot}%{_sysconfdir}/group-based-policy/policy.d/policy.json %{buildroot}%{_sysconfdir}/neutron/group-based-policy/policy.d/
mv %{buildroot}%{_sysconfdir}/group-based-policy/grouppolicy.ini %{buildroot}%{_sysconfdir}/neutron/group-based-policy/
### test subpackage
%openstack_test_package_install
%fdupes %{buildroot}%{_localstatedir}/lib/%{name}-test
### misc
%fdupes %{buildroot}%{python_sitelib}/%{component}
%fdupes %{buildroot}%{_bindir}
%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%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
%dir %{_sysconfdir}/neutron/servicechain
%dir %{_sysconfdir}/neutron/servicechain/plugins
%dir %{_sysconfdir}/neutron/servicechain/plugins/msc
%config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/neutron/servicechain/plugins/msc/*.ini
%dir %{_sysconfdir}/nfp
%config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/nfp/*.ini
%{_bindir}/gbp-db-manage
%{_bindir}/nfp
%{_bindir}/nfp_proxy
%files -n python-neutron-gbp
%defattr(-,root,root,-)
%doc LICENSE
%{python_sitelib}/%{component}/
%{python_sitelib}/group_based_policy-*.egg-info
# Part of test subpackage
%exclude %{python_sitelib}/%{component}/tests/
%files test
%defattr(-,root,root)
%{python_sitelib}/%{component}/tests/
%{_localstatedir}/lib/%{name}-test/
%changelog