Add python3 subpackage

Include the upstream demos
Include the egg metadata files
Don't duplicate documentation
Don't package the test suite
Modernize SPEC
epel9
Dominika Krejčí 8 years ago committed by Charalampos Stratakis
parent a25d1191c0
commit d7d174de5c

@ -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 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 Name: python-libcloud
Version: 1.3.0 Version: 1.3.0
Release: 1%{?dist} Release: 2%{?dist}
Summary: A Python library to address multiple cloud provider APIs Summary: A Python library to address multiple cloud provider APIs
Group: Development/Languages Group: Development/Languages
License: ASL 2.0 License: ASL 2.0
URL: http://libcloud.apache.org/ URL: http://libcloud.apache.org/
Source0: http://pypi.python.org/packages/source/a/apache-libcloud/%{tarball_name}-%{version}.tar.gz Source0: https://files.pythonhosted.org/packages/source/a/%{tarball_name}/%{tarball_name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
BuildRequires: python-setuptools %description %{_description}
%package -n python2-%{srcname}
Summary: %{summary}
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python2-setuptools
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname} %{_description}
Python 2 version.
%description %package -n python3-%{srcname}
libcloud is a client library for interacting with many of the popular cloud Summary: %{summary}
server providers. It was created to make it easy for developers to build BuildRequires: python3-devel
products that work between any of the services that it supports. BuildRequires: python3-setuptools
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname} %{_description}
Python 3 version.
%prep %prep
%setup -qn %{tarball_name}-%{version} %autosetup -n %{tarball_name}-%{version}
%build # Delete shebang lines in the demos
%{__python} setup.py build sed -i '1d' demos/gce_demo.py demos/compute_demo.py
%install %build
rm -rf %{buildroot} %py2_build
%{__python} setup.py install -O1 --skip-build --root %{buildroot} %py3_build
%clean # Fix permissions for demos
rm -rf %{buildroot} chmod -x demos/gce_demo.py demos/compute_demo.py
%files %install
%defattr(-,root,root,-) %py2_install
%doc LICENSE README.rst %py3_install
%{python_sitelib}/*
# 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 %changelog
* Wed Nov 16 2016 Dominika Krejci <dkrejci@redhat.com> - 1.3.0-2
- Add python3 subpackage
- Include the upstream demos
- Don't package the test suite
* Mon Oct 24 2016 Daniel Bruno <dbruno@fedoraproject.org> - 1.3.0-1 * Mon Oct 24 2016 Daniel Bruno <dbruno@fedoraproject.org> - 1.3.0-1
- Python Libcloud 1.3.0 release - Python Libcloud 1.3.0 release

Loading…
Cancel
Save