Cleanup spec

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Raits 2020-04-22 20:08:21 +02:00
parent a10e8678f6
commit 6463ecb14c
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

View File

@ -1,95 +1,64 @@
%if 0%{?fedora} >= 13
%global with_python3 1
%else
%if 0%{?rhel} >= 7
%global with_python3 1
%endif
%endif
%global srcname httplib2
Name: python-httplib2
Name: python-%{srcname}
Version: 0.17.3
Release: 1%{?dist}
Summary: A comprehensive HTTP client library
Release: 2%{?dist}
Summary: Comprehensive HTTP client library
License: MIT
URL: https://pypi.python.org/pypi/httplib2
Source0: https://files.pythonhosted.org/packages/b4/ff/605ae6e8e77cad745c877d512851cc40d75d8068b1e456fcb4e30ee2d944/httplib2-0.17.3.tar.gz
Source: %{pypi_source}
#
# Patch to use the Fedora ca certs instead of the bundled ones
#
Patch1: python-httplib2.certfile.patch
Patch1: python-%{srcname}.certfile.patch
BuildRequires: python2-setuptools
BuildRequires: python2-devel
BuildArch: noarch
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
# if with_python3
%global _description\
A comprehensive HTTP client library that supports many features left out of\
other HTTP libraries.
%description %_description
%description %{_description}
%package -n python2-httplib2
Summary: %summary
%{?python_provide:%python_provide python2-httplib2}
%package -n python2-%{srcname}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{srcname}}
BuildRequires: python2-setuptools
BuildRequires: python2-devel
%description -n python2-httplib2 %_description
%description -n python2-%{srcname} %{_description}
%if 0%{?with_python3}
%package -n python3-httplib2
Summary: A comprehensive HTTP client library
%package -n python3-%{srcname}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{srcname}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%description -n python3-httplib2
A comprehensive HTTP client library that supports many features left out of
other HTTP libraries.
%endif
# with_python3
%description -n python3-%{srcname} %{_description}
%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
# with_python3
%autosetup -n %{srcname}-%{version} -p1
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
# with_python3
%py2_build
%py3_build
%install
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
%py2_install
%py3_install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
popd
%endif
# with_python3
%files -n python2-%{srcname}
%{python2_sitelib}/%{srcname}-*.egg-info/
%{python2_sitelib}/%{srcname}/
%files -n python2-httplib2
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n python3-httplib2
%{python3_sitelib}/*
%endif
# with_python3
%files -n python3-%{srcname}
%{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}/
%changelog
* Wed Apr 22 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.17.3-2
- Cleanup spec
* Wed Apr 22 2020 Gwyn Ciesla <gwync@protonmail.com> - 0.17.3-1
- 0.17.3