diff --git a/lang/python/INSTALL b/lang/python/INSTALL
deleted file mode 100644
index 18ece206..00000000
--- a/lang/python/INSTALL
+++ /dev/null
@@ -1,15 +0,0 @@
-To build pyme module without installing it run 'make'.
-
-To install pyme module run 'make install'. The module will be installed in the
-site-packages subdirectory of the python library directory.
-
-To delete all files generated during build run 'make reallyclean'
-
-To build documentation run 'make docs'. HTML files will be generated in 'doc'
-subdirectory.
-
-To build distribution files including Debian packages run 'make dist'
-To build distribution archive without Debian packages and without debian
- subdirectory run 'make nondeb-dist'
-Note, Debian packages and distribution archive will be generated in the parent
- directory.
diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
index 8f0e74f9..527212a2 100644
--- a/lang/python/Makefile.am
+++ b/lang/python/Makefile.am
@@ -16,7 +16,13 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see .
-EXTRA_DIST = README
+EXTRA_DIST = \
+ README \
+ gpgme.i \
+ helpers.c helpers.h \
+ gpgme-h-clean.py \
+ pyme
+
SUBDIRS = tests
COPY_FILES = \
@@ -48,11 +54,18 @@ all-local: gpgme_wrap.c pyme/pygpgme.py copystamp
CFLAGS="$(CFLAGS) -I$(top_srcdir)" \
$(PYTHON) setup.py build --verbose
-clean-local:
- rm -rf -- build gpgme.h errors.i gpgme_wrap.c pyme/pygpgme.py \
+CLEANFILES = gpgme.h errors.i gpgme_wrap.c pyme/pygpgme.py \
copystamp
+
+# Remove the rest.
+#
+# 'make distclean' clears the write bit, breaking rm -rf. Fix the
+# permissions.
+clean-local:
+ rm -rf -- build
if test "$(srcdir)" != "$(builddir)" ; then \
- rm -rf pyme helpers.c helpers.h ; \
+ find . -type d ! -perm -200 -exec chmod u+w {} ';' ; \
+ rm -rf README pyme helpers.c helpers.h ; \
fi
install-exec-local:
diff --git a/lang/python/tests/Makefile.am b/lang/python/tests/Makefile.am
index b51562cc..69985bb0 100644
--- a/lang/python/tests/Makefile.am
+++ b/lang/python/tests/Makefile.am
@@ -49,9 +49,8 @@ py_tests = t-wrapper.py \
t-file-name.py \
t-idiomatic.py
-TESTS = $(top_srcdir)/tests/gpg/initial.test \
- $(py_tests) \
- $(top_srcdir)/tests/gpg/final.test
+TESTS = initial.py $(py_tests) final.py
+EXTRA_DIST = support.py $(TESTS)
CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
gpg-agent.conf pubring.kbx~ gpg.conf pubring.gpg~ \
@@ -73,7 +72,7 @@ check-local: ./gpg.conf ./gpg-agent.conf ./pubring-stamp \
# To guarantee that check-local is run before any tests we
# add this dependency:
-$(top_srcdir)/tests/gpg/initial.test: check-local
+initial.py: check-local
./private-keys-v1.d/gpg-sample.stamp: $(private_keys)
test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
diff --git a/lang/python/tests/final.py b/lang/python/tests/final.py
new file mode 100755
index 00000000..f75c2007
--- /dev/null
+++ b/lang/python/tests/final.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 g10 Code GmbH
+#
+# This file is part of GPGME.
+#
+# GPGME is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# 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 .
+
+import os
+import subprocess
+
+subprocess.check_call([os.path.join(os.getenv('top_srcdir'),
+ "tests", "start-stop-agent"), "--stop"])
diff --git a/lang/python/tests/initial.py b/lang/python/tests/initial.py
new file mode 100755
index 00000000..9d72cbcd
--- /dev/null
+++ b/lang/python/tests/initial.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 g10 Code GmbH
+#
+# This file is part of GPGME.
+#
+# GPGME is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# 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 .
+
+import os
+import subprocess
+
+subprocess.check_call([os.path.join(os.getenv('top_srcdir'),
+ "tests", "start-stop-agent"), "--start"])