File openstack-nova-virt-zvm.spec of Package openstack-nova-virt-zvm

#
# spec file for package openstack-nova-virt-zvm
#
# 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 nova-zvm-virt-driver

%define version_unconverted 5.0.0.dev157

Name:           openstack-nova-virt-zvm
Version:        5.0.0~a0~dev157
Release:        0
Summary:        Z/VM Driver for OpenStack Compute (Nova)
License:        EPL-1.0
Group:          System/Management
Url:            https://wiki.openstack.org/wiki/ZVMDriver
Source:         http://tarballs.openstack.org/nova-zvm-virt-driver/nova-zvm-virt-driver-stable-mitaka.tar.gz
BuildRequires:  fdupes
BuildRequires:  openstack-nova
BuildRequires:  openstack-suse-macros
BuildRequires:  python-base
BuildRequires:  python-pbr
BuildRequires:  python-setuptools
Requires:       openstack-nova
Requires:       python >= 2.7
Requires:       python-oslo.concurrency >= 2.3.0
Requires:       python-oslo.config >= 2.7.0
Requires:       python-oslo.log >= 1.12.0
Requires:       python-oslo.serialization >= 1.10.0
Requires:       python-oslo.service >= 1.0.0
Requires:       python-oslo.utils >= 2.8.0
Requires:       python-six >= 1.9.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 driver is a hypervisor driver for Openstack Nova Compute.

%package test
Summary:        Z/VM Driver for OpenStack Compute (Nova) - 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

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

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

%build
python setup.py build

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

mkdir -p  %{buildroot}%{python_sitelib}/nova/virt/zvm
mkdir -p  %{buildroot}%{python_sitelib}/nova/tests/unit/virt/zvm
cp -a nova/virt/zvm %{buildroot}%{python_sitelib}/nova/virt/
cp -a nova/tests/unit/virt/zvm %{buildroot}%{python_sitelib}/nova/tests/unit/virt/

install -m 750 -d %{buildroot}%{_localstatedir}/lib/nova/images/spawn_tmp

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

%files
%defattr(-,root,root,-)
%dir %attr(0750, nova, nova) %{_localstatedir}/lib/nova/images/spawn_tmp
%dir %{python_sitelib}/nova
%dir %{python_sitelib}/nova/virt
%dir %{python_sitelib}/nova/virt/zvm
%{python_sitelib}/nova/virt/zvm/
%{python_sitelib}/nova_zvm*.egg-info
# Part of test subpackage
%exclude %{python_sitelib}/nova/tests/unit/virt/zvm/

%files test
%defattr(-,root,root)
%dir %{python_sitelib}/nova/tests
%dir %{python_sitelib}/nova/tests/unit
%dir %{python_sitelib}/nova/tests/unit/virt
%dir %{python_sitelib}/nova/tests/unit/virt/zvm
%{python_sitelib}/nova/tests/unit/virt/zvm/

%changelog
openSUSE Build Service is sponsored by