From 875bd77bcac420bb95877030968de4868fad9e26 Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Jul 27 2016 00:54:13 +0000 Subject: Added py2 and py3 subpackage Change-Id: Ica27756217a3e6a9801e74bf30c89eb114063564 Co-Authored-By: Haikel Guemar (cherry picked from commit d89c09e5b101cd5c548f99ffaac5ba995d147721) (cherry picked from commit 909b1cae4bd4eaa8be6e76d8d24cdbc157cbd758) --- diff --git a/python-heatclient.spec b/python-heatclient.spec index 2489d5d..44c130b 100644 --- a/python-heatclient.spec +++ b/python-heatclient.spec @@ -1,27 +1,39 @@ +%{!?upstream_version: %global upstream_version %{version}%{?milestone}} + +%global sname heatclient + +%if 0%{?fedora} +%global with_python3 1 +%endif + Name: python-heatclient Version: 0.8.0 Release: 3%{?dist} Summary: Python API and CLI for OpenStack Heat -Group: Development/Languages License: ASL 2.0 -URL: http://pypi.python.org/pypi/python-heatclient -Source0: http://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz +URL: https://launchpad.net/python-heatclientclient +Source0: https://pypi.io/packages/source/p/%{name}/%{name}-%{version}.tar.gz BuildArch: noarch +%description +This is a client for the OpenStack Heat API. There's a Python API (the +heatclient module), and a command-line script (heat). Each implements 100% of +the OpenStack Heat API. + +%package -n python2-%{sname} +Summary: Python API and CLI for OpenStack Heat +%{?python_provide:%python_provide python2-heatclient} BuildRequires: python2-devel BuildRequires: python-setuptools -BuildRequires: python-d2to1 BuildRequires: python-pbr -Requires: python-argparse -Requires: python-httplib2 +Requires: python-babel +Requires: python-cliff Requires: python-iso8601 -Requires: python-keystoneclient -Requires: python-oslo-i18n -Requires: python-oslo-serialization -Requires: python-oslo-utils +Requires: python-keystoneauth1 +Requires: python-osc-lib Requires: python-prettytable Requires: python-pbr Requires: python-six @@ -29,22 +41,53 @@ Requires: python-swiftclient Requires: python-oslo-serialization Requires: python-oslo-utils Requires: python-oslo-i18n +Requires: python-keystoneclient +Requires: python-swiftclient +Requires: python-requests Requires: PyYAML Requires: python-babel -%description +%description -n python2-%{sname} +This is a client for the OpenStack Heat API. There's a Python API (the +heatclient module), and a command-line script (heat). Each implements 100% of +the OpenStack Heat API. + +%if 0%{?with_python3} +%package -n python3-%{sname} +Summary: Python API and CLI for OpenStack Heat +%{?python_provide:%python_provide python3-heatclient} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pbr + +Requires: python3-babel +Requires: python3-cliff +Requires: python3-iso8601 +Requires: python3-keystoneauth1 +Requires: python3-osc-lib +Requires: python3-prettytable +Requires: python3-pbr +Requires: python3-six +Requires: python3-oslo-serialization +Requires: python3-oslo-utils +Requires: python3-oslo-i18n +Requires: python3-keystoneclient +Requires: python3-swiftclient +Requires: python3-requests +Requires: python3-PyYAML + +%description -n python3-%{sname} This is a client for the OpenStack Heat API. There's a Python API (the heatclient module), and a command-line script (heat). Each implements 100% of the OpenStack Heat API. +%endif %package doc Summary: Documentation for OpenStack Heat API Client -Group: Documentation BuildRequires: python-sphinx BuildRequires: python-oslo-sphinx -BuildRequires: git %description doc This is a client for the OpenStack Heat API. There's a Python API (the @@ -56,39 +99,76 @@ This package contains auto-generated documentation. %prep %setup -q -# Remove the requirements file so that pbr hooks don't add it -# to distutils requires_dist config. rm -rf {test-,}requirements.txt tools/{pip,test}-requires + %build -%{__python2} setup.py build +%py2_build +%if 0%{?with_python3} +%py3_build +%endif %install -%{__python2} setup.py install -O1 --skip-build --root %{buildroot} +%if 0%{?with_python3} +%py3_install +echo "%{version}" > %{buildroot}%{python3_sitelib}/heatclient/versioninfo +mv %{buildroot}%{_bindir}/heat %{buildroot}%{_bindir}/heat-%{python3_version} +ln -s ./heat-%{python3_version} %{buildroot}%{_bindir}/heat-3 +# Delete tests +rm -fr %{buildroot}%{python3_sitelib}/heatclient/tests +%endif + +%py2_install echo "%{version}" > %{buildroot}%{python2_sitelib}/heatclient/versioninfo +mv %{buildroot}%{_bindir}/heat %{buildroot}%{_bindir}/heat-%{python2_version} +ln -s ./heat-%{python2_version} %{buildroot}%{_bindir}/heat-2 -# Install bash completion scripts -mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ -install -m 644 -T tools/heat.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/python-heatclient +ln -s ./heat-2 %{buildroot}%{_bindir}/heat + +mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d +install -pm 644 tools/heat.bash_completion \ + %{buildroot}%{_sysconfdir}/bash_completion.d/heat # Delete tests rm -fr %{buildroot}%{python2_sitelib}/heatclient/tests + export PYTHONPATH="$( pwd ):$PYTHONPATH" sphinx-build -b html doc/source html +# generate man page +sphinx-build -b man doc/source man +install -p -D -m 644 man/heat.1 %{buildroot}%{_mandir}/man1/heat.1 + # Fix hidden-file-or-dir warnings rm -fr html/.doctrees html/.buildinfo -%files -%doc LICENSE README.rst -%{_bindir}/heat +%files -n python2-%{sname} +%doc README.rst +%license LICENSE %{python2_sitelib}/heatclient %{python2_sitelib}/*.egg-info -%{_sysconfdir}/bash_completion.d/python-heatclient +%{_sysconfdir}/bash_completion.d +%{_mandir}/man1/heat.1.gz +%{_bindir}/heat +%{_bindir}/heat-2 +%{_bindir}/heat-%{python2_version} + +%if 0%{?with_python3} +%files -n python3-%{sname} +%license LICENSE +%doc README.rst +%{python3_sitelib}/%{sname} +%{python3_sitelib}/*.egg-info +%{_sysconfdir}/bash_completion.d +%{_mandir}/man1/heat.1.gz +%{_bindir}/heat-3 +%{_bindir}/heat-%{python3_version} +%endif %files doc %doc html +%license LICENSE %changelog * Tue Jul 19 2016 Fedora Release Engineering - 0.8.0-3