python-httplib2/python-httplib2.spec
2019-11-19 11:54:02 +08:00

76 lines
1.6 KiB
RPMSpec

Name: python-httplib2
Version: 0.13.1
Release: 1
Summary: Small, fast HTTP client library for Python.
License: MIT
URL: https://github.com/httplib2/httplib2
Source0: https://github.com/httplib2/httplib2/archive/httplib2-%{version}.tar.gz
Patch1: python-httplib2.certfile.patch
BuildRequires: python2-setuptools python2-devel
%if 0%{?with_python3}
BuildRequires: python3-setuptools python3-devel
%endif
BuildArch: noarch
%description
httplib2 is a comprehensive HTTP client library, httplib2.py supports many
features left out of other HTTP libraries.
%package -n python2-httplib2
Summary: Small, fast HTTP client library for Python.
%{?python_provide:%python_provide python2-httplib2}
%description -n python2-httplib2
Small, fast HTTP client library for Python.
%if 0%{?with_python3}
%package -n python3-httplib2
Summary: Small, fast HTTP client library for Python.
%description -n python3-httplib2
Small, fast HTTP client library for Python.
%endif
%prep
%autosetup -n httplib2-%{version} -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
%endif
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif
%files -n python2-httplib2
%defattr(-,root,root)
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n python3-httplib2
%defattr(-,root,root)
%{python3_sitelib}/*
%endif
%changelog
* Thu Nov 7 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.13.1-1
- Package init