diff options
author | Alon Bar-Lev <[email protected]> | 2017-04-05 16:47:08 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-04-07 10:12:20 +0000 |
commit | 49195c487e6c923f7137f092b982e7d833d98de6 (patch) | |
tree | 5be39ddc018fcba7771e0c77ca0ae607e7435d66 /lang/python/Makefile.am | |
parent | python: Fix vpath builds, fix distcheck. (diff) | |
download | gpgme-49195c487e6c923f7137f092b982e7d833d98de6.tar.gz gpgme-49195c487e6c923f7137f092b982e7d833d98de6.zip |
python: simplify build, some fixups
* lang/python/gpg/version.py.in: Rename to lang/python/version.py.in.
configure.ac: Generate version.py.in in lang/python.
* lang/python/MANIFEST.in: Include version.py explicitly.
* lang/python/gpg: Rename to 'src'.
* lang/python/Makefile.am: Do not copy source files, do not use absolute
directories, support lib64 in uninstall, clean also dist directory, use
symlink for gpg src.
* lang/python/setup.py.in: Use builddir, copy sources into builddir,
copy version.py into module.
--
Simplify build to symlink the gpg sources into builddir instead of
copying. This requires handling of version.py as generated file.
In addition apply some cleanups: Drop the absolution pathes, clean the
dist directory as well, support lib64 for sitelib at uninstall.
Signed-off-by: Alon Bar-Lev <[email protected]>
Diffstat (limited to 'lang/python/Makefile.am')
-rw-r--r-- | lang/python/Makefile.am | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am index 42beeee2..4ebd214e 100644 --- a/lang/python/Makefile.am +++ b/lang/python/Makefile.am @@ -22,28 +22,19 @@ EXTRA_DIST = \ gpgme.i \ helpers.c helpers.h private.h \ examples \ - gpg + src SUBDIRS = . tests -COPY_FILES_GPG = \ - $(srcdir)/gpg/callbacks.py \ - $(srcdir)/gpg/constants \ - $(srcdir)/gpg/core.py \ - $(srcdir)/gpg/errors.py \ - $(srcdir)/gpg/__init__.py \ - $(srcdir)/gpg/results.py \ - $(srcdir)/gpg/util.py - .PHONY: prepare prepare: copystamp # For VPATH builds we need to copy some files because Python's # distutils are not VPATH-aware. copystamp: - ln -sf "$(abs_top_srcdir)/src/data.h" . - ln -sf "$(abs_top_builddir)/config.h" . - if test $(srcdir) != . ; then cp -R $(COPY_FILES_GPG) gpg ; fi + ln -sf "$(top_srcdir)/src/data.h" . + ln -sf "$(top_builddir)/config.h" . + ln -sf "$(srcdir)/src" gpg touch $@ all-local: copystamp @@ -51,7 +42,7 @@ all-local: copystamp PYTHON="$$1" ; shift ; \ CFLAGS="$(CFLAGS)" \ srcdir="$(srcdir)" \ - abs_top_builddir="$(abs_top_builddir)" \ + top_builddir="$(top_builddir)" \ $$PYTHON setup.py build --verbose --build-base=python$${VERSION}-gpg ; \ done @@ -59,7 +50,7 @@ python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc: copystamp $(MKDIR_P) python$(PYTHON_VERSION)-gpg-dist CFLAGS="$(CFLAGS)" \ srcdir="$(srcdir)" \ - abs_top_builddir="$(abs_top_builddir)" \ + top_builddir="$(top_builddir)" \ $(PYTHON) setup.py sdist --verbose --dist-dir=python$(PYTHON_VERSION)-gpg-dist \ --manifest=python$(PYTHON_VERSION)-gpg-dist/MANIFEST gpg2 --detach-sign --armor python$(PYTHON_VERSION)-gpg-dist/gpg-$(VERSION).tar.gz @@ -75,6 +66,7 @@ upload: python$(PYTHON_VERSION)-gpg-dist/gpg-$(VERSION).tar.gz \ CLEANFILES = copystamp \ config.h \ data.h \ + gpg \ files.txt \ install_files.txt @@ -84,22 +76,16 @@ CLEANFILES = copystamp \ # permissions. clean-local: rm -rf -- build - if test $(srcdir) != . ; then \ - find gpg -type d ! -perm -200 -exec chmod u+w {} ';' ; \ - for FILE in $(COPY_FILES_GPG); do \ - rm -rf -- gpg/$$(basename $$FILE) ; \ - 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 ; \ + find python$${VERSION}-gpg* -type d ! -perm -200 -exec chmod u+w {} ';' ; \ + rm -rf -- python$${VERSION}-gpg* ; \ done install-exec-local: set -e ; set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \ PYTHON="$$1" ; shift ; \ srcdir="$(srcdir)" \ - abs_top_builddir="$(abs_top_builddir)" \ + top_builddir="$(top_builddir)" \ $$PYTHON setup.py \ build \ --build-base=python$${VERSION}-gpg \ @@ -110,6 +96,6 @@ install-exec-local: uninstall-local: GV=$$(echo $(VERSION) | tr - _); for PV in $(PYTHON_VERSIONS); do \ - rm -rf -- "$(DESTDIR)$(prefix)/lib/python$$PV/site-packages/gpg" \ -"$(DESTDIR)$(prefix)/lib/python$$PV/site-packages/gpg-$$GV-py$$PV.egg-info" ; \ + rm -rf -- "$(DESTDIR)$(prefix)"/lib*/python$$PV/site-packages/gpg \ +"$(DESTDIR)$(prefix)"/lib*/python$$PV/site-packages/gpg-$$GV-py$$PV.egg-info ; \ done |