From: David Levine Date: Sun, 28 Dec 2014 21:51:36 +0000 (-0600) Subject: OK, this fixes the problem referenced in the last commit. It X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/f4b9d334fe87371102ef4604691fd2b6013e20a4?ds=sidebyside;hp=debcc107b759e08105c2572737d6e7c81dcf1a8e OK, this fixes the problem referenced in the last commit. It removes the copy of the etc files only during make distcheck. --- diff --git a/Makefile.am b/Makefile.am index 1cc08753..af4a2fee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,6 +37,7 @@ TESTS_ENVIRONMENT = MH_OBJ_DIR="@abs_builddir@" \ MH_TEST_DIR="@abs_builddir@/test/testdir" \ nmhlibexecdir="$(nmhlibexecdir)" bindir="$(bindir)" \ mandir="$(mandir)" nmhetcdir="$(nmhetcdir)" \ + nmhetcdirinst="@nmhetcdirinst@$(nmhetcdir)" \ supported_locks="$(supported_locks)" \ default_locking="${default_locking}" \ MULTIBYTE_ENABLED=$(MULTIBYTE_ENABLED) \ @@ -102,7 +103,13 @@ TESTS = test/ali/test-ali test/anno/test-anno \ check_SCRIPTS = test/common.sh check_PROGRAMS = test/getfullname test/getcanon test/fakepop test/fakesmtp \ test/getcwidth -DISTCHECK_CONFIGURE_FLAGS = DISABLE_SETGID_MAIL=1 + +## The location of installed nmhetcdir is, for all purposes except +## distcheck, $nmhetcdir. For distcheck, prepend $MH_INST_DIR (from +## test/common.sh.in), which is based on $MH_TEST_DIR (from +## $TESTS_ENVIRONMENT). +DISTCHECK_CONFIGURE_FLAGS = DISABLE_SETGID_MAIL=1 \ + NMHETCDIRINST='$${abs_builddir}/test/testdir/inst' ## ## Stuff that should be cleaned via "make clean" @@ -596,7 +603,7 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/arglist.c \ config/sbr_libmh_a-config.$(OBJEXT) sbr/sbr_libmh_a-mts.$(OBJEXT): Makefile -sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"$(nmhetcdir)"' \ +sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"@nmhetcdirinst@$(nmhetcdir)"' \ -DMAILSPOOL='"$(mailspool)"' \ -DSENDMAILPATH='"$(sendmailpath)"' -DNMHBINDIR='"$(bindir)"' \ -DNMHLIBEXECDIR='"$(nmhlibexecdir)"' diff --git a/configure.ac b/configure.ac index e0a96f5d..02f0a044 100644 --- a/configure.ac +++ b/configure.ac @@ -515,6 +515,13 @@ AS_IF([test "$LEX" = flex], '; sed "s/\( \)int i;/\1yy_size_t i;/" $@ >$@.tmp && mv -f $@.tmp $@']) AC_SUBST([LFLAGS])]) +dnl ------------------ +dnl FOR INTERNAL USE by the NMH test suite +dnl ------------------ +AC_ARG_VAR([NMHETCDIRINST], [for internal use by nmh test suite]) +AS_IF([test -n "$NMHETCDIRINST"], [nmhetcdirinst=$NMHETCDIRINST] + AC_SUBST([nmhetcdirinst])) + dnl ---------------- dnl CHECK STRUCTURES dnl ---------------- diff --git a/test/common.sh.in b/test/common.sh.in index a4e75bc4..8f89a2cd 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -13,6 +13,9 @@ test -z "$exec_prefix" && exec_prefix=@exec_prefix@ test -z "$bindir" && bindir="@bindir@" test -z "$mandir" && mandir="@mandir@" test -z "$nmhetcdir" && nmhetcdir="@sysconfdir@/nmh" +#### The following doesn't support running the distcheck version of +#### test-mhparam standalone, but only via make distcheck. +test -z "$nmhetcdirinst" && nmhetcdirinst="@nmhetcdirinst@$nmhetcdir" test -z "$nmhlibexecdir" && nmhlibexecdir="@libexecdir@/nmh" test -z "$supported_locks" && supported_locks="@supported_locks@" test -z "$default_locking" && default_locking="@default_locking@" @@ -289,14 +292,19 @@ postproc: ${MH_LIBEXEC_DIR}/post showproc: ${MH_LIBEXEC_DIR}/mhl EOF - for f in MailAliases components digestcomps distcomps forwcomps mhl.body \ - mhl.digest mhl.format mhl.forward mhl.headers mhl.reply \ - mhn.defaults rcvdistcomps replcomps replgroupcomps scan.MMDDYY \ - scan.YYYYMMDD scan.curses scan.default scan.highlighted scan.mailx \ - scan.nomime scan.size scan.time scan.timely scan.unseen - do - cp "${MH_INST_DIR}${nmhetcdir}/${f}" "${MH_TEST_DIR}/Mail" || exit 1 - done + if test -z '@nmhetcdirinst@'; then + #### This isn't used with make distcheck. + for f in MailAliases components digestcomps distcomps forwcomps \ + mhl.body mhl.digest mhl.format \ + mhl.forward mhl.headers mhl.reply \ + mhn.defaults rcvdistcomps replcomps replgroupcomps \ + scan.MMDDYY scan.YYYYMMDD scan.curses scan.default \ + scan.highlighted scan.mailx scan.nomime scan.size scan.time \ + scan.timely scan.unseen + do + cp "${MH_INST_DIR}${nmhetcdir}/${f}" "${MH_TEST_DIR}/Mail" || exit 1 + done + fi folder -create +inbox > /dev/null # create 10 basic messages diff --git a/test/mhparam/test-mhparam b/test/mhparam/test-mhparam index 7d2c6021..8a48b8de 100755 --- a/test/mhparam/test-mhparam +++ b/test/mhparam/test-mhparam @@ -96,7 +96,7 @@ $MH_INST_DIR$nmhlibexecdir/mhl nmh-`cat ${srcdir}/VERSION` $bindir/whatnow $bindir/whom -$nmhetcdir +$nmhetcdirinst $MH_LIBEXEC_DIR fcntl ${default_locking}