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-11 17:42:56 +00:00
|
|
|
examples \
|
2017-04-05 16:47:08 +00:00
|
|
|
src
|
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
|
|
|
|
2017-03-28 18:55:59 +00:00
|
|
|
.PHONY: prepare
|
2017-04-01 23:29:52 +00:00
|
|
|
prepare: copystamp
|
2017-03-28 18:55:59 +00:00
|
|
|
|
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-04-01 23:29:52 +00:00
|
|
|
copystamp:
|
2017-04-05 16:47:08 +00:00
|
|
|
ln -sf "$(top_srcdir)/src/data.h" .
|
|
|
|
ln -sf "$(top_builddir)/config.h" .
|
|
|
|
ln -sf "$(srcdir)/src" gpg
|
2016-05-11 09:42:00 +00:00
|
|
|
touch $@
|
|
|
|
|
2016-07-11 14:38:37 +00:00
|
|
|
all-local: copystamp
|
2017-04-08 13:34:30 +00:00
|
|
|
set -e ; for PYTHON in $(PYTHONS); do \
|
2017-04-11 00:56:00 +00:00
|
|
|
CPP="$(CPP)" \
|
2016-09-29 07:30:58 +00:00
|
|
|
CFLAGS="$(CFLAGS)" \
|
2017-04-03 13:44:14 +00:00
|
|
|
srcdir="$(srcdir)" \
|
2017-04-05 16:47:08 +00:00
|
|
|
top_builddir="$(top_builddir)" \
|
2017-04-08 13:34:30 +00:00
|
|
|
$$PYTHON setup.py build --verbose --build-base="$$(basename "$${PYTHON}")-gpg" ; \
|
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.asc: copystamp
|
2017-04-01 23:29:52 +00:00
|
|
|
$(MKDIR_P) python$(PYTHON_VERSION)-gpg-dist
|
2017-04-11 00:56:00 +00:00
|
|
|
CPP="$(CPP)" \
|
2016-09-29 07:30:58 +00:00
|
|
|
CFLAGS="$(CFLAGS)" \
|
2017-04-03 13:44:14 +00:00
|
|
|
srcdir="$(srcdir)" \
|
2017-04-05 16:47:08 +00:00
|
|
|
top_builddir="$(top_builddir)" \
|
2017-04-01 23:29:52 +00:00
|
|
|
$(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
|
2016-07-11 14:38:37 +00:00
|
|
|
|
2016-07-12 14:20:35 +00:00
|
|
|
.PHONY: sdist
|
2017-04-01 23:29:52 +00:00
|
|
|
sdist: python$(PYTHON_VERSION)-gpg/dist/gpg-$(VERSION).tar.gz.asc
|
2016-07-12 14:20:35 +00:00
|
|
|
|
|
|
|
.PHONY: upload
|
2017-04-01 23:29:52 +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-04-01 23:29:52 +00:00
|
|
|
CLEANFILES = copystamp \
|
|
|
|
config.h \
|
|
|
|
data.h \
|
2017-04-10 13:24:03 +00:00
|
|
|
gpg
|
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-04-08 13:34:30 +00:00
|
|
|
for PYTHON in $(PYTHONS); do \
|
|
|
|
find "$$(basename "$${PYTHON}")-gpg" -type d ! -perm -200 -exec chmod u+w {} ';' ; \
|
|
|
|
rm -rf -- "$$(basename "$${PYTHON}")-gpg" ; \
|
2017-02-13 15:44:53 +00:00
|
|
|
done
|
2016-05-11 09:42:00 +00:00
|
|
|
|
|
|
|
install-exec-local:
|
2017-04-08 13:34:30 +00:00
|
|
|
set -e ; for PYTHON in $(PYTHONS); do \
|
2017-04-11 00:56:00 +00:00
|
|
|
CPP="$(CPP)" \
|
|
|
|
CFLAGS="$(CFLAGS)" \
|
2017-04-03 13:44:14 +00:00
|
|
|
srcdir="$(srcdir)" \
|
2017-04-05 16:47:08 +00:00
|
|
|
top_builddir="$(top_builddir)" \
|
2017-04-01 23:29:52 +00:00
|
|
|
$$PYTHON setup.py \
|
|
|
|
build \
|
2017-04-08 13:34:30 +00:00
|
|
|
--build-base="$$(basename "$${PYTHON}")-gpg" \
|
2017-04-01 23:29:52 +00:00
|
|
|
install \
|
|
|
|
--prefix "$(DESTDIR)$(prefix)" \
|
2016-09-14 08:22:07 +00:00
|
|
|
--verbose ; \
|
|
|
|
done
|
2016-05-11 09:42:00 +00:00
|
|
|
|
|
|
|
uninstall-local:
|
2017-04-10 13:20:34 +00:00
|
|
|
set -x; GV=$$(echo $(VERSION) | tr - _); for PYTHON in $(PYTHONS); do \
|
|
|
|
PLATLIB="$(prefix)/$$("$${PYTHON}" -c 'import sysconfig, os; print(os.path.relpath(sysconfig.get_path("platlib", scheme="posix_prefix"), sysconfig.get_config_var("prefix")))')" ; \
|
2017-04-08 13:34:30 +00:00
|
|
|
rm -rf -- "$(DESTDIR)$${PLATLIB}/gpg" \
|
|
|
|
"$(DESTDIR)$${PLATLIB}"/gpg-$$GV-py*.egg-info ; \
|
2017-04-03 13:44:14 +00:00
|
|
|
done
|