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

#
# spec file for package openstack-neutron-zvm-agent
#
# 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-zvm-plugin

Name:           openstack-neutron-zvm-agent
Version:        2015.1.0.dev2
Release:        0
Summary:        Z/VM Driver for OpenStack Compute (Neutron)
License:        EPL-1.0
Group:          System/Management
Url:            https://wiki.openstack.org/wiki/ZVMDriver
Source:         http://tarballs.openstack.org/networking-zvm/networking-zvm-master.tar.gz
Source3:        %name.init
BuildRequires:  fdupes
BuildRequires:  openstack-suse-macros
BuildRequires:  python-base
BuildRequires:  python-pbr
BuildRequires:  python-setuptools
Requires:       python >= 2.7
#dependeny is not upstream..
Requires:       python-neutron
Requires:       python-oslo.config >= 1.9.0
Requires:       python-oslo.log >= 0.1.0
Requires:       python-oslo.serialization >= 1.0.0
Requires:       python-oslo.utils >= 1.0.0
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()")}
%else
BuildArch:      noarch
%endif

%description
The z/VM ML2 Mechanism driver and Neutron z/VM Agent for Openstack Neutron.

%package test
Summary:        Z/VM Driver for OpenStack (Neutron) - Testsuite
Group:          System/Management
Requires:       %{name} = %{version}
Requires:       python-fixtures >= 0.3.14
Requires:       python-mock >= 1.0
Requires:       python-mox >= 0.5.3
Requires:       python-nova
Requires:       python-oslosphinx
Requires:       python-oslotest >= 1.2.0
Requires:       python-python-subunit
Requires:       python-testrepository >= 0.0.17
Requires:       python-testscenarios >= 0.4
Requires:       python-testtools >= 0.9.32

%prep
%setup -q -n %{component}-%{version}
%openstack_cleanup_prep

%description test
The testsuite for the z/VM driver for OpenStack Neutron.

%build
python setup.py build

%install
python setup.py install --root %{buildroot} --prefix %{_prefix}

rm %{buildroot}/usr/etc/rc.d/init.d/neutron-zvm-agent

install -d -m 755 %{buildroot}%{_bindir}/
install -d -m 755 %{buildroot}%{_sysconfdir}/neutron/plugins/zvm/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/plugins/zvm/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/plugins/zvm/agent/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/plugins/zvm/common/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/plugins/drivers/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/plugins/drivers/zvm/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/plugins/ml2/drivers/zvm/
# test
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/tests/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/tests/unit/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/tests/unit/plugins/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/tests/unit/plugins/ml2/
install -d -m 755 %{buildroot}%{python_sitelib}/neutron/tests/unit/plugins/zvm/

install -D -m 755 %{SOURCE3} %{buildroot}%{_initddir}/%{name}
install -d -m 755 %{buildroot}%{_sbindir}/
ln -s ../..%{_initddir}/%{name} %{buildroot}%{_sbindir}/rc%{name}

mv %{buildroot}/usr/etc/neutron/plugins/zvm/neutron_zvm_plugin.ini.sample %{buildroot}%{_sysconfdir}/neutron/plugins/zvm/neutron_zvm_plugin.ini
cp -a neutron/plugins/zvm %{buildroot}%{python_sitelib}/neutron/plugins/
cp -a neutron/plugins/ml2/drivers/zvm %{buildroot}%{python_sitelib}/neutron/plugins/ml2/drivers
# test
cp -a neutron/tests/unit/plugins/zvm %{buildroot}%{python_sitelib}/neutron/tests/unit/plugins/
cp -a neutron/tests/unit/plugins/ml2/zvm %{buildroot}%{python_sitelib}/neutron/tests/unit/plugins/ml2

%fdupes %{buildroot}%{python_sitelib}/neutron_zvm*.egg-info

%files
%defattr(-,root,root,-)
%dir %{_sysconfdir}/neutron
%dir %{_sysconfdir}/neutron/plugins
%dir %{_sysconfdir}/neutron/plugins/zvm
%config(noreplace) %{_sysconfdir}/neutron/plugins/zvm/neutron_zvm_plugin.ini
%{_initddir}/%{name}
%{_bindir}/neutron-zvm-agent
%{_sbindir}/rc%{name}
%dir %{python_sitelib}/neutron
%dir %{python_sitelib}/neutron/plugins
%dir %{python_sitelib}/neutron/plugins/ml2
%dir %{python_sitelib}/neutron/plugins/ml2/drivers
%{python_sitelib}/neutron/plugins/ml2/drivers/zvm
%{python_sitelib}/neutron/plugins/zvm
%{python_sitelib}/neutron_zvm*.egg-info
# Part of test subpackage
%exclude %{python_sitelib}/neutron/tests/unit/plugins

%files test
%defattr(-,root,root)
%dir %{python_sitelib}/neutron/tests
%dir %{python_sitelib}/neutron/tests/unit
%dir %{python_sitelib}/neutron/tests/unit/plugins
%dir %{python_sitelib}/neutron/tests/unit/plugins/ml2
%dir %{python_sitelib}/neutron/tests/unit/plugins/zvm

%changelog
openSUSE Build Service is sponsored by