File python-glanceclient.spec of Package python-glanceclient

#
# spec file for package python-glanceclient
#
# Copyright (c) 2013 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/
#


Name:           python-glanceclient
Version:        2012.1+git.1342772303.71a0cae
Release:        0
Summary:        Openstack Image (Glance) API Client Library
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            https://github.com/openstack/python-glanceclient
Source:         %{name}-%{version}.tar.gz
# Patch-FIX-UPSTREAM: '--insecure' flag should be checked when talking to keystone
Patch0:         honor-insecure-flag-keystone.patch
# Don't specify requires in setup.py
# https://bugs.launchpad.net/python-glanceclient/+bug/1032155
Patch1:         glanceclient-setup-no-requires.patch
# PATCH-FIX-UPSTREAM add-handler-for-logger.patch bnc#780048 vuntz@suse.com -- Remove cryptic "No handlers could be found for logger" error message
Patch2:         add-handler-for-logger.patch
BuildRequires:  python-devel
BuildRequires:  python-distribute
Requires:       python >= 2.6.8
# /usr/bin/glance uses pkg_resources, thus:
Requires:       python-distribute
Requires:       python-httplib2
Requires:       python-keystoneclient
Requires:       python-prettytable
Requires:       python-warlock
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
This is a client for the Glance which uses the OpenStack Image API. There's
a Python API (the glanceclient module), and a command-line script (glance).

%package test

Summary:        Openstack Image (Glance) API Client Library - Testsuite
Group:          System/Management
Requires:       %{name} = %{version}
Requires:       python-mock
Requires:       python-mox
Requires:       python-nose
Requires:       python-unittest2

%description test
The %{name} testsuite.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
sed -i "s/setuptools-git>=0.4//" setup.py # We don't need that

%build
python setup.py build
cd docs && sphinx-build -b html . build/html

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

# test package
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}-test
cp -av tests run_tests.sh %{buildroot}%{_localstatedir}/lib/%{name}-test
ln -s %{python_sitelib}/glanceclient %{buildroot}%{_localstatedir}/lib/%{name}-test/glanceclient

%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%{_bindir}/glance
%{python_sitelib}/glanceclient/
%{python_sitelib}/python_glanceclient-*.egg-info

%files test
%defattr(-,root,root,-)
%doc HACKING.rst
%{_localstatedir}/lib/%{name}-test

%changelog
openSUSE Build Service is sponsored by