File python-melangeclient.spec of Package python-melangeclient

#
# spec file for package python-melangeclient
#
# Copyright (c) 2012 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-melangeclient
Version:        2012.1+git.1331336458.052b7fe
Release:        0
License:        Apache-2.0
Summary:        Openstack NIS (Melange) API Client Library
Url:            https://github.com/openstack/python-melangeclient
Group:          Development/Languages/Python
Source:         %{name}-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  python-devel
BuildRequires:  python-distribute
Requires:       python-httplib2
Requires:       python-PyYAML
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
Client library for OpenStack Melange API. It contains a Python API (the
melange.client module), and a command-line script (melange).

%package test
Summary:        Openstack NIS (Melange) API Client Library - Testsuite %{vcs_summary_warn}
Summary:        Openstack NIS (Melange) API Client Library - Testsuite %{vcs_summary_warn}
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

%build
python setup.py build

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

# test package
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}-test
cp -av  melange/client/tests %{buildroot}%{_localstatedir}/lib/%{name}-test
ln -s %{python_sitelib}/melange %{buildroot}%{_localstatedir}/lib/%{name}-test/melangeclient
%if 0%{?suse_version}
%fdupes %{buildroot}%{python_sitelib}
%endif

%files
%defattr(-,root,root,-)
%doc README.rst
%{_bindir}/melange
%{python_sitelib}/melange/
%{python_sitelib}/python_melangeclient-*.egg-info
%{python_sitelib}/python_melangeclient-*.pth

%files test
%defattr(-,root,root,-)
%{_localstatedir}/lib/%{name}-test

%changelog
openSUSE Build Service is sponsored by