blob: 95d6eecf4813f4ef0c3f9bee6376006cc7ae30d6 [file] [log] [blame]
Patrick Williamsd849ec72016-08-17 14:59:38 -05001HOMEPAGE = "http://chandlerproject.org/bin/view/Projects/MeTooCrypto"
2SUMMARY = "A Python crypto and SSL toolkit"
3DESCRIPTION = "\
4 M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, \
5 DSA, DH, EC, HMACs, message digests, symmetric ciphers (including \
6 AES); SSL functionality to implement clients and servers; HTTPS \
7 extensions to Python's httplib, urllib, and xmlrpclib; unforgeable \
8 HMAC'ing AuthCookies for web session management; FTP/TLS client and \
9 server; S/MIME; ZServerSSL: A HTTPS server for Zope and ZSmime: An \
10 S/MIME messenger for Zope. M2Crypto can also be used to provide SSL \
11 for Twisted. \
12 "
13LICENSE = "BSD"
14LIC_FILES_CHKSUM = "file://PKG-INFO;md5=0ccca7097c1d29fa42e75e9c15c6ff2e"
15
16SRCNAME = "M2Crypto"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050017SRC_URI = "http://pypi.python.org/packages/source/M/M2Crypto/${SRCNAME}-${PV}.tar.gz \
Patrick Williamsd849ec72016-08-17 14:59:38 -050018 file://m2crypto-Fix-build-with-SWIG-3.0.5.patch \
19"
20
21SRC_URI[md5sum] = "573f21aaac7d5c9549798e72ffcefedd"
22SRC_URI[sha256sum] = "6071bfc817d94723e9b458a010d565365104f84aa73f7fe11919871f7562ff72"
23
24S = "${WORKDIR}/${SRCNAME}-${PV}"
25
26inherit setuptools
27
28DEPENDS += "openssl swig-native"
29
30DISTUTILS_BUILD_ARGS += "build_ext -I${STAGING_INCDIR}"
31
32inherit setuptools
33
34SWIG_FEATURES_x86-64 = "-D__x86_64__"
35SWIG_FEATURES ?= ""
36export SWIG_FEATURES
37
38# Get around a problem with swig, but only if the
39# multilib header file exists.
40#
41do_compile_prepend() {
42 sed -i -e 's/self.add_multiarch_paths.*$/# &/;' ${S}/setup.py
43 sed -i -e 's/opensslIncludeDir = .*$/opensslIncludeDir = os.getenv("STAGING_INCDIR")/;' ${S}/setup.py
44 sed -i -e 's/opensslLibraryDir = .*$/opensslLibraryDir = os.getenv("STAGING_LIBDIR")/;' ${S}/setup.py
45
46 if [ "${SITEINFO_BITS}" = "64" ];then
47 bit="64"
48 else
49 bit="32"
50 fi
51
52 if [ -e ${STAGING_INCDIR}/openssl/opensslconf-${bit}.h ]; then
53 for i in SWIG/_ec.i SWIG/_evp.i; do
54 sed -i -e "s/opensslconf.*\./opensslconf-${bit}\./" "$i"
55 done
56 elif [ -e ${STAGING_INCDIR}/openssl/opensslconf-n${bit}.h ] ;then
57 for i in SWIG/_ec.i SWIG/_evp.i; do
58 sed -i -e "s/opensslconf.*\./opensslconf-n${bit}\./" "$i"
59 done
60 fi
61}
62