From d7d174de5c7444c8b7b0bfb1d090b220a1e75f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominika=20Krej=C4=8D=C3=AD?= Date: Wed, 16 Nov 2016 14:40:27 +0100 Subject: [PATCH] Add python3 subpackage Include the upstream demos Include the egg metadata files Don't duplicate documentation Don't package the test suite Modernize SPEC --- python-libcloud.spec | 83 ++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 22 deletions(-) diff --git a/python-libcloud.spec b/python-libcloud.spec index 200940f..6b2f420 100644 --- a/python-libcloud.spec +++ b/python-libcloud.spec @@ -1,48 +1,87 @@ -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} - %global tarball_name apache-libcloud +%global srcname libcloud +%global eggname apache_libcloud +%global _description \ +libcloud is a client library for interacting with many of \ +the popular cloud server providers. It was created to make \ +it easy for developers to build products that work between \ +any of the services that it supports. + +# Don't duplicate the same documentation +%global _docdir_fmt %{name} Name: python-libcloud Version: 1.3.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Python library to address multiple cloud provider APIs Group: Development/Languages License: ASL 2.0 URL: http://libcloud.apache.org/ -Source0: http://pypi.python.org/packages/source/a/apache-libcloud/%{tarball_name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Source0: https://files.pythonhosted.org/packages/source/a/%{tarball_name}/%{tarball_name}-%{version}.tar.gz BuildArch: noarch -BuildRequires: python-setuptools +%description %{_description} +%package -n python2-%{srcname} +Summary: %{summary} BuildRequires: python2-devel +BuildRequires: python2-setuptools +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} %{_description} +Python 2 version. -%description -libcloud is a client library for interacting with many of the popular cloud -server providers. It was created to make it easy for developers to build -products that work between any of the services that it supports. +%package -n python3-%{srcname} +Summary: %{summary} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} %{_description} +Python 3 version. %prep -%setup -qn %{tarball_name}-%{version} +%autosetup -n %{tarball_name}-%{version} -%build -%{__python} setup.py build +# Delete shebang lines in the demos +sed -i '1d' demos/gce_demo.py demos/compute_demo.py -%install -rm -rf %{buildroot} -%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%build +%py2_build +%py3_build -%clean -rm -rf %{buildroot} +# Fix permissions for demos +chmod -x demos/gce_demo.py demos/compute_demo.py -%files -%defattr(-,root,root,-) -%doc LICENSE README.rst -%{python_sitelib}/* +%install +%py2_install +%py3_install + +# Don't package the test suite. We dont run it anyway +# because it requires some valid cloud credentials +rm -r $RPM_BUILD_ROOT%{python2_sitelib}/%{srcname}/test +rm -r $RPM_BUILD_ROOT%{python3_sitelib}/%{srcname}/test + +%files -n python2-%{srcname} +%doc README.rst demos/ +%license LICENSE +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{eggname}-*.egg-info/ + +%files -n python3-%{srcname} +%doc README.rst demos/ +%license LICENSE +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{eggname}-*.egg-info/ %changelog +* Wed Nov 16 2016 Dominika Krejci - 1.3.0-2 +- Add python3 subpackage +- Include the upstream demos +- Don't package the test suite + * Mon Oct 24 2016 Daniel Bruno - 1.3.0-1 - Python Libcloud 1.3.0 release