代码改变世界

pyOpenSSL0.13安装失败

2013-11-11 16:51  cmsd  阅读(1967)  评论(0编辑  收藏  举报
/usr/lib64/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'zip_safe'
  warnings.warn(msg)
running build_ext
building 'OpenSSL.SSL' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC -I/usr/local/ssl/include -I/usr/include/python2.4 -c OpenSSL/ssl/connection.c -o build/temp.linux-x86_64-2.4/OpenSSL/ssl/connection.o
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_context’:
OpenSSL/ssl/connection.c:289: warning: implicit declaration of function ‘SSL_set_SSL_CTX’
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_get_servername’:
OpenSSL/ssl/connection.c:313: error: ‘TLSEXT_NAMETYPE_host_name’ undeclared (first use in this function)
OpenSSL/ssl/connection.c:313: error: (Each undeclared identifier is reported only once
OpenSSL/ssl/connection.c:313: error: for each function it appears in.)
OpenSSL/ssl/connection.c:320: warning: implicit declaration of function ‘SSL_get_servername’
OpenSSL/ssl/connection.c:320: warning: assignment makes pointer from integer without a cast
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_tlsext_host_name’:
OpenSSL/ssl/connection.c:346: warning: implicit declaration of function ‘SSL_set_tlsext_host_name’
error: command 'gcc' failed with exit status 1

解决办法:

wget https://bugs.launchpad.net/pyopenssl/+bug/845445/+attachment/2666639/+files/pyOpenSSL-0.13.centos5.patch
# wget http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz 
# tar xf pyOpenSSL-0.13.tar.gz 
# cd pyOpenSSL-0.13 
[root@uyhd000461 pyOpenSSL-0.13]# grep "#define OPENSSL_VERSION_TEXT" /usr/include/openssl/opensslv.h 
#define OPENSSL_VERSION_TEXT    "OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008"
#define OPENSSL_VERSION_TEXT    "OpenSSL 0.9.8e-rhel5 01 Jul 2008"
[root@uyhd000461 pyOpenSSL-0.13]# patch -p1 < pyOpenSSL-0.13.centos5.patch
patching file OpenSSL/ssl/connection.c
patching file OpenSSL/ssl/context.c

然后python setup.py install 就ok  

 

转自:http://www.gm100861.com/281.html