$NetBSD: patch-ak,v 1.3 2009/12/20 16:12:06 tonnerre Exp $

--- maint.mk.orig	2008-05-27 12:28:50.000000000 +0200
+++ maint.mk	2009-12-20 17:02:31.000000000 +0100
@@ -629,8 +629,9 @@
 
 write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
 
-TMPDIR ?= /tmp
-t=$(TMPDIR)/$(PACKAGE)/test
+tmpdir = $(abs_top_builddir)/tests/torture
+
+t=$(tmpdir)/$(PACKAGE)/test
 pfx=$(t)/i
 
 # Verify that a twisted use of --program-transform-name=PROGRAM works.
@@ -646,6 +647,7 @@
 # Install, then verify that all binaries and man pages are in place.
 # Note that neither the binary, ginstall, nor the ].1 man page is installed.
 define my-instcheck
+  echo running my-instcheck;				\
   $(MAKE) prefix=$(pfx) install				\
     && test ! -f $(pfx)/bin/ginstall			\
     && { fail=0;					\
@@ -713,6 +715,7 @@
 	    && $(MAKE);							\
 	fi
 	-rm -rf $(t)
+	rmdir $(tmpdir)/$(PACKAGE) $(tmpdir)
 	@echo "========================"; \
 	echo "$(distdir).tar.gz is ready for distribution"; \
 	echo "========================"
