mhshow: suppress pause actions if stdout isn't a tty
[mmh] / Makefile.am
index cd3c886..84bf58f 100644 (file)
@@ -31,12 +31,35 @@ MHNSEARCHPROG = $(srcdir)/etc/mhn.find.sh
 auxexecdir = @libdir@
 
 ##
+## nmh _does_ have a test suite!
+##
+
+TESTS_ENVIRONMENT = MH_TEST_DIR=`pwd`/test/testdir \
+                   MH_TEST_COMMON=`pwd`/test/common.sh \
+                   MH_OBJ_DIR=`pwd` mandir=$(mandir) bindir=$(bindir) \
+                   sysconfdir=$(sysconfdir) auxexecdir=$(auxexecdir)
+##
+## Important note: the "cleanup" test should always be last
+##
+TESTS = test/bad-input/test-header test/folder/test-create \
+       test/folder/test-total test/inc/test-deb359167 test/inc/test-eom-align \
+       test/manpages/test-manpages test/mhbuild/test-forw \
+       test/mhshow/test-cte-binary test/mhshow/test-qp \
+       test/mhshow/test-subpart test/new/test-basic test/pick/test-stderr \
+       test/repl/test-if-str test/scan/test-scan \
+       test/whatnow/test-attach-detach test/whatnow/test-cd \
+       test/whatnow/test-ls test/cleanup
+
+check_SCRIPTS = test/common.sh
+
+##
 ## Stuff that should be cleaned via "make clean"
 ##
 CLEANFILES = config/version.c sbr/sigmsg.h etc/mts.conf etc/sendfiles \
             etc/mhn.defaults man/man.sed $(man_MANS)
 clean-local:
        @rm -rf RPM a.out.DSYM uip/a.out.DSYM
+       @rm -rf test/testdir
 
 ##
 ## Stuff that should be cleaned via "make maintainer-clean"
@@ -165,7 +188,9 @@ EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in etc/sendfiles.in \
             man/rcvpack.man man/rcvstore.man man/rcvtty.man man/refile.man \
             man/repl.man man/rmf.man man/rmm.man man/scan.man man/send.man \
             man/sendfiles.man man/show.man man/slocal.man man/sortm.man \
-            man/unseen.man man/whatnow.man man/whom.man
+            man/unseen.man man/whatnow.man man/whom.man test/README $(TESTS) \
+            test/inc/deb359167.mbox test/inc/fromline.txt \
+            test/inc/msgheader.txt test/inc/filler.txt test/inc/md5sums
 
 ##
 ## These are all of the definitions for each of the programs listed above.
@@ -173,11 +198,6 @@ EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in etc/sendfiles.in \
 ## overrides that are used to select different library options from the
 ## default.
 ##
-## Note that a few programs link in extra files (specifically, popsbr.c)
-## if POP3 support is compiled in.  An Automake conditional is used for
-## this purpose.
-##
-
 uip_ali_SOURCES = uip/ali.c uip/aliasbr.c
 
 uip_anno_SOURCES = uip/anno.c uip/annosbr.c
@@ -515,3 +535,27 @@ rpm: dist
 cscope:
        echo "-I $(srcdir)/h -I $(srcdir)/sbr -I $(srcdir)/uip -I $(srcdir)/mts/smtp" > cscope.files
        find $(srcdir) \( -name \*.c -o -name \*.l \) -print | grep -v dtimep.c >> cscope.files
+
+##
+## Rules to upload the distribution to savannah
+##
+
+upload: dist
+       @if test -z "$(SAVANNAH_USERNAME)"; then \
+               echo "You need to set SAVANNAH_USERNAME to the your username on savannah.gnu.org." ;\
+               echo "You can set it either in your environment or on the make command line."; \
+               false; \
+       fi
+       @echo "Did you run 'make distcheck' already?"
+       @if test -z "$(SKIP_GPG_SIG)"; then \
+               echo "Creating GPG signature (set SKIP_GPG_SIG to bypass this step)"; \
+               gpg --output $(DIST_ARCHIVES).sig --detatch-sig $(DIST_ARCHIVES); \
+       fi
+       @echo "Setting permissions for savannah.gnu.org"
+       chmod 664 $(DIST_ARCHIVES)
+       if test -f $(DIST_ARCHIVES).sig; then \
+               chmod 664 $(DIST_ARCHIVES).sig; \
+       fi
+       @echo "Uploading to savannah"
+       scp -p $(DIST_ARCHIVES)* $(SAVANNAH_USERNAME)@savannah.gnu.org:/releases/nmh
+.PHONY: upload