diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am index e32fd125..908f622d 100644 --- a/lang/python/Makefile.am +++ b/lang/python/Makefile.am @@ -47,10 +47,12 @@ COPY_FILES_GPG = \ # For VPATH builds we need to copy some files because Python's # distutils are not VPATH-aware. copystamp: $(COPY_FILES) $(COPY_FILES_GPG) data.h config.h - if test "$(srcdir)" != "$(builddir)" ; then \ - cp -R $(COPY_FILES) . ; \ - cp -R $(COPY_FILES_GPG) gpg ; \ - fi + for VERSION in $(PYTHON_VERSIONS); do \ + $(MKDIR_P) python$${VERSION}-gpg/gpg && \ + cp -R $(COPY_FILES) python$${VERSION}-gpg && \ + cp gpg/version.py python$${VERSION}-gpg/gpg && \ + cp -R $(COPY_FILES_GPG) python$${VERSION}-gpg/gpg ; \ + done touch $@ data.h: @@ -60,9 +62,12 @@ config.h: ln -s "$(top_builddir)/config.h" . all-local: copystamp - for PYTHON in $(PYTHONS); do \ + set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \ + PYTHON="$$1" ; shift ; \ + cd python$${VERSION}-gpg && \ CFLAGS="$(CFLAGS)" \ - $$PYTHON setup.py build --verbose ; \ + $$PYTHON ../setup.py build --verbose ; \ + cd .. ; \ done dist/gpg-$(VERSION).tar.gz dist/gpg-$(VERSION).tar.gz.asc: copystamp @@ -89,23 +94,23 @@ CLEANFILES = gpgme.h errors.i gpgme_wrap.c gpg/gpgme.py \ # permissions. clean-local: rm -rf -- build - if test "$(srcdir)" != "$(builddir)" ; then \ - find . -type d ! -perm -200 -exec chmod u+w {} ';' ; \ - for F in $(COPY_FILES); do rm -rf -- `basename $$F` ; done ; \ - for F in $(COPY_FILES_GPG); do \ - rm -rf -- gpg/`basename $$F` ; \ - done ; \ - fi + for VERSION in $(PYTHON_VERSIONS); do \ + find python$${VERSION}-gpg -type d ! -perm -200 -exec chmod u+w {} ';' ; \ + rm -rf -- python$${VERSION}-gpg ; \ + done install-exec-local: rm -f install_files.txt - for PYTHON in $(PYTHONS); do \ - $$PYTHON setup.py install \ + set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \ + PYTHON="$$1" ; shift ; \ + cd python$${VERSION}-gpg && \ + $$PYTHON ../setup.py install \ --prefix $(DESTDIR)$(prefix) \ --record files.txt \ --verbose ; \ - cat files.txt >> install_files.txt ; \ + cat files.txt >> ../install_files.txt ; \ rm files.txt ; \ + cd .. ; \ done $(MKDIR_P) $(DESTDIR)$(pythondir)/gpg mv install_files.txt $(DESTDIR)$(pythondir)/gpg diff --git a/lang/python/tests/run-tests.py b/lang/python/tests/run-tests.py index 46c6d8c8..e76acb2a 100644 --- a/lang/python/tests/run-tests.py +++ b/lang/python/tests/run-tests.py @@ -69,7 +69,9 @@ for interpreter in args.interpreters: version = subprocess.check_output( [interpreter, "-c", "import sys; print('{0}.{1}'.format(sys.version_info[0], sys.version_info[1]))"]).strip().decode() - builddirs = glob.glob(os.path.join(args.builddir, "..", "build", + builddirs = glob.glob(os.path.join(args.builddir, "..", + "python{0}-gpg".format(version), + "build", "lib*"+version)) assert len(builddirs) == 1, \ "Expected one build directory, got {0}".format(builddirs)