Pages

2012-01-03

Tips for building Python 2.5.6 with SSL on CentOS 6.2 (x86_64)

You need to edit the following files because of the headers and libraries paths on 64bit CentOS.
  • Modules/Setup.dist (Python 2.5.6)
  • setup.py (ssl package)
First, edit Modules/Setup.dist as follows (patch file on Google Docs page):

--- Modules/Setup.dist.orig 2006-08-06 07:26:21.000000000 +0000
+++ Modules/Setup.dist 2012-01-02 16:09:27.904863909 +0000
@@ -203,10 +203,10 @@
 
 # Socket module helper for SSL support; you must comment out the other
 # socket line above, and possibly edit the SSL variable:
-#SSL=/usr/local/ssl
-#_ssl _ssl.c \
-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-# -L$(SSL)/lib -lssl -lcrypto
+SSL=/usr
+_ssl _ssl.c \
+ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+ -L$(SSL)/lib64 -lssl -lcrypto
 
 # The crypt module is now disabled by default because it breaks builds
 # on many systems (where -lcrypt is needed), e.g. Linux (I believe).

Then build Python 2.5.6 as usual.

Next, you may need ssl package from pypi.
Edit setup.py as follows (patch file on Google Docs page):

--- setup.py.orig 2009-07-28 00:45:12.000000000 +0000
+++ setup.py 2012-01-02 16:40:09.447439694 +0000
@@ -130,7 +130,8 @@
             ssl_incs += krb5_h
 
     ssl_libs = find_library_file(compiler, 'ssl',
-                                 ['/usr/lib'],
+                                 ['/usr/lib',
+                                  '/usr/lib64'],
                                  ['/usr/local/lib',
                                   '/usr/local/ssl/lib',
                                   '/usr/contrib/ssl/lib/'

Then, build the package with make.

cf. Getting SSL Support in Python 2.5.1

No comments: