From 007382ce94a6318557370c440f7d609a030a119e Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 11 Jul 2016 16:38:37 +0200 Subject: python: Enable out-of-tree build of pyme bindings. * lang/python/MANIFEST.in: Update manifest template. * lang/python/Makefile.am: Copy more files, move generation of files to Python build script, add 'sdist' target to build a Python source distribution. * lang/python/gpgme-h-clean.py: Add code to build 'errors.i'. * lang/python/setup.py.in: Generate files, enable out-of-tree builds. Signed-off-by: Justus Winter --- lang/python/Makefile.am | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'lang/python/Makefile.am') diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am index 527212a2..89b1c28c 100644 --- a/lang/python/Makefile.am +++ b/lang/python/Makefile.am @@ -26,34 +26,30 @@ EXTRA_DIST = \ SUBDIRS = tests COPY_FILES = \ + $(srcdir)/gpgme.i \ $(srcdir)/README \ + $(srcdir)/MANIFEST.in \ + $(srcdir)/gpgme-h-clean.py \ $(srcdir)/pyme \ + $(srcdir)/examples \ $(srcdir)/helpers.c $(srcdir)/helpers.h -# Cleanup gpgme.h from deprecated functions and typedefs. -gpgme.h: ../../src/gpgme.h $(srcdir)/gpgme-h-clean.py - $(PYTHON) $(srcdir)/gpgme-h-clean.py $< >$@ - # For VPATH builds we need to copy some files because Python's # distutils are not VPATH-aware. copystamp: $(COPY_FILES) if test "$(srcdir)" != "$(builddir)" ; then cp -r $^ . ; fi touch $@ -errors.i: - sed -n -e \ - '/GPG_ERR_[^ ]* =/s/ *\(.*\) = .*/%constant long \1 = \1;/p' \ - `$(GPG_ERROR_CONFIG) --prefix`/include/gpg-error.h >$@ - -gpgme_wrap.c pyme/pygpgme.py: gpgme.i errors.i gpgme.h copystamp - $(SWIG) -python -py3 -builtin $(SWIGOPT) \ - -o $(builddir)/gpgme_wrap.c -outdir $(builddir)/pyme \ - $< - -all-local: gpgme_wrap.c pyme/pygpgme.py copystamp +all-local: copystamp CFLAGS="$(CFLAGS) -I$(top_srcdir)" \ $(PYTHON) setup.py build --verbose +dist/pyme3-$(VERSION).tar.gz: copystamp + CFLAGS="$(CFLAGS) -I$(top_srcdir)" \ + $(PYTHON) setup.py sdist --verbose + +sdist: dist/pyme3-$(VERSION).tar.gz + CLEANFILES = gpgme.h errors.i gpgme_wrap.c pyme/pygpgme.py \ copystamp @@ -65,7 +61,7 @@ clean-local: rm -rf -- build if test "$(srcdir)" != "$(builddir)" ; then \ find . -type d ! -perm -200 -exec chmod u+w {} ';' ; \ - rm -rf README pyme helpers.c helpers.h ; \ + for F in $(COPY_FILES); do rm -rf -- `basename $$F` ; done ; \ fi install-exec-local: -- cgit v1.2.3