2016-05-11 09:42:00 +00:00
|
|
|
# Makefile.am for the Python bindings.
|
|
|
|
# Copyright (C) 2016 g10 Code GmbH
|
|
|
|
#
|
|
|
|
# This file is part of GPGME.
|
|
|
|
#
|
|
|
|
# GPGME is free software; you can redistribute it and/or modify it
|
2016-06-14 14:54:26 +00:00
|
|
|
# under the terms of the GNU Lesser General Public License as
|
|
|
|
# published by the Free Software Foundation; either version 2.1 of the
|
|
|
|
# License, or (at your option) any later version.
|
2016-05-11 09:42:00 +00:00
|
|
|
#
|
|
|
|
# GPGME is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
|
|
|
# Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2016-07-06 08:59:18 +00:00
|
|
|
EXTRA_DIST = \
|
|
|
|
README \
|
2016-07-11 17:42:56 +00:00
|
|
|
MANIFEST.in \
|
2016-07-06 08:59:18 +00:00
|
|
|
gpgme.i \
|
2016-07-28 08:20:20 +00:00
|
|
|
helpers.c helpers.h private.h \
|
2016-07-06 08:59:18 +00:00
|
|
|
gpgme-h-clean.py \
|
2016-07-11 17:42:56 +00:00
|
|
|
examples \
|
2016-10-28 20:45:49 +00:00
|
|
|
gpg
|
2016-07-06 08:59:18 +00:00
|
|
|
|
2016-09-20 17:58:00 +00:00
|
|
|
SUBDIRS = . tests
|
2016-05-11 09:42:00 +00:00
|
|
|
|
2016-06-06 12:08:59 +00:00
|
|
|
COPY_FILES = \
|
2016-07-11 14:38:37 +00:00
|
|
|
$(srcdir)/gpgme.i \
|
2016-06-06 12:08:59 +00:00
|
|
|
$(srcdir)/README \
|
2016-07-11 14:38:37 +00:00
|
|
|
$(srcdir)/MANIFEST.in \
|
|
|
|
$(srcdir)/gpgme-h-clean.py \
|
|
|
|
$(srcdir)/examples \
|
2016-07-28 08:20:20 +00:00
|
|
|
$(srcdir)/helpers.c $(srcdir)/helpers.h $(srcdir)/private.h
|
2016-06-06 12:08:59 +00:00
|
|
|
|
2016-10-28 20:45:49 +00:00
|
|
|
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
|
2016-08-02 16:42:26 +00:00
|
|
|
|
2017-03-28 18:55:59 +00:00
|
|
|
.PHONY: prepare
|
|
|
|
prepare:
|
|
|
|
test -n "$(PREPAREDIR)"
|
|
|
|
$(MKDIR_P) "$(PREPAREDIR)/gpg"
|
|
|
|
cp -R $(COPY_FILES) "$(PREPAREDIR)"
|
|
|
|
cp setup.py "$(PREPAREDIR)"
|
|
|
|
cp gpg/version.py "$(PREPAREDIR)/gpg"
|
|
|
|
ln -sf "$(abs_top_srcdir)/src/data.h" "$(PREPAREDIR)"
|
|
|
|
ln -sf "$(abs_top_builddir)/config.h" "$(PREPAREDIR)"
|
|
|
|
cp -R $(COPY_FILES_GPG) "$(PREPAREDIR)/gpg"
|
|
|
|
|
2016-05-11 09:42:00 +00:00
|
|
|
# For VPATH builds we need to copy some files because Python's
|
|
|
|
# distutils are not VPATH-aware.
|
2017-02-15 10:31:27 +00:00
|
|
|
copystamp: $(COPY_FILES) $(COPY_FILES_GPG)
|
2017-03-14 10:22:28 +00:00
|
|
|
set -e ; for VERSION in $(PYTHON_VERSIONS); do \
|
2017-03-28 18:55:59 +00:00
|
|
|
$(MAKE) PREPAREDIR=python$${VERSION}-gpg prepare; \
|
2017-02-13 15:44:53 +00:00
|
|
|
done
|
2016-05-11 09:42:00 +00:00
|
|
|
touch $@
|
|
|
|
|
2016-07-11 14:38:37 +00:00
|
|
|
all-local: copystamp
|
2017-03-14 10:22:28 +00:00
|
|
|
set -e ; set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \
|
2017-02-13 15:44:53 +00:00
|
|
|
PYTHON="$$1" ; shift ; \
|
|
|
|
cd python$${VERSION}-gpg && \
|
2016-09-29 07:30:58 +00:00
|
|
|
CFLAGS="$(CFLAGS)" \
|
2017-03-28 18:55:59 +00:00
|
|
|
abs_top_builddir="$(abs_top_builddir)" \
|
2017-02-15 10:31:27 +00:00
|
|
|
$$PYTHON setup.py build --verbose ; \
|
2017-02-13 15:44:53 +00:00
|
|
|
cd .. ; \
|
2016-09-14 08:22:07 +00:00
|
|
|
done
|
2016-05-11 09:42:00 +00:00
|
|
|
|
2017-02-15 10:31:27 +00:00
|
|
|
python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
|
|
|
|
python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc: copystamp
|
|
|
|
cd python$(PYTHON_VERSION)-gpg && \
|
2016-09-29 07:30:58 +00:00
|
|
|
CFLAGS="$(CFLAGS)" \
|
2017-03-28 18:55:59 +00:00
|
|
|
abs_top_builddir="$(abs_top_builddir)" \
|
2016-07-11 14:38:37 +00:00
|
|
|
$(PYTHON) setup.py sdist --verbose
|
2017-02-15 10:31:27 +00:00
|
|
|
gpg2 --detach-sign --armor python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz
|
2016-07-11 14:38:37 +00:00
|
|
|
|
2016-07-12 14:20:35 +00:00
|
|
|
.PHONY: sdist
|
2017-02-15 10:31:27 +00:00
|
|
|
sdist: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
|
|
|
|
python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
|
2016-07-12 14:20:35 +00:00
|
|
|
|
|
|
|
.PHONY: upload
|
2017-02-15 10:31:27 +00:00
|
|
|
upload: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz \
|
|
|
|
python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
|
2016-07-12 14:20:35 +00:00
|
|
|
twine upload $^
|
2016-07-11 14:38:37 +00:00
|
|
|
|
2017-02-15 10:31:27 +00:00
|
|
|
CLEANFILES = copystamp
|
2016-07-06 08:59:18 +00:00
|
|
|
|
|
|
|
# Remove the rest.
|
|
|
|
#
|
|
|
|
# 'make distclean' clears the write bit, breaking rm -rf. Fix the
|
|
|
|
# permissions.
|
|
|
|
clean-local:
|
|
|
|
rm -rf -- build
|
2017-02-13 15:44:53 +00:00
|
|
|
for VERSION in $(PYTHON_VERSIONS); do \
|
|
|
|
find python$${VERSION}-gpg -type d ! -perm -200 -exec chmod u+w {} ';' ; \
|
|
|
|
rm -rf -- python$${VERSION}-gpg ; \
|
|
|
|
done
|
2016-05-11 09:42:00 +00:00
|
|
|
|
|
|
|
install-exec-local:
|
2016-09-14 08:22:07 +00:00
|
|
|
rm -f install_files.txt
|
2017-03-14 10:22:28 +00:00
|
|
|
set -e ; set $(PYTHONS); for VERSION in $(PYTHON_VERSIONS); do \
|
2017-02-13 15:44:53 +00:00
|
|
|
PYTHON="$$1" ; shift ; \
|
2017-03-14 10:22:28 +00:00
|
|
|
cd python$${VERSION}-gpg ; \
|
2017-03-28 18:55:59 +00:00
|
|
|
abs_top_builddir="$(abs_top_builddir)" \
|
2017-02-15 10:31:27 +00:00
|
|
|
$$PYTHON setup.py install \
|
2016-05-11 09:42:00 +00:00
|
|
|
--prefix $(DESTDIR)$(prefix) \
|
2016-09-14 08:22:07 +00:00
|
|
|
--record files.txt \
|
|
|
|
--verbose ; \
|
2017-02-13 15:44:53 +00:00
|
|
|
cat files.txt >> ../install_files.txt ; \
|
2016-09-14 08:22:07 +00:00
|
|
|
rm files.txt ; \
|
2017-02-13 15:44:53 +00:00
|
|
|
cd .. ; \
|
2016-09-14 08:22:07 +00:00
|
|
|
done
|
2016-10-28 20:45:49 +00:00
|
|
|
$(MKDIR_P) $(DESTDIR)$(pythondir)/gpg
|
|
|
|
mv install_files.txt $(DESTDIR)$(pythondir)/gpg
|
2016-05-11 09:42:00 +00:00
|
|
|
|
|
|
|
uninstall-local:
|
2016-10-28 20:45:49 +00:00
|
|
|
xargs <$(DESTDIR)$(pythondir)/gpg/install_files.txt -- rm -rf --
|
|
|
|
rm -rf -- $(DESTDIR)$(pythondir)/gpg
|