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
|
2018-11-16 12:27:33 +00:00
|
|
|
# License along with this program; if not, see <https://gnu.org/licenses/>.
|
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2016-05-11 09:42:00 +00:00
|
|
|
|
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 \
|
2019-05-06 14:08:26 +00:00
|
|
|
helpers.c helpers.h private.h
|
2016-07-06 08:59:18 +00:00
|
|
|
|
2023-05-28 17:45:48 +00:00
|
|
|
if RUN_GPG_TESTS
|
|
|
|
tests = tests
|
|
|
|
else
|
|
|
|
tests =
|
|
|
|
endif
|
|
|
|
|
|
|
|
SUBDIRS = . ${tests} examples doc src
|
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" .
|
2018-10-05 13:14:58 +00:00
|
|
|
ln -sf "$(top_builddir)/conf/config.h" .
|
2017-04-05 16:47:08 +00:00
|
|
|
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
|
2018-10-04 08:11:01 +00:00
|
|
|
gpgbin=gpgconf --list-components | grep OpenPGP | sed -e 's/gpg:OpenPGP://g'
|
|
|
|
$(gpgbin) --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
|