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
|
|
|
|
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:
|
|
|
|
ln -sf "$(abs_top_srcdir)/src/data.h" .
|
|
|
|
ln -sf "$(abs_top_builddir)/config.h" .
|
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 ; \
|
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-04-01 23:29:52 +00:00
|
|
|
$$PYTHON setup.py build --verbose --build-base=python$${VERSION}-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
|
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-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 \
|
|
|
|
files.txt \
|
|
|
|
install_files.txt
|
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:
|
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-28 18:55:59 +00:00
|
|
|
abs_top_builddir="$(abs_top_builddir)" \
|
2017-04-01 23:29:52 +00:00
|
|
|
$$PYTHON setup.py \
|
|
|
|
build \
|
|
|
|
--build-base=python$${VERSION}-gpg \
|
|
|
|
install \
|
|
|
|
--prefix "$(DESTDIR)$(prefix)" \
|
2016-09-14 08:22:07 +00:00
|
|
|
--record files.txt \
|
|
|
|
--verbose ; \
|
2017-04-01 23:29:52 +00:00
|
|
|
cat files.txt >> install_files.txt ; \
|
2016-09-14 08:22:07 +00:00
|
|
|
rm files.txt ; \
|
|
|
|
done
|
2017-04-01 23:29:52 +00:00
|
|
|
$(MKDIR_P) "$(DESTDIR)$(pythondir)/gpg"
|
|
|
|
mv install_files.txt "$(DESTDIR)$(pythondir)/gpg"
|
2016-05-11 09:42:00 +00:00
|
|
|
|
|
|
|
uninstall-local:
|
2017-04-01 23:29:52 +00:00
|
|
|
xargs < "$(DESTDIR)$(pythondir)/gpg/install_files.txt" -- rm -rf --
|
|
|
|
rm -rf -- "$(DESTDIR)$(pythondir)/gpg"
|