use this patch instead

Matthew Rodriguez DSD staff <[email protected]>
Newsgroups gmane.comp.python.cryptography
Message-ID <[email protected]>
There was problem with my last patch. I hadn't removed of all 
occurrences to the deprecated string module.

Matt Rodriguez
setup.py.patch (text/x-patch, 1.4 KB)
--- setup.py	2005-11-07 10:55:36.000000000 -0800
+++ /home/portnoy/u5/mateo/Python/M2Crypto/branches/0.15/setup.py	2005-11-07 11:15:39.000000000 -0800
@@ -12,6 +12,29 @@
 from distutils.core import setup, Extension
 from distutils.command import build_ext
 
+global_option_dict = {'openssl_prefix': '/usr'}
+
+def print_help():
+    print "M2Crypto help"
+    print "--openssl=path_to_openssl, defaults to /usr"
+    print "--help, this usage message"
+    
+def parse_args():
+    global global_option_dict
+    args = sys.argv[1:]
+    for arg in args:
+        if arg.find("--openssl") != -1:
+            sys.argv.remove(arg)
+            prefix = arg.split('=')[1]
+            global_option_dict['openssl_prefix'] = prefix 
+        
+        if arg.find("--help") != -1:
+            sys.argv.remove(arg)
+            print_help()
+            sys.exit(0)
+
+parse_args() 
+
 if sys.version_info < (2,4):
 
     # This copy of swig_sources is from Python 2.2.
@@ -74,8 +97,10 @@
     extra_compile_args = [ "-DTHREADING" ]
 
 elif os.name == 'posix':
-    include_dirs = [my_inc, '/usr/include']
-    library_dirs = ['/usr/lib']
+    include_dir = os.path.join(global_option_dict['openssl_prefix'], "include") 
+    include_dirs = [my_inc, include_dir]
+    library_dir = os.path.join(global_option_dict['openssl_prefix'], "lib") 
+    library_dirs = [library_dir]
     libraries = ['ssl', 'crypto']
     extra_compile_args = [ "-DTHREADING" ]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.