Alberto Planas Dominguez
f1553254a2
Please get this some exposure in d:l:p to see if it results in new issues; in oS:F, this package is currently build disabled so it stays as a swig 3.0.4 generated one... but that can't stay like this forever of course... with this patch, the package crda builds again when python-M2Crypto is built using swig 3.0.5... OBS-URL: https://build.opensuse.org/request/show/287536 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-M2Crypto?expand=0&rev=21
95 lines
3.1 KiB
Diff
95 lines
3.1 KiB
Diff
Index: M2Crypto-0.22.3/M2Crypto/__init__.py
|
|
===================================================================
|
|
--- M2Crypto-0.22.3.orig/M2Crypto/__init__.py
|
|
+++ M2Crypto-0.22.3/M2Crypto/__init__.py
|
|
@@ -19,7 +19,7 @@ Copyright 2008-2011 Heikki Toivonen. All
|
|
version_info = (0, 22)
|
|
version = '.'.join([str(_v) for _v in version_info])
|
|
|
|
-import __m2crypto
|
|
+import _m2crypto
|
|
import m2
|
|
import ASN1
|
|
import AuthCookie
|
|
Index: M2Crypto-0.22.3/M2Crypto/m2.py
|
|
===================================================================
|
|
--- M2Crypto-0.22.3.orig/M2Crypto/m2.py
|
|
+++ M2Crypto-0.22.3/M2Crypto/m2.py
|
|
@@ -25,7 +25,7 @@ Portions created by Open Source Applicat
|
|
Copyright (C) 2004 OSAF. All Rights Reserved.
|
|
"""
|
|
|
|
-from __m2crypto import *
|
|
+from _m2crypto import *
|
|
lib_init()
|
|
|
|
|
|
Index: M2Crypto-0.22.3/SWIG/_lib.i
|
|
===================================================================
|
|
--- M2Crypto-0.22.3.orig/SWIG/_lib.i
|
|
+++ M2Crypto-0.22.3/SWIG/_lib.i
|
|
@@ -66,6 +66,8 @@ int ssl_verify_callback(int ok, X509_STO
|
|
int cret;
|
|
int new_style_callback = 0, warning_raised_exception=0;
|
|
PyGILState_STATE gilstate;
|
|
+ PyObject *self = 0;
|
|
+ (void)self;
|
|
|
|
ssl = (SSL *)X509_STORE_CTX_get_app_data(ctx);
|
|
|
|
@@ -151,6 +153,8 @@ int ssl_verify_callback(int ok, X509_STO
|
|
void ssl_info_callback(const SSL *s, int where, int ret) {
|
|
PyObject *argv, *retval, *_SSL;
|
|
PyGILState_STATE gilstate;
|
|
+ PyObject *self = 0;
|
|
+ (void)self;
|
|
|
|
gilstate = PyGILState_Ensure();
|
|
|
|
@@ -170,6 +174,8 @@ DH *ssl_set_tmp_dh_callback(SSL *ssl, in
|
|
PyObject *argv, *ret, *_ssl;
|
|
DH *dh;
|
|
PyGILState_STATE gilstate;
|
|
+ PyObject *self = 0;
|
|
+ (void)self;
|
|
|
|
gilstate = PyGILState_Ensure();
|
|
|
|
@@ -193,6 +199,8 @@ RSA *ssl_set_tmp_rsa_callback(SSL *ssl,
|
|
PyObject *argv, *ret, *_ssl;
|
|
RSA *rsa;
|
|
PyGILState_STATE gilstate;
|
|
+ PyObject *self = 0;
|
|
+ (void)self;
|
|
|
|
gilstate = PyGILState_Ensure();
|
|
|
|
Index: M2Crypto-0.22.3/SWIG/_pkcs7.i
|
|
===================================================================
|
|
--- M2Crypto-0.22.3.orig/SWIG/_pkcs7.i
|
|
+++ M2Crypto-0.22.3/SWIG/_pkcs7.i
|
|
@@ -157,6 +157,8 @@ PyObject *smime_read_pkcs7(BIO *bio) {
|
|
BIO *bcont = NULL;
|
|
PKCS7 *p7;
|
|
PyObject *tuple, *_p7, *_BIO;
|
|
+ PyObject *self = 0;
|
|
+ (void)self;
|
|
|
|
if (BIO_method_type(bio) == BIO_TYPE_MEM) {
|
|
/* OpenSSL FAQ explains that this is needed for mem BIO to return EOF,
|
|
Index: M2Crypto-0.22.3/setup.py
|
|
===================================================================
|
|
--- M2Crypto-0.22.3.orig/setup.py
|
|
+++ M2Crypto-0.22.3/setup.py
|
|
@@ -76,7 +76,9 @@ class _M2CryptoBuildExt(build_ext.build_
|
|
self.swig_opts = ['-I%s' % i for i in self.include_dirs + \
|
|
[opensslIncludeDir, os.path.join(opensslIncludeDir, "openssl")]]
|
|
self.swig_opts.append('-includeall')
|
|
- self.swig_opts.append('-modern')
|
|
+ ##self.swig_opts.append('-modern')
|
|
+ self.swig_opts.append('-builtin')
|
|
+ self.swig_opts.append('-relativeimport')
|
|
|
|
# Fedora does hat tricks.
|
|
if platform.linux_distribution()[0] in ['Fedora', 'CentOS']:
|