Skip to content

Commit

Permalink
py2-pycurl: make sure link-time ssl backend and compile-time match
Browse files Browse the repository at this point in the history
Bump version to 7.43.0.

Add missing dependency on OpenSSL (pycurl includes headers if OpenSSL is
selected as backend).

We have noticed the following issue in GCC 5.3.0 branch:

    import pycurl
    ImportError: pycurl: libcurl link-time ssl backend (openssl) is
    different from compile-time ssl backend (none/other)

At compile time pycurl hardcoded the backend it's using:

    src/pycurl.h:#   define COMPILE_SSL_LIB "openssl"
    src/pycurl.h:#   define COMPILE_SSL_LIB "gnutls"
    src/pycurl.h:#   define COMPILE_SSL_LIB "nss"
    src/pycurl.h:#  define COMPILE_SSL_LIB "none/other"
    src/pycurl.h:# define COMPILE_SSL_LIB "none/other"

Then at run-time it queries cURL for fetures/configuration to check if
link-time [run-time] and compile-time SSL backends match. In our case it
didn't manage to figure SSL backend at compile-time.

We explicitly select that we are using OpenSSL.

Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
  • Loading branch information
David Abdurachmanov authored and David Abdurachmanov committed Mar 2, 2016
1 parent 79fdda9 commit fa66506
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions py2-pycurl.spec
@@ -1,16 +1,15 @@
### RPM external py2-pycurl 7.19.3.1
## INITENV +PATH PYTHONPATH %i/$PYTHON_LIB_SITE_PACKAGES
Source: http://pycurl.sourceforge.net/download/pycurl-%realversion.tar.gz
Requires: python curl
### RPM external py2-pycurl 7.43.0
## INITENV +PATH PYTHONPATH %{i}/$PYTHON_LIB_SITE_PACKAGES
Source: https://dl.bintray.com/pycurl/pycurl/pycurl-%{realversion}.tar.gz
Requires: python curl openssl

%prep
%setup -n pycurl-%realversion
%setup -n pycurl-%{realversion}

%build
python setup.py build
python setup.py --with-openssl build

%install
python setup.py install --prefix=%i
find %i -name '*.egg-info' -exec rm {} \;
# Remove documentation.
%define drop_files %i/share
python setup.py --with-openssl install --prefix=%{i}
find %{i}/${PYTHON_LIB_SITE_PACKAGES} -name '*.egg-info' -print0 | xargs -0 rm -rf
rm -rf %{i}/share

0 comments on commit fa66506

Please sign in to comment.