File openstack-neutron-opflex-agent.spec of Package openstack-neutron-opflex-agent

# spec file for package openstack-neutron-opflex-agent
# Copyright (c) 2016 SUSE LINUX Products 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

Name:           openstack-neutron-opflex-agent
Version:        2015.2.2
Release:        0
License:        Apache-2.0
Summary:        Neutron agent for OpFlex based policy enforcement
Group:          Development/Languages/Python
Source1:        %name.conf
BuildRequires:  python-devel
BuildRequires:  python-pbr
BuildRequires:  systemd
BuildRequires:  systemd-rpm-macros
BuildRequires:  openstack-neutron
Requires:       ipset
Requires:       python-oslo.serialization >= 1.4.0
Requires:       python-oslo.utils >= 2.0.0
Requires:       python-oslo.i18n >= 2.1.0
Requires:       python-oslo.log >= 1.8.0
Requires:       python-oslo.config >= 2.3.0
Requires:       python-pyinotify
Requires:       openstack-neutron
Requires:       openstack-neutron-openvswitch-agent
Requires:       supervisor
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

Provides edge policy enforcement.

%package test
Summary:        Neutron agent for OpFlex based policy enforcement - Testsuite
Group:          System/Management
Requires:       %{name} = %{version}
Requires:       python-fixtures >= 1.3.1
Requires:       python-mock >= 1.2
Requires:       python-mox >= 0.5.3
Requires:       python-nova
Requires:       python-oslotest >= 1.10.0
Requires:       python-python-subunit >= 0.0.18
Requires:       python-testrepository >= 0.0.18
Requires:       python-testscenarios >= 0.4
Requires:       python-testtools >= 1.4.0
Requires:       python-tempest-lib >= 0.8.0
Requires:       python-cliff >= 1.14.0
Requires:       python-WebTest >= 2.0
Requires:       python-httplib2 >= 0.7.5
Requires:       python-requests-mock >= 0.6.0

%description test
The testsuite for the Neutron agent for OpFlex based policy enforcement.

%setup -q -n neutron-opflex-agent-%{version}

python build

python install --prefix=%{_prefix} --root=%{buildroot}
# systemd service file
# SUSE doesn't have a /usr/share/neutron/neutron-dist.conf so replace the StartExec call
sed -i -e 's!^ExecStart.*!ExecStart=/usr/bin/neutron-opflex-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/openvswitch_agent.ini --log-file /var/log/neutron/opflex-agent.log!' \
install -p -D -m 0644 rpm/neutron-opflex-agent.service \
# rootwrap filter
install -p -D -m 600 etc/gbp-opflex.filters \
install -D -m 644 %{SOURCE1} %{buildroot}/%{_tmpfilesdir}/%{name}.conf

%service_add_pre neutron-opflex-agent.service

%service_add_post neutron-opflex-agent.service
%{_bindir}/systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf

%service_del_preun neutron-opflex-agent.service

%service_del_postun neutron-opflex-agent.service

%doc README.rst
%dir %_tmpfilesdir
%dir %{_sysconfdir}/neutron/
%dir %{_sysconfdir}/neutron/rootwrap.d
# Part of test subpackage
%exclude %{python_sitelib}/opflexagent/test/

%files test
%dir %{python_sitelib}/opflexagent/test

openSUSE Build Service is sponsored by