python: Fix distcheck.

* lang/python/INSTALL: Drop obsolete file.
* lang/python/Makefile.am (EXTRA_DIST): Add missing files.
(CLEANFILES): Remove generated files.
(clean-local): Fix permissions of copied files.
* lang/python/tests/Makefile.am (TESTS): Use our own setup and
teardown scripts.
(EXTRA_DIST): Add missing files.
* lang/python/tests/final.py: New file.
* lang/python/tests/initial.py: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-07-06 10:59:18 +02:00
parent 38c408560c
commit 52efcf1ee9
5 changed files with 68 additions and 23 deletions

View File

@ -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.

View File

@ -16,7 +16,13 @@
# You should have received a copy of the GNU Lesser General Public # 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/>. # License along with this program; if not, see <http://www.gnu.org/licenses/>.
EXTRA_DIST = README EXTRA_DIST = \
README \
gpgme.i \
helpers.c helpers.h \
gpgme-h-clean.py \
pyme
SUBDIRS = tests SUBDIRS = tests
COPY_FILES = \ COPY_FILES = \
@ -48,11 +54,18 @@ all-local: gpgme_wrap.c pyme/pygpgme.py copystamp
CFLAGS="$(CFLAGS) -I$(top_srcdir)" \ CFLAGS="$(CFLAGS) -I$(top_srcdir)" \
$(PYTHON) setup.py build --verbose $(PYTHON) setup.py build --verbose
clean-local: CLEANFILES = gpgme.h errors.i gpgme_wrap.c pyme/pygpgme.py \
rm -rf -- build gpgme.h errors.i gpgme_wrap.c pyme/pygpgme.py \
copystamp 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 \ 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 fi
install-exec-local: install-exec-local:

View File

@ -49,9 +49,8 @@ py_tests = t-wrapper.py \
t-file-name.py \ t-file-name.py \
t-idiomatic.py t-idiomatic.py
TESTS = $(top_srcdir)/tests/gpg/initial.test \ TESTS = initial.py $(py_tests) final.py
$(py_tests) \ EXTRA_DIST = support.py $(TESTS)
$(top_srcdir)/tests/gpg/final.test
CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \ CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
gpg-agent.conf pubring.kbx~ gpg.conf pubring.gpg~ \ 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 # To guarantee that check-local is run before any tests we
# add this dependency: # add this dependency:
$(top_srcdir)/tests/gpg/initial.test: check-local initial.py: check-local
./private-keys-v1.d/gpg-sample.stamp: $(private_keys) ./private-keys-v1.d/gpg-sample.stamp: $(private_keys)
test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d

24
lang/python/tests/final.py Executable file
View File

@ -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 <http://www.gnu.org/licenses/>.
import os
import subprocess
subprocess.check_call([os.path.join(os.getenv('top_srcdir'),
"tests", "start-stop-agent"), "--stop"])

24
lang/python/tests/initial.py Executable file
View File

@ -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 <http://www.gnu.org/licenses/>.
import os
import subprocess
subprocess.check_call([os.path.join(os.getenv('top_srcdir'),
"tests", "start-stop-agent"), "--start"])