commit 3df1d3338227972d30d23b7febd8137f049e6ffb Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:15:24 2019 -0400 Package init diff --git a/0002-python-pycurl-7.43.0-tls-backend.patch b/0002-python-pycurl-7.43.0-tls-backend.patch new file mode 100644 index 0000000..1d6da04 --- /dev/null +++ b/0002-python-pycurl-7.43.0-tls-backend.patch @@ -0,0 +1,54 @@ +From 36dcccb94bef72a7c4cf6acf7479f18568e545bb Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Tue, 2 May 2017 17:19:20 +0200 +Subject: [PATCH] module: drop link-time vs. run-time TLS backend check + +This effectively reverts the following commit: +8891398a31119ce7c872509ed60328926c51cdfb + +Bug: https://bugzilla.redhat.com/1446850 +--- + src/module.c | 20 +------------------- + 1 file changed, 1 insertion(+), 19 deletions(-) + +diff --git a/src/module.c b/src/module.c +index a7108a0..af79875 100644 +--- a/src/module.c ++++ b/src/module.c +@@ -322,7 +322,7 @@ initpycurl(void) + { + PyObject *m, *d; + const curl_version_info_data *vi; +- const char *libcurl_version, *runtime_ssl_lib; ++ const char *libcurl_version; + size_t libcurl_version_len, pycurl_version_len; + PyObject *xio_module = NULL; + PyObject *collections_module = NULL; +@@ -345,24 +345,6 @@ initpycurl(void) + goto error; + } + +- /* Our compiled crypto locks should correspond to runtime ssl library. */ +- if (vi->ssl_version == NULL) { +- runtime_ssl_lib = "none/other"; +- } else if (!strncmp(vi->ssl_version, "OpenSSL/", 8) || !strncmp(vi->ssl_version, "LibreSSL/", 9) || +- !strncmp(vi->ssl_version, "BoringSSL", 9)) { +- runtime_ssl_lib = "openssl"; +- } else if (!strncmp(vi->ssl_version, "GnuTLS/", 7)) { +- runtime_ssl_lib = "gnutls"; +- } else if (!strncmp(vi->ssl_version, "NSS/", 4)) { +- runtime_ssl_lib = "nss"; +- } else { +- runtime_ssl_lib = "none/other"; +- } +- if (strcmp(runtime_ssl_lib, COMPILE_SSL_LIB)) { +- PyErr_Format(PyExc_ImportError, "pycurl: libcurl link-time ssl backend (%s) is different from compile-time ssl backend (%s)", runtime_ssl_lib, COMPILE_SSL_LIB); +- goto error; +- } +- + /* Initialize the type of the new type objects here; doing it here + * is required for portability to Windows without requiring C++. */ + p_Curl_Type = &Curl_Type; +-- +2.10.2 + diff --git a/pycurl-7.43.0.2.tar.gz b/pycurl-7.43.0.2.tar.gz new file mode 100644 index 0000000..a699163 Binary files /dev/null and b/pycurl-7.43.0.2.tar.gz differ diff --git a/python-pycurl.spec b/python-pycurl.spec new file mode 100644 index 0000000..cf8fd4c --- /dev/null +++ b/python-pycurl.spec @@ -0,0 +1,140 @@ +# PycURL checks that the actual libcurl version is not lower +# than the one used when PycURL was built during its initialization. +%global libcurl_sed '/^#define LIBCURL_VERSION "/!d;s/"[^"]*$//;s/.*"//;q' +%global curlver_h /usr/include/curl/curlver.h +%global libcurl_ver %(sed %{libcurl_sed} %{curlver_h} 2>/dev/null || echo 0) + +Name: python-pycurl +Version: 7.43.0.2 +Release: 5 +Summary: A Python interface to libcurl +License: LGPLv2+ or MIT +URL: http://pycurl.sourceforge.net/ +Source0: https://dl.bintray.com/pycurl/pycurl/pycurl-%{version}.tar.gz +# drop link-time vs. run-time TLS backend check (#1446850) +Patch0: 0002-python-pycurl-7.43.0-tls-backend.patch + +BuildRequires: gcc libcurl-devel openssl-devel vsftpd + +%description +PycURL is a Python interface to libcurl. PycURL can be used to fetch +objects identified by a URL from a Python program, similar to the +urllib Python module. PycURL is mature, very fast, and supports a lot +of features. + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains development files for %{name} + +%package_help + +%if 0%{?with_python2} +%package -n python2-pycurl +Summary: Python interface to libcurl for Python 2 +%{?python_provide:%python_provide python2-pycurl} +BuildRequires: python2-devel python2-bottle python2-nose python2-pyflakes +Requires: libcurl >= %{libcurl_ver} + +Provides: pycurl = %{version}-%{release} + +%description -n python2-pycurl +PycURL is a Python interface to libcurl. PycURL can be used to fetch +objects identified by a URL from a Python program, similar to the +urllib Python module. PycURL is mature, very fast, and supports a lot +of features. +This package if for Python2. +%endif + +%package -n python3-pycurl +Summary: Python interface to libcurl for Python 3 +%{?python_provide:%python_provide python3-pycurl} +BuildRequires: python3-devel python3-bottle python3-nose python3-pyflakes +Requires: libcurl >= %{libcurl_ver} + +%description -n python3-pycurl +PycURL is a Python interface to libcurl. PycURL can be used to fetch +objects identified by a URL from a Python program, similar to the +urllib Python module. PycURL is mature, very fast, and supports a lot +of features. +This package is for Python3. + +%prep +%autosetup -n pycurl-%{version} -p1 + +# remove binaries packaged by upstream +rm -f tests/fake-curl/libcurl/*.so +# remove a failed test-case that relies on sftp://web.sourceforge.net being available +rm -f tests/ssh_key_cb_test.py +# remove a failed test-case +rm -f tests/seek_cb_test.py +# remove tests depending on the 'flaky' nose plug-in +grep '^import flaky' -r tests | cut -d: -f1 | xargs rm -fv +# drop options that are not supported +sed -e 's/ --show-skipped//' \ + -e 's/ --with-flaky//' \ + -i tests/run.sh + +%build +%if 0%{?with_python2} +%py2_build -- --with-openssl +%endif + +%py3_build -- --with-openssl + +%install +export PYCURL_SSL_LIBRARY=openssl +%if 0%{?with_python2} +%py2_install +%endif +%py3_install +rm -rf %{buildroot}%{_datadir}/doc/pycurl + +%check +export PYTHONPATH=%{buildroot}%{python3_sitearch} +export PYCURL_SSL_LIBRARY=openssl +export PYCURL_VSFTPD_PATH=vsftpd +make test PYTHON=%{__python3} NOSETESTS="nosetests-%{python3_version} -v" +rm -fv tests/fake-curl/libcurl/*.so + +%files devel +%defattr(-,root,root) +%doc examples tests + +%files help +%defattr(-,root,root) +%doc ChangeLog README.rst doc + +%if 0%{?with_python2} +%files -n python2-pycurl +%defattr(-,root,root) +%license COPYING-LGPL COPYING-MIT +%{python2_sitearch}/curl/ +%{python2_sitearch}/pycurl.so +%{python2_sitearch}/pycurl-%{version}-*.egg-info +%endif + +%files -n python3-pycurl +%defattr(-,root,root) +%license COPYING-LGPL COPYING-MIT +%{python3_sitearch}/curl/ +%{python3_sitearch}/pycurl.*.so +%{python3_sitearch}/pycurl-%{version}-*.egg-info + +%changelog +* Fri Sep 27 2019 openEuler Buildteam - 7.43.0.2-5 +- del unnecessary statement + +* Tue Sep 24 2019 openEuler Buildteam - 7.43.0.2-4 +- add with_python2 for python2 + +* Thu Sep 19 2019 openEuler Buildteam - 7.43.0.2-3 +- rebuild package + +* Mon Sep 16 2019 openEuler Buildteam - 7.43.0.2-2 +- modify content format + +* Sat Sep 14 2019 openEuler Buildteam - 7.43.0.2-1 +- Package init