From 9efb17b3343616a88cdfddc024a3425518ad5019f3e48625324668389f4148e9 Mon Sep 17 00:00:00 2001
From: Denisart Benjamin
Date: Mon, 7 Dec 2015 22:54:48 +0000
Subject: [PATCH] Accepting request 347783 from home:dstoecker
Update to most recent version.
OBS-URL: https://build.opensuse.org/request/show/347783
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-M2Crypto?expand=0&rev=26
---
M2Crypto-0.22.3.tar.gz | 3 -
M2Crypto-0.22.5-SSLv2_link_error.patch | 12 ++++
M2Crypto-0.22.5.tar.gz | 3 +
python-M2Crypto-SWIG-3.0.5.patch | 94 --------------------------
python-M2Crypto.changes | 11 +++
python-M2Crypto.spec | 30 ++------
6 files changed, 33 insertions(+), 120 deletions(-)
delete mode 100644 M2Crypto-0.22.3.tar.gz
create mode 100644 M2Crypto-0.22.5-SSLv2_link_error.patch
create mode 100644 M2Crypto-0.22.5.tar.gz
delete mode 100644 python-M2Crypto-SWIG-3.0.5.patch
diff --git a/M2Crypto-0.22.3.tar.gz b/M2Crypto-0.22.3.tar.gz
deleted file mode 100644
index 906d3d4..0000000
--- a/M2Crypto-0.22.3.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6071bfc817d94723e9b458a010d565365104f84aa73f7fe11919871f7562ff72
-size 74795
diff --git a/M2Crypto-0.22.5-SSLv2_link_error.patch b/M2Crypto-0.22.5-SSLv2_link_error.patch
new file mode 100644
index 0000000..53bc1e2
--- /dev/null
+++ b/M2Crypto-0.22.5-SSLv2_link_error.patch
@@ -0,0 +1,12 @@
+diff -ur M2Crypto-0.22.5/SWIG/_ssl.i M2Crypto-0.22.5_fix/SWIG/_ssl.i
+--- M2Crypto-0.22.5/SWIG/_ssl.i 2015-10-13 16:34:30.000000000 +0200
++++ M2Crypto-0.22.5_fix/SWIG/_ssl.i 2015-12-07 14:24:14.302731623 +0100
+@@ -52,8 +52,6 @@
+ %rename(ssl_get_alert_desc_v) SSL_alert_desc_string_long;
+ extern const char *SSL_alert_desc_string_long(int);
+
+-%rename(sslv2_method) SSLv2_method;
+-extern SSL_METHOD *SSLv2_method(void);
+ %rename(sslv3_method) SSLv3_method;
+ extern SSL_METHOD *SSLv3_method(void);
+ %rename(sslv23_method) SSLv23_method;
diff --git a/M2Crypto-0.22.5.tar.gz b/M2Crypto-0.22.5.tar.gz
new file mode 100644
index 0000000..bc6dcb8
--- /dev/null
+++ b/M2Crypto-0.22.5.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b5ce9b09062a2c453e9d9c28dde96b7f90834313e60f419b143d751eb4109fdc
+size 80986
diff --git a/python-M2Crypto-SWIG-3.0.5.patch b/python-M2Crypto-SWIG-3.0.5.patch
deleted file mode 100644
index 7706dc6..0000000
--- a/python-M2Crypto-SWIG-3.0.5.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-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']:
diff --git a/python-M2Crypto.changes b/python-M2Crypto.changes
index 9917f25..e220f86 100644
--- a/python-M2Crypto.changes
+++ b/python-M2Crypto.changes
@@ -1,3 +1,14 @@
+-------------------------------------------------------------------
+Mon Dec 7 13:29:40 UTC 2015 - opensuse@dstoecker.de
+
+- fix SSLv2 link error for 13.2 and Leap 42.1 (M2Crypto-0.22.5-SSLv2_link_error.patch)
+
+-------------------------------------------------------------------
+Sat Dec 5 20:42:42 UTC 2015 - opensuse@dstoecker.de
+
+- update to 0.22.5, fix URL
+- drop python-M2Crypto-SWIG-3.0.5.patch (functionality included upstream)
+
-------------------------------------------------------------------
Thu Nov 26 09:35:28 UTC 2015 - hpj@urpla.net
diff --git a/python-M2Crypto.spec b/python-M2Crypto.spec
index b7c0902..08b5bcc 100644
--- a/python-M2Crypto.spec
+++ b/python-M2Crypto.spec
@@ -17,15 +17,15 @@
Name: python-M2Crypto
-Version: 0.22.3
+Version: 0.22.5
Release: 0
-Url: http://chandlerproject.org/bin/view/Projects/MeTooCrypto
+Url: https://gitlab.com/m2crypto/m2crypto
Summary: Crypto and SSL toolkit for Python
License: MIT and ZPL-2.0 and BSD-3-Clause
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-%{version}.tar.gz
-# PATCH-FIX-UPSTREAM python-M2Crypto-SWIG-3.0.5.patch -- https://github.com/martinpaljak/M2Crypto/issues/60
-Patch0: python-M2Crypto-SWIG-3.0.5.patch
+# PATCH-FIX-UPSTREAM M2Crypto-0.22.5-SSLv2_link_error.patch -- remove useless reference to SSL version 2
+Patch0: M2Crypto-0.22.5-SSLv2_link_error.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: openssl
BuildRequires: openssl-devel
@@ -39,10 +39,8 @@ BuildRequires: swig
%endif
%if 0%{?suse_version}
%py_requires
-%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
-%endif
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Provides: python-m2crypto = %{version}
Obsoletes: python-m2crypto < %{version}
@@ -58,35 +56,21 @@ HMAC'ing AuthCookies for web session management. FTP/TLS client and
server. S/MIME. ZServerSSL: A HTTPS server for Zope. ZSmime: An S/MIME
messenger for Zope.
-It currently lives at
-http://wiki.osafoundation.org/bin/view/Projects/MeTooCrypto. The
-original M2Crypto homepage is at http://sandbox.rulemaker.net/ngps/m2/.
-
%prep
%setup -n M2Crypto-%{version}
+%if 0%{?suse_version} >= 1315
%patch0 -p1
+%endif
%build
CFLAGS="%{optflags}" python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
-# The SWIG shadow file is not being installed by setup.py
-cp SWIG/_m2crypto.py %{buildroot}%{python_sitearch}/M2Crypto/
-
-# install demo files manually
-# (otherwise we can't perform %%fdupes on them the right way)
-#chmod 0644 demo/{https.howto/get_https,ssl/twistedsslclient,ssl/twistedsslserver,tinderbox/slave,x509/certdata2pem}.py
-export DOCDIR=%{buildroot}%{_docdir}/%{name}
-
-mkdir -p $DOCDIR
-%fdupes $DOCDIR
-
-install -m 644 README $DOCDIR
%files
%defattr(-,root,root)
-%doc %{_docdir}/%{name}
+%doc README
%{python_sitearch}/*
%changelog