1 # Makefile.am for the Python bindings.
2 # Copyright (C) 2016 g10 Code GmbH
4 # This file is part of GPGME.
6 # GPGME is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU Lesser General Public License as
8 # published by the Free Software Foundation; either version 2.1 of the
9 # License, or (at your option) any later version.
11 # GPGME is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14 # Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this program; if not, see <http://www.gnu.org/licenses/>.
23 helpers.c helpers.h private.h \
33 $(srcdir)/MANIFEST.in \
34 $(srcdir)/gpgme-h-clean.py \
36 $(srcdir)/helpers.c $(srcdir)/helpers.h $(srcdir)/private.h
39 $(srcdir)/gpg/callbacks.py \
40 $(srcdir)/gpg/constants \
41 $(srcdir)/gpg/core.py \
42 $(srcdir)/gpg/errors.py \
43 $(srcdir)/gpg/__init__.py \
44 $(srcdir)/gpg/results.py \
47 # For VPATH builds we need to copy some files because Python's
48 # distutils are not VPATH-aware.
49 copystamp: $(COPY_FILES) $(COPY_FILES_GPG)
50 set -e ; for VERSION in $(PYTHON_VERSIONS); do \
51 $(MKDIR_P) python$${VERSION}-gpg/gpg ; \
52 cp -R $(COPY_FILES) python$${VERSION}-gpg ; \
53 cp setup.py python$${VERSION}-gpg ; \
54 cp gpg/version.py python$${VERSION}-gpg/gpg ; \
55 ln -sf "$(abs_top_srcdir)/src/data.h" python$${VERSION}-gpg ; \
56 ln -sf "$(abs_top_builddir)/config.h" python$${VERSION}-gpg ; \
57 cp -R $(COPY_FILES_GPG) python$${VERSION}-gpg/gpg ; \
62 set -e ; set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \
63 PYTHON="$$1" ; shift ; \
64 cd python$${VERSION}-gpg && \
66 $$PYTHON setup.py build --verbose ; \
70 python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
71 python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc: copystamp
72 cd python$(PYTHON_VERSION)-gpg && \
74 $(PYTHON) setup.py sdist --verbose
75 gpg2 --detach-sign --armor python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz
81 sdist: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
82 python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
85 upload: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
86 python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
89 CLEANFILES = copystamp
93 # 'make distclean' clears the write bit, breaking rm -rf. Fix the
97 for VERSION in $(PYTHON_VERSIONS); do \
98 find python$${VERSION}-gpg -type d ! -perm -200 -exec chmod u+w {} ';' ; \
99 rm -rf -- python$${VERSION}-gpg ; \
103 rm -f install_files.txt
104 set -e ; set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \
105 PYTHON="$$1" ; shift ; \
106 cd python$${VERSION}-gpg ; \
107 $$PYTHON setup.py install \
108 --prefix $(DESTDIR)$(prefix) \
111 cat files.txt >> ../install_files.txt ; \
115 $(MKDIR_P) $(DESTDIR)$(pythondir)/gpg
116 mv install_files.txt $(DESTDIR)$(pythondir)/gpg
119 xargs <$(DESTDIR)$(pythondir)/gpg/install_files.txt -- rm -rf --
120 rm -rf -- $(DESTDIR)$(pythondir)/gpg