1fb0df
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
1fb0df
1fb0df
Name:           python-pycurl
1fb0df
Version:        7.19.0
1fb0df
Release:        19%{?dist}
1fb0df
Summary:        A Python interface to libcurl
1fb0df
1fb0df
Group:          Development/Languages
1fb0df
License:        LGPLv2+ or MIT
1fb0df
URL:            http://pycurl.sourceforge.net/
1fb0df
Source0:        http://pycurl.sourceforge.net/download/pycurl-%{version}.tar.gz
1fb0df
1fb0df
# upstream patches
1fb0df
Patch1:         0001-No-longer-keep-copies-of-string-options-since-this-i.patch
1fb0df
Patch2:         0002-Fixes-https-sourceforge.net-tracker-func-detail-aid-.patch
1fb0df
Patch3:         0003-Fixes-refcount-bug-and-provides-better-organization-.patch
1fb0df
Patch4:         0004-Test-for-reset-fixes-refcount-bug.patch
1fb0df
Patch5:         0005-Updating-ChangeLog-with-relevant-changes.patch
1fb0df
1fb0df
# downstream patches
1fb0df
Patch101:       0101-test_internals.py-add-a-test-for-ref-counting-of-res.patch
1fb0df
Patch102:       0102-pycurl.c-eliminate-duplicated-code-in-util_write_cal.patch
1fb0df
Patch103:       0103-pycurl.c-allow-to-return-1-from-write-callback.patch
1fb0df
Patch104:       0104-test_write_abort.py-test-returning-1-from-write-call.patch
1fb0df
Patch105:       0105-add-the-GLOBAL_ACK_EINTR-constant-to-the-list-of-exp.patch
1fb0df
1fb0df
# RHEL patches
1fb0df
Patch201:       0201-Keep-a-reference-to-the-object-used-for-CURLOPT_POST.patch
1fb0df
Patch202:       0202-Add-libcurl-7.34.0-sslversion-options.patch
1fb0df
1fb0df
Requires:       keyutils-libs
1fb0df
BuildRequires:  python-devel
1fb0df
BuildRequires:  openssl-devel
1fb0df
1fb0df
# curl-7.29.0-16 or newer is needed for CURL_SSLVERSION_TLSv1_[0-2]
1fb0df
BuildRequires:  libcurl-devel >= 7.29.0-16
1fb0df
1fb0df
# During its initialization, PycURL checks that the actual libcurl version
1fb0df
# is not lower than the one used when PycURL was built.
1fb0df
# Yes, that should be handled by library versioning (which would then get
1fb0df
# automatically reflected by rpm).
1fb0df
# For now, we have to reflect that dependency.
1fb0df
%global libcurl_sed '/^#define LIBCURL_VERSION "/!d;s/"[^"]*$//;s/.*"//;q'
1fb0df
%global curlver_h /usr/include/curl/curlver.h
1fb0df
%global libcurl_ver %(sed %{libcurl_sed} %{curlver_h} 2>/dev/null || echo 0)
1fb0df
Requires:       libcurl >= %{libcurl_ver}
1fb0df
1fb0df
Provides:       pycurl = %{version}-%{release}
1fb0df
1fb0df
%description
1fb0df
PycURL is a Python interface to libcurl. PycURL can be used to fetch
1fb0df
objects identified by a URL from a Python program, similar to the
1fb0df
urllib Python module. PycURL is mature, very fast, and supports a lot
1fb0df
of features.
1fb0df
1fb0df
%prep
1fb0df
%setup0 -q -n pycurl-%{version}
1fb0df
%patch1 -p1
1fb0df
%patch2 -p1
1fb0df
%patch3 -p1
1fb0df
%patch4 -p1
1fb0df
%patch5 -p1
1fb0df
%patch101 -p1
1fb0df
%patch102 -p1
1fb0df
%patch103 -p1
1fb0df
%patch104 -p1
1fb0df
%patch105 -p1
1fb0df
%patch201 -p1
1fb0df
%patch202 -p1
1fb0df
chmod a-x examples/*
1fb0df
1fb0df
%build
1fb0df
CFLAGS="$RPM_OPT_FLAGS -DHAVE_CURL_OPENSSL" %{__python} setup.py build
1fb0df
1fb0df
%check
1fb0df
export PYTHONPATH=$RPM_BUILD_ROOT%{python_sitearch}
1fb0df
make test PYTHON=%{__python}
1fb0df
1fb0df
%install
1fb0df
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
1fb0df
rm -rf %{buildroot}%{_datadir}/doc/pycurl
1fb0df
1fb0df
%files
1fb0df
%doc COPYING COPYING2 ChangeLog README TODO examples doc tests
1fb0df
%{python_sitearch}/*
1fb0df
1fb0df
%changelog
1fb0df
* Mon Sep 07 2015 Kamil Dudka <kdudka@redhat.com> - 7.19.0-19
1fb0df
- introduce SSLVERSION_TLSv1_[0-2] (#1260407)
1fb0df
1fb0df
* Wed Oct 15 2014 Kamil Dudka <kdudka@redhat.com> - 7.19.0-18
1fb0df
- fix a use-after-free bug in handling pycurl.POSTFIELDS (#1153321)
1fb0df
1fb0df
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 7.19.0-17
1fb0df
- Mass rebuild 2014-01-24
1fb0df
1fb0df
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 7.19.0-16
1fb0df
- Mass rebuild 2013-12-27
1fb0df
1fb0df
* Tue Apr 09 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0-15.1
1fb0df
- add the GLOBAL_ACK_EINTR constant to the list of exported symbols (#920589)
1fb0df
1fb0df
* Wed Mar 06 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0-15
1fb0df
- allow to return -1 from the write callback (#857875) 
1fb0df
- remove the patch for curl-config --static-libs no longer needed
1fb0df
- run the tests against the just built pycurl, not the system one
1fb0df
1fb0df
* Mon Feb 25 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0-14
1fb0df
- apply bug-fixes committed to upstream CVS since 7.19.0 (fixes #896025)
1fb0df
1fb0df
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-13
1fb0df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
1fb0df
1fb0df
* Wed Aug 22 2012 Jan Synáček <jsynacek@redhat.com> - 7.19.0-12
1fb0df
- Improve spec
1fb0df
1fb0df
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-11
1fb0df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
1fb0df
1fb0df
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-10
1fb0df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
1fb0df
1fb0df
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-9
1fb0df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
1fb0df
1fb0df
* Mon Dec 20 2010 Dennis Gilmore <dennis@ausil.us> - 7.19.0-8
1fb0df
- add Missing Requires on keyutils-libs
1fb0df
1fb0df
* Tue Aug 17 2010 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.19.0-7
1fb0df
- Add patch developed by David Malcolm to fix segfaults caused by a missing incref
1fb0df
1fb0df
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 7.19.0-6
1fb0df
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
1fb0df
1fb0df
* Tue Mar  2 2010 Karel Klic <kklic@redhat.com> - 7.19.0-5
1fb0df
- Package COPYING2 file
1fb0df
- Added MIT as a package license
1fb0df
1fb0df
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-4
1fb0df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
1fb0df
1fb0df
* Fri Apr 17 2009 Stepan Kasal <skasal@redhat.com> - 7.19.0-3
1fb0df
- fix typo in the previous change
1fb0df
1fb0df
* Fri Apr 17 2009 Stepan Kasal <skasal@redhat.com> - 7.19.0-2
1fb0df
- add a require to reflect a dependency on libcurl version (#496308)
1fb0df
1fb0df
* Thu Mar  5 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.19.0-1
1fb0df
- Update to 7.19.0
1fb0df
1fb0df
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.18.2-3
1fb0df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
1fb0df
1fb0df
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 7.18.2-2
1fb0df
- Rebuild for Python 2.6
1fb0df
1fb0df
* Thu Jul  3 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.18.2-1
1fb0df
- Update to 7.18.2
1fb0df
- Thanks to Ville Skyttä re-enable the tests and fix a minor problem
1fb0df
  with the setup.py. (Bug # 45400)
1fb0df
1fb0df
* Thu Jun  5 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.18.1-1
1fb0df
- Update to 7.18.1
1fb0df
- Disable tests because it's not testing the built library, it's trying to
1fb0df
  test an installed library.
1fb0df
1fb0df
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 7.16.4-3
1fb0df
- Autorebuild for GCC 4.3
1fb0df
1fb0df
* Thu Jan  3 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.16.4-2
1fb0df
- BR openssl-devel
1fb0df
1fb0df
* Wed Aug 29 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.16.4-1
1fb0df
- Update to 7.16.4
1fb0df
- Update license tag.
1fb0df
1fb0df
* Sat Jun  9 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.16.2.1-1
1fb0df
- Update to released version.
1fb0df
1fb0df
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.16.0-0.1.20061207
1fb0df
- Update to a CVS snapshot since development has a newer version of curl than is in FC <= 6
1fb0df
1fb0df
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.15.5.1-4
1fb0df
- Add -DHAVE_CURL_OPENSSL to fix PPC build problem.
1fb0df
1fb0df
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.15.5.1-3
1fb0df
- Don't forget to Provide: pycurl!!!
1fb0df
1fb0df
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.15.5.1-2
1fb0df
- Remove INSTALL from the list of documentation
1fb0df
- Use python_sitearch for all of the files
1fb0df
1fb0df
* Thu Dec  7 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 7.15.5.1-1
1fb0df
- First version for Fedora Extras