make the python2 and python3 subpackages optional
This commit is contained in:
parent
a6991a431c
commit
c6c1a8cb7a
@ -1,8 +1,22 @@
|
|||||||
|
# python3 is not available on RHEL <= 7
|
||||||
|
%if 0%{?fedora} || 0%{?rhel} > 7
|
||||||
|
%bcond_without python3
|
||||||
|
%else
|
||||||
|
%bcond_with python3
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# python2 is not available on RHEL > 7 and not needed on Fedora > 29
|
||||||
|
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
|
||||||
|
%bcond_with python2
|
||||||
|
%else
|
||||||
|
%bcond_without python2
|
||||||
|
%endif
|
||||||
|
|
||||||
%global modname pycurl
|
%global modname pycurl
|
||||||
|
|
||||||
Name: python-%{modname}
|
Name: python-%{modname}
|
||||||
Version: 7.43.0
|
Version: 7.43.0
|
||||||
Release: 16%{?dist}
|
Release: 17%{?dist}
|
||||||
Summary: A Python interface to libcurl
|
Summary: A Python interface to libcurl
|
||||||
|
|
||||||
License: LGPLv2+ or MIT
|
License: LGPLv2+ or MIT
|
||||||
@ -35,6 +49,7 @@ objects identified by a URL from a Python program, similar to the
|
|||||||
urllib Python module. PycURL is mature, very fast, and supports a lot
|
urllib Python module. PycURL is mature, very fast, and supports a lot
|
||||||
of features.
|
of features.
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%package -n python2-%{modname}
|
%package -n python2-%{modname}
|
||||||
Summary: Python interface to libcurl for Python 2
|
Summary: Python interface to libcurl for Python 2
|
||||||
%{?python_provide:%python_provide python2-%{modname}}
|
%{?python_provide:%python_provide python2-%{modname}}
|
||||||
@ -53,7 +68,9 @@ urllib Python module. PycURL is mature, very fast, and supports a lot
|
|||||||
of features.
|
of features.
|
||||||
|
|
||||||
Python 2 version.
|
Python 2 version.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%package -n python3-%{modname}
|
%package -n python3-%{modname}
|
||||||
Summary: Python interface to libcurl for Python 3
|
Summary: Python interface to libcurl for Python 3
|
||||||
%{?python_provide:%python_provide python3-%{modname}}
|
%{?python_provide:%python_provide python3-%{modname}}
|
||||||
@ -70,6 +87,7 @@ urllib Python module. PycURL is mature, very fast, and supports a lot
|
|||||||
of features.
|
of features.
|
||||||
|
|
||||||
Python 3 version.
|
Python 3 version.
|
||||||
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{modname}-%{version} -p1
|
%autosetup -n %{modname}-%{version} -p1
|
||||||
@ -92,35 +110,52 @@ sed -e 's/ --show-skipped//' \
|
|||||||
-i tests/run.sh
|
-i tests/run.sh
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if %{with python2}
|
||||||
%py2_build -- --with-openssl
|
%py2_build -- --with-openssl
|
||||||
|
%endif
|
||||||
|
%if %{with python3}
|
||||||
%py3_build -- --with-openssl
|
%py3_build -- --with-openssl
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%if %{with python2}
|
||||||
%py2_install
|
%py2_install
|
||||||
|
%endif
|
||||||
|
%if %{with python3}
|
||||||
%py3_install
|
%py3_install
|
||||||
|
%endif
|
||||||
rm -rf %{buildroot}%{_datadir}/doc/pycurl
|
rm -rf %{buildroot}%{_datadir}/doc/pycurl
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%check
|
%check
|
||||||
export PYTHONPATH=%{buildroot}%{python3_sitearch}
|
export PYTHONPATH=%{buildroot}%{python3_sitearch}
|
||||||
export PYCURL_VSFTPD_PATH=vsftpd
|
export PYCURL_VSFTPD_PATH=vsftpd
|
||||||
make test PYTHON=%{__python3} NOSETESTS="nosetests-%{python3_version} -v"
|
make test PYTHON=%{__python3} NOSETESTS="nosetests-%{python3_version} -v"
|
||||||
rm -fv tests/fake-curl/libcurl/*.so
|
rm -fv tests/fake-curl/libcurl/*.so
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%files -n python2-%{modname}
|
%files -n python2-%{modname}
|
||||||
%license COPYING-LGPL COPYING-MIT
|
%license COPYING-LGPL COPYING-MIT
|
||||||
%doc ChangeLog README.rst examples doc tests
|
%doc ChangeLog README.rst examples doc tests
|
||||||
%{python2_sitearch}/curl/
|
%{python2_sitearch}/curl/
|
||||||
%{python2_sitearch}/%{modname}.so
|
%{python2_sitearch}/%{modname}.so
|
||||||
%{python2_sitearch}/%{modname}-%{version}-*.egg-info
|
%{python2_sitearch}/%{modname}-%{version}-*.egg-info
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%files -n python3-%{modname}
|
%files -n python3-%{modname}
|
||||||
%license COPYING-LGPL COPYING-MIT
|
%license COPYING-LGPL COPYING-MIT
|
||||||
%doc ChangeLog README.rst examples doc tests
|
%doc ChangeLog README.rst examples doc tests
|
||||||
%{python3_sitearch}/curl/
|
%{python3_sitearch}/curl/
|
||||||
%{python3_sitearch}/%{modname}.*.so
|
%{python3_sitearch}/%{modname}.*.so
|
||||||
%{python3_sitearch}/%{modname}-%{version}-*.egg-info
|
%{python3_sitearch}/%{modname}-%{version}-*.egg-info
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed May 30 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0-17
|
||||||
|
- make the python2 and python3 subpackages optional
|
||||||
|
|
||||||
* Wed May 23 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0-16
|
* Wed May 23 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0-16
|
||||||
- fix build failure caused by NotImplemented exceptions in winbuild.py
|
- fix build failure caused by NotImplemented exceptions in winbuild.py
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user