From 87acb87dffa227329512079334fc2657197792a2 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Mon, 21 Apr 2014 16:14:27 +0200 Subject: use distutils --- .gitignore | 7 ++----- Makefile | 20 -------------------- setup.py | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 Makefile create mode 100755 setup.py diff --git a/.gitignore b/.gitignore index 6cb93c7..0436f0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -*.c -*.o -*.so -*.py -*.pyc +M2Crypto_ext_wrap.c +M2Crypto_ext.py diff --git a/Makefile b/Makefile deleted file mode 100644 index b682e4d..0000000 --- a/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -PYTHON_INCLUDES=$(shell python-config --includes) - -all: M2Crypto_ext - -clean: - $(RM) _M2Crypto_ext.so M2Crypto_ext.py* M2Crypto_ext_wrap.c M2Crypto_ext_wrap.o - -M2Crypto_ext: _M2Crypto_ext.so M2Crypto_ext.py - -M2Crypto_ext.py: M2Crypto_ext.i - swig -python -I/usr/include $< - -M2Crypto_ext_wrap.c: M2Crypto_ext.i - swig -python -I/usr/include $< - -M2Crypto_ext_wrap.o: M2Crypto_ext_wrap.c - gcc -O2 -fPIC -o $@ -c $< $(PYTHON_INCLUDES) - -_M2Crypto_ext.so: M2Crypto_ext_wrap.o - gcc -shared -o $@ $< diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..fcb2823 --- /dev/null +++ b/setup.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +from distutils.core import setup, Extension + +m2crypto_ext_module = Extension( + '_M2Crypto_ext', + sources=['M2Crypto_ext.i'], + swig_opts=['-I/usr/include'], + libraries=['ssl'] +) + +setup( + name = 'M2Crypto_ext', + version = '0.1.0', + author = "Alexander Sulfrian", + description = """Simple swig example from docs""", + ext_modules = [m2crypto_ext_module], + py_modules = ["M2Crypto_ext"], +) -- cgit v1.2.3-1-g7c22