File openstack-heat-cfntools.spec of Package openstack-heat-cfntools

#
# spec file for package openstack-heat-cfntools
#
# Copyright (c) 2014 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 http://bugs.opensuse.org/
#


%define component heat_cfntools

Name:           openstack-heat-cfntools
Version:        1.2.3
Release:        0
Summary:        Openstack Orchestration Tools for Clients (Heat)
License:        Apache-2.0
Group:          System/Management
Url:            https://launchpad.net/heat-cfntools
Source:         heat-cfntools-%{version}.tar.gz
Patch0:         0001-Use-testtools-for-better-Python-2.6-compatibility.patch
Patch1:         0001-Use-ordereddict-compatibility-for-Python-2.6.patch
BuildRequires:  fdupes
BuildRequires:  openstack-suse-macros
BuildRequires:  python-base
BuildRequires:  python-distribute >= 0.6.24
# Documentation requirements:
BuildRequires:  python-Sphinx
Requires:       python >= 2.6.8
Requires:       python-%{component} = %version
Requires:       python-boto >= 2.5.2
Requires:       python-psutil
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
heat-cfntools contains the tools that can be installed on Heat
provisioned cloud instances to implement portions of
CloudFormation compatibility.

%package -n python-heat_cfntools
Summary:        Openstack Heat CFNTools - Python module
Group:          Development/Languages/Python

%description -n python-heat_cfntools
This package contains the core Python module of Heat CFNTools

%package test
Summary:        Openstack Heat CFNTools - Testsuite
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
Requires:       python-mox >= 0.5.3
Requires:       python-pep8 >= 1.3.4
Requires:       python-pyflakes
Requires:       python-testrepository >= 0.0.13
Requires:       python-testtools >= 0.9.27

%description test
The OpenStack Heat CFNTools testsuite. It is used to verify the functionality of
OpenStack Heat CFNTools and its components.

%prep
%setup -q -n heat-cfntools-1.2.3
%patch0 -p1
%patch1 -p1

%build
python setup.py build
python setup.py build_sphinx -b man

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

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

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

%files
%defattr(-,root,root)
%doc LICENSE README.rst
%{_bindir}/cfn-create-aws-symlinks
%{_bindir}/cfn-hup
%{_bindir}/cfn-init
%{_bindir}/cfn-push-stats
%{_bindir}/cfn-signal
%{_bindir}/cfn-get-metadata

%files -n python-heat_cfntools
%defattr(-,root,root)
%doc LICENSE
%{python_sitelib}/%{component}/
%{python_sitelib}/%{component}-*.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
openSUSE Build Service is sponsored by