File python-manilaclient.spec of Package python-manilaclient

#
# spec file for package python-manilaclient
#
# 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 manilaclient

%define version_unconverted 1.5.0

Name:           python-%{component}
Version:        1.5.0
Release:        0
Summary:        Openstack shared file system service (Manila) API Client
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            http://launchpad.net/python-manilaclient
Source:         http://tarballs.openstack.org/python-manilaclient/python-manilaclient-%{version}.tar.gz
Patch0:         0001-Keep-using-the-session-we-had-when-creating-keystone.patch
Patch1:         0001-Fix-functional-tests-to-respect-insecure-SSL-option.patch
BuildRequires:  openstack-suse-macros
BuildRequires:  python-devel
BuildRequires:  python-oslosphinx
BuildRequires:  python-pbr
# Documentation build requirements:
BuildRequires:  python-PrettyTable
BuildRequires:  python-Sphinx
BuildRequires:  python-keystoneclient
BuildRequires:  python-oslo.serialization
BuildRequires:  python-oslo.utils
BuildRequires:  python-oslo.log
BuildRequires:  python-requests
Requires:       python >= 2.6.8
Requires:       python-Babel >= 1.3
Requires:       python-PrettyTable >= 0.7
Requires:       python-iso8601 >= 0.1.9
Requires:       python-keystoneclient >= 1.6.0
Requires:       python-openstackclient >= 1.5.0
Requires:       python-oslo.config >= 2.3.0
Requires:       python-oslo.log >= 1.8.0
Requires:       python-oslo.serialization >= 1.4.0
Requires:       python-oslo.utils >= 2.0.0
Requires:       python-pbr >= 1.6
Requires:       python-pycrypto >= 2.6
Requires:       python-requests >= 2.5.2
Requires:       python-simplejson >= 2.2.0
Requires:       python-six >= 1.9.0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       python-argparse
BuildArch:      noarch

%description
This is a client for the OpenStack shared file system service API (Manila).

%package doc
Summary:        Openstack shared file system service (Manila) - Documentation
Group:          Documentation/HTML
Requires:       %{name} = %{version}

%description doc
This package contains documentation files for %{name}.

%package test
Summary:        Openstack shared file system service (Manila) - Testsuite
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
%if 0%{?suse_version} <= 1110
Requires:       python-discover
Requires:       python-ordereddict
%endif
Requires:       python-ddt >= 0.7.0
Requires:       python-fixtures >= 1.3.1
Requires:       python-mock >= 1.2
Requires:       python-tempest-lib >= 0.9.0
Requires:       python-testrepository >= 0.0.18
Requires:       python-testtools >= 1.4.0

%description test
This package contains testsuite files for %{name}.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%openstack_cleanup_prep
echo %{version} > manilaclient/versioninfo

%build
python setup.py build
python setup.py build_sphinx

# generate sample config file
PYTHONPATH=. oslo-config-generator --config-file etc/oslo-config-generator/manilaclient.conf --output-file etc/manilaclient.conf.sample

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

### install configuration file
install -p -D -m 644 etc/manilaclient.conf.sample %{buildroot}%{_sysconfdir}/manilaclient/manilaclient.conf

rm doc/build/html/.buildinfo

### bash-completion
install -p -D -m 644 tools/manila.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/openstack-manila.sh

### test subpackage
%openstack_test_package_install

%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%{_sysconfdir}/bash_completion.d/openstack-manila.sh
%dir %{_sysconfdir}/manilaclient
%config(noreplace) %attr(0640, root, root) %{_sysconfdir}/manilaclient/manilaclient.conf
%{_bindir}/manila
%{python_sitelib}/%{component}/
%{python_sitelib}/python_%{component}-*.egg-info
%exclude %{python_sitelib}/%{component}/tests/

%files doc
%defattr(-,root,root,-)
%doc LICENSE doc/build/html

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

%changelog
openSUSE Build Service is sponsored by