File python-designateclient.spec of Package python-designateclient
#
# spec file for package python-designateclient
#
# Copyright (c) 2018 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/
#
%if 0%{?suse_version} >= 1500
%define pyth python3
%define py_sitelib %{python3_sitelib}
%define py_build %{py3_build}
%define py_install %{py3_install}
%else
%define pyth python
%define py_sitelib %{python2_sitelib}
%define py_build %{py2_build}
%define py_install %{py2_install}
%endif
%global sname python-designateclient
Name: %{pyth}-designateclient
Version: 2.9.0
Release: 0
Summary: OpenStack DNS as a Service - Client
License: Apache-2.0
Group: Documentation
Url: https://launchpad.net/%{sname}
Source0: https://pypi.io/packages/source/p/%{sname}/%{sname}-%{version}.tar.gz
Patch0: tolerate-warn.diff
Patch1: downlevel-req.diff
BuildRequires: %{pyth}-devel
BuildRequires: %{pyth}-jsonschema >= 2.0.0
BuildRequires: %{pyth}-keystoneclient >= 2.0.0
BuildRequires: %{pyth}-mock >= 2.0
BuildRequires: %{pyth}-mox3
BuildRequires: %{pyth}-oslotest >= 1.10.0
BuildRequires: %{pyth}-pbr >= 1.6
BuildRequires: %{pyth}-python-subunit >= 0.0.18
BuildRequires: %{pyth}-requests-mock >= 1.0
BuildRequires: %{pyth}-setuptools >= 16.0
BuildRequires: %{pyth}-testrepository >= 0.0.18
BuildRequires: %{pyth}-oslo.utils >= 3.16.0
BuildRequires: %{pyth}-osc-lib >= 0.4.0
BuildRequires: openstack-macros
BuildRequires: %{pyth}-Sphinx
BuildRequires: %{pyth}-oslosphinx >= 2.5.0
BuildRequires: %{pyth}-openstackdocstheme
BuildRequires: %{pyth}-dogpile-cache >= 0.6.2
Requires: %{pyth}-cliff >= 1.15.0
Requires: %{pyth}-debtcollector >= 1.2.0
Requires: %{pyth}-jsonschema >= 2.0.0
Requires: %{pyth}-keystoneauth1 >= 2.10.0
Requires: %{pyth}-keystoneclient >= 2.0.0
Requires: %{pyth}-osc-lib >= 0.4.0
Requires: %{pyth}-oslo.utils >= 3.16.0
Requires: %{pyth}-requests >= 2.10.0
Requires: %{pyth}-six >= 1.9.0
Requires: %{pyth}-stevedore >= 1.16.0
BuildArch: noarch
%description
OpenStack DNS as a Service - Client
%package doc
Summary: Documentation for the OpenStack DNS as a Service - Client
Group: Documentation
%description doc
Documentation for the OpenStack DNS as a Service - Client.
%prep
%setup -q -n %{sname}-%{version}
%patch0 -p1
%patch1 -p1
%if 0%{?suse_version} < 1500
sed -i 's/^warning-is-error/#warning-is-error/' setup.cfg
%endif
%build
%py_build
# generate html docs
%{pyth} setup.py build_sphinx
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
%install
%py_install
%if 0%{?suse_version} < 1500
#man pages
install -d %{buildroot}%{_mandir}/man1/
install -p -D -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1/
%check
%{pyth} setup.py testr
%endif
%files
%license LICENSE
%doc README.rst ChangeLog
%{py_sitelib}/designateclient
%{py_sitelib}/python_designateclient-%{version}-py?.?.egg-info
%{_bindir}/designate
%if 0%{?suse_version} < 1500
%{_mandir}/man1/*
%endif
%files doc
%license LICENSE
%doc doc/build/html
%changelog