731a53
# python3 is not available on RHEL <= 7
731a53
%if 0%{?fedora} || 0%{?rhel} > 7
731a53
%bcond_without python3
731a53
%else
731a53
%bcond_with python3
731a53
%endif
731a53
731a53
# python2 is not available on RHEL > 7 and not needed on Fedora > 29
731a53
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
731a53
%bcond_with python2
731a53
%else
731a53
%bcond_without python2
731a53
%endif
731a53
731a53
%global modname pycurl
731a53
731a53
Name:           python-%{modname}
731a53
Version:        7.43.0.2
731a53
Release:        4%{?dist}
731a53
Summary:        A Python interface to libcurl
731a53
731a53
License:        LGPLv2+ or MIT
731a53
URL:            http://pycurl.sourceforge.net/
731a53
Source0:        https://dl.bintray.com/pycurl/pycurl/pycurl-%{version}.tar.gz
731a53
731a53
# fix programming mistakes detected by static analyzers
731a53
# upstream pull request: https://github.com/pycurl/pycurl/pull/550
731a53
Patch1:         0001-python-pycurl-7.43.0.2-static-analysis.patch
731a53
731a53
# drop link-time vs. run-time TLS backend check (#1446850)
731a53
Patch2:         0002-python-pycurl-7.43.0-tls-backend.patch
731a53
731a53
# fix populating list of decoded strings (#1792213)
731a53
Patch3:         0003-python-pycurl-7.43.0.2-decode-cookie-info.patch
731a53
731a53
BuildRequires:  gcc
731a53
BuildRequires:  libcurl-devel
731a53
BuildRequires:  openssl-devel
731a53
BuildRequires:  vsftpd
731a53
731a53
# During its initialization, PycURL checks that the actual libcurl version
731a53
# is not lower than the one used when PycURL was built.
731a53
# Yes, that should be handled by library versioning (which would then get
731a53
# automatically reflected by rpm).
731a53
# For now, we have to reflect that dependency.
731a53
%global libcurl_sed '/^#define LIBCURL_VERSION "/!d;s/"[^"]*$//;s/.*"//;q'
731a53
%global curlver_h /usr/include/curl/curlver.h
731a53
%global libcurl_ver %(sed %{libcurl_sed} %{curlver_h} 2>/dev/null || echo 0)
731a53
731a53
%description
731a53
PycURL is a Python interface to libcurl. PycURL can be used to fetch
731a53
objects identified by a URL from a Python program, similar to the
731a53
urllib Python module. PycURL is mature, very fast, and supports a lot
731a53
of features.
731a53
731a53
%if %{with python2}
731a53
%package -n python2-%{modname}
731a53
Summary:        Python interface to libcurl for Python 2
731a53
%{?python_provide:%python_provide python2-%{modname}}
731a53
BuildRequires:  python2-devel
731a53
BuildRequires:  python2-bottle
731a53
BuildRequires:  python2-nose
731a53
Requires:       libcurl%{?_isa} >= %{libcurl_ver}
731a53
731a53
Provides:       %{modname} = %{version}-%{release}
731a53
731a53
%description -n python2-%{modname}
731a53
PycURL is a Python interface to libcurl. PycURL can be used to fetch
731a53
objects identified by a URL from a Python program, similar to the
731a53
urllib Python module. PycURL is mature, very fast, and supports a lot
731a53
of features.
731a53
731a53
Python 2 version.
731a53
%endif
731a53
731a53
%if %{with python3}
731a53
%package -n python3-%{modname}
731a53
Summary:        Python interface to libcurl for Python 3
731a53
%{?python_provide:%python_provide python3-%{modname}}
731a53
BuildRequires:  python3-devel
731a53
BuildRequires:  python3-bottle
731a53
BuildRequires:  python3-nose
731a53
Requires:       libcurl%{?_isa} >= %{libcurl_ver}
731a53
731a53
%description -n python3-%{modname}
731a53
PycURL is a Python interface to libcurl. PycURL can be used to fetch
731a53
objects identified by a URL from a Python program, similar to the
731a53
urllib Python module. PycURL is mature, very fast, and supports a lot
731a53
of features.
731a53
731a53
Python 3 version.
731a53
%endif
731a53
731a53
%prep
731a53
%autosetup -n %{modname}-%{version} -p1
731a53
731a53
# remove binaries packaged by upstream
731a53
rm -f tests/fake-curl/libcurl/*.so
731a53
731a53
# remove a test-case that relies on sftp://web.sourceforge.net being available
731a53
rm -f tests/ssh_key_cb_test.py
731a53
731a53
# remove a test-case that fails in Koji
731a53
rm -f tests/seek_cb_test.py
731a53
731a53
# remove tests depending on the 'flaky' nose plug-in (not available in Fedora)
731a53
grep '^import flaky' -r tests | cut -d: -f1 | xargs rm -fv
731a53
731a53
# drop options that are not supported by nose in Fedora
731a53
sed -e 's/ --show-skipped//' \
731a53
    -e 's/ --with-flaky//' \
731a53
    -i tests/run.sh
731a53
731a53
%build
731a53
%if %{with python2}
731a53
%py2_build -- --with-openssl
731a53
%endif
731a53
%if %{with python3}
731a53
%py3_build -- --with-openssl
731a53
%endif
731a53
731a53
%install
731a53
export PYCURL_SSL_LIBRARY=openssl
731a53
%if %{with python2}
731a53
%py2_install
731a53
%endif
731a53
%if %{with python3}
731a53
%py3_install
731a53
%endif
731a53
rm -rf %{buildroot}%{_datadir}/doc/pycurl
731a53
731a53
%if %{with python3}
731a53
%check
731a53
export PYTHONPATH=%{buildroot}%{python3_sitearch}
731a53
export PYCURL_SSL_LIBRARY=openssl
731a53
export PYCURL_VSFTPD_PATH=vsftpd
731a53
731a53
# relax crypto policy for the test-suite to make it pass again (#1611739)
731a53
export OPENSSL_SYSTEM_CIPHERS_OVERRIDE=XXX
731a53
export OPENSSL_CONF=
731a53
731a53
make test PYTHON=%{__python3} NOSETESTS="nosetests-%{python3_version} -v" PYFLAKES=:
731a53
rm -fv tests/fake-curl/libcurl/*.so
731a53
%endif
731a53
731a53
%if %{with python2}
731a53
%files -n python2-%{modname}
731a53
%license COPYING-LGPL COPYING-MIT
731a53
%doc ChangeLog README.rst examples doc tests
731a53
%{python2_sitearch}/curl/
731a53
%{python2_sitearch}/%{modname}.so
731a53
%{python2_sitearch}/%{modname}-%{version}-*.egg-info
731a53
%endif
731a53
731a53
%if %{with python3}
731a53
%files -n python3-%{modname}
731a53
%license COPYING-LGPL COPYING-MIT
731a53
%doc ChangeLog README.rst examples doc tests
731a53
%{python3_sitearch}/curl/
731a53
%{python3_sitearch}/%{modname}.*.so
731a53
%{python3_sitearch}/%{modname}-%{version}-*.egg-info
731a53
%endif
731a53
731a53
%changelog
731a53
* Wed Jan 22 2020 Kamil Dudka <kdudka@redhat.com> - 7.43.0.2-4
731a53
- fix populating list of decoded strings (#1792213)
731a53
- fix programming mistakes detected by static analyzers (#1666003)
731a53
731a53
* Thu Dec 20 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0.2-3
731a53
- drop build-time (%%check-only) dependency on pyflakes (#1661168)
731a53
731a53
* Tue Aug 07 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0.2-2
731a53
- relax crypto policy for the test-suite to make it pass again (#1611739)
731a53
731a53
* Mon Jun 04 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0.2-1
731a53
- update to 7.43.0.2
731a53
731a53
* Wed May 30 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0-17
731a53
- make the python2 and python3 subpackages optional
731a53
731a53
* Wed May 23 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0-16
731a53
- fix build failure caused by NotImplemented exceptions in winbuild.py
731a53
731a53
* Wed Mar 14 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0-15
731a53
- enable vsftpd-based tests
731a53
- run the test-suite for Python 3 only
731a53
- do not disable TLS-SRP test because it is now supported by OpenSSL in Fedora
731a53
731a53
* Mon Feb 19 2018 Kamil Dudka <kdudka@redhat.com> - 7.43.0-14
731a53
- add explicit BR for the gcc compiler
731a53
731a53
* Fri Feb 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 7.43.0-13
731a53
- Update Python 2 dependency declarations to new packaging standards
731a53
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
731a53
731a53
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 7.43.0-12
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
731a53
731a53
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 7.43.0-11
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
731a53
731a53
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 7.43.0-10
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
731a53
731a53
* Tue May 02 2017 Kamil Dudka <kdudka@redhat.com> - 7.43.0-9
731a53
- drop link-time vs. run-time TLS backend check (#1446850)
731a53
731a53
* Thu Apr 27 2017 Kamil Dudka <kdudka@redhat.com> - 7.43.0-8
731a53
- make pycurl compile against libcurl-openssl (#1445153)
731a53
731a53
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 7.43.0-7
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
731a53
731a53
* Mon Dec 12 2016 Stratakis Charalampos <cstratak@redhat.com> - 7.43.0-6
731a53
- Rebuild for Python 3.6
731a53
731a53
* Tue Nov 29 2016 Charalampos Stratakis <cstratak@redhat.com> - 7.43.0-5
731a53
- Fix python2 subpackage name
731a53
731a53
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.43.0-4
731a53
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
731a53
731a53
* Thu Apr 14 2016 Igor Gnatenko <ignatenko@redhat.com> - 7.43.0-3
731a53
- Follow new packaging guidelines
731a53
731a53
* Fri Feb 26 2016 Kamil Dudka <kdudka@redhat.com> - 7.43.0-2
731a53
- require libcurl of the same architecture as python-pycurl
731a53
731a53
* Sat Feb 06 2016 Kamil Dudka <kdudka@redhat.com> - 7.43.0-1
731a53
- update to 7.43.0
731a53
731a53
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 7.21.5-4
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
731a53
731a53
* Wed Jan 06 2016 Kamil Dudka <kdudka@redhat.com> - 7.21.5-3
731a53
- remove explicit dependency on keyutils-libs (reported by rpmlint)
731a53
- update FSF address in COPYING-LGPL (detected by rpmlint)
731a53
731a53
* Tue Jan 05 2016 Kamil Dudka <kdudka@redhat.com> - 7.21.5-2
731a53
- avoid installing binaries generated in %%check to /usr/share
731a53
731a53
* Tue Jan 05 2016 Kamil Dudka <kdudka@redhat.com> - 7.21.5-1
731a53
- update to 7.21.5
731a53
731a53
* Sat Nov 14 2015 Toshio Kuratomi <toshio@fedoraproject.org> - - 7.19.5.3-3
731a53
- Remove build dependency on cherrypy as it's no longer needed for testing
731a53
731a53
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.5.3-2
731a53
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
731a53
731a53
* Tue Nov 03 2015 Kamil Dudka <kdudka@redhat.com> - 7.19.5.3-1
731a53
- update to 7.19.5.3
731a53
731a53
* Mon Nov 02 2015 Kamil Dudka <kdudka@redhat.com> - 7.19.5.2-1
731a53
- update to 7.19.5.2
731a53
731a53
* Mon Sep 07 2015 Kamil Dudka <kdudka@redhat.com> - 7.19.5.1-3
731a53
- introduce CURL_SSLVERSION_TLSv1_[0-2] (#1260408)
731a53
731a53
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.5.1-2
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
731a53
731a53
* Mon Jan 12 2015 Kamil Dudka <kdudka@redhat.com> - 7.19.5.1-1
731a53
- update to 7.19.5.1
731a53
731a53
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.5-3
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
731a53
731a53
* Sun Aug  3 2014 Tom Callaway <spot@fedoraproject.org> - 7.19.5-2
731a53
- fix license handling
731a53
731a53
* Mon Jul 14 2014 Kamil Dudka <kdudka@redhat.com> - 7.19.5-1
731a53
- update to 7.19.5
731a53
731a53
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.3.1-3
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
731a53
731a53
* Mon May 19 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 7.19.3.1-2
731a53
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
731a53
731a53
* Thu Feb 06 2014 Kamil Dudka <kdudka@redhat.com> - 7.19.3.1-1
731a53
- update to 7.19.3.1
731a53
731a53
* Fri Jan 10 2014 Kamil Dudka <kdudka@redhat.com> - 7.19.3-2
731a53
- add python3 subpackage (#1014583)
731a53
731a53
* Fri Jan 10 2014 Kamil Dudka <kdudka@redhat.com> - 7.19.3-1
731a53
- update to 7.19.3
731a53
731a53
* Thu Jan 02 2014 Kamil Dudka <kdudka@redhat.com> - 7.19.0.3-1
731a53
- update to 7.19.0.3
731a53
731a53
* Tue Oct 08 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0.2-1
731a53
- update to 7.19.0.2
731a53
731a53
* Wed Sep 25 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0.1-1
731a53
- update to 7.19.0.1
731a53
731a53
* Thu Aug 08 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0-18.20130315git8d654296
731a53
- sync with upstream 8d654296
731a53
731a53
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-17.20120408git9b8f4e38
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
731a53
731a53
* Tue Apr 09 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0-16.20120408git9b8f4e38
731a53
- sync with upstream 9b8f4e38 (fixes #928370)
731a53
- add the GLOBAL_ACK_EINTR constant to the list of exported symbols (#920589)
731a53
- temporarily disable tests/multi_socket_select_test.py
731a53
731a53
* Wed Mar 06 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0-15
731a53
- allow to return -1 from the write callback (#857875) 
731a53
- remove the patch for curl-config --static-libs no longer needed
731a53
- run the tests against the just built pycurl, not the system one
731a53
731a53
* Mon Feb 25 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0-14
731a53
- apply bug-fixes committed to upstream CVS since 7.19.0 (fixes #896025)
731a53
731a53
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-13
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
731a53
731a53
* Wed Aug 22 2012 Jan Synáček <jsynacek@redhat.com> - 7.19.0-12
731a53
- Improve spec
731a53
731a53
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-11
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
731a53
731a53
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-10
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
731a53
731a53
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-9
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
731a53
731a53
* Mon Dec 20 2010 Dennis Gilmore <dennis@ausil.us> - 7.19.0-8
731a53
- add Missing Requires on keyutils-libs
731a53
731a53
* Tue Aug 17 2010 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.19.0-7
731a53
- Add patch developed by David Malcolm to fix segfaults caused by a missing incref
731a53
731a53
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 7.19.0-6
731a53
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
731a53
731a53
* Tue Mar  2 2010 Karel Klic <kklic@redhat.com> - 7.19.0-5
731a53
- Package COPYING2 file
731a53
- Added MIT as a package license
731a53
731a53
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-4
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
731a53
731a53
* Fri Apr 17 2009 Stepan Kasal <skasal@redhat.com> - 7.19.0-3
731a53
- fix typo in the previous change
731a53
731a53
* Fri Apr 17 2009 Stepan Kasal <skasal@redhat.com> - 7.19.0-2
731a53
- add a require to reflect a dependency on libcurl version (#496308)
731a53
731a53
* Thu Mar  5 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.19.0-1
731a53
- Update to 7.19.0
731a53
731a53
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.18.2-3
731a53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
731a53
731a53
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 7.18.2-2
731a53
- Rebuild for Python 2.6
731a53
731a53
* Thu Jul  3 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.18.2-1
731a53
- Update to 7.18.2
731a53
- Thanks to Ville Skyttä re-enable the tests and fix a minor problem
731a53
  with the setup.py. (Bug # 45400)
731a53
731a53
* Thu Jun  5 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.18.1-1
731a53
- Update to 7.18.1
731a53
- Disable tests because it's not testing the built library, it's trying to
731a53
  test an installed library.
731a53
731a53
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 7.16.4-3
731a53
- Autorebuild for GCC 4.3
731a53
731a53
* Thu Jan  3 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.16.4-2
731a53
- BR openssl-devel
731a53
731a53
* Wed Aug 29 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.16.4-1
731a53
- Update to 7.16.4
731a53
- Update license tag.
731a53
731a53
* Sat Jun  9 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.16.2.1-1
731a53
- Update to released version.
731a53
731a53
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.16.0-0.1.20061207
731a53
- Update to a CVS snapshot since development has a newer version of curl than is in FC <= 6
731a53
731a53
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.15.5.1-4
731a53
- Add -DHAVE_CURL_OPENSSL to fix PPC build problem.
731a53
731a53
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.15.5.1-3
731a53
- Don't forget to Provide: pycurl!!!
731a53
731a53
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.15.5.1-2
731a53
- Remove INSTALL from the list of documentation
731a53
- Use python_sitearch for all of the files
731a53
731a53
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.15.5.1-1
731a53
- First version for Fedora Extras