X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=Makefile.am;h=56178f9d742011331c4cd6d6d7c09b9c742d8d1c;hb=8c57ff8161a9dc270c602a803aa47d7a949a6aaa;hp=413e3f5cd67c18f3dc7330dcd4ff91c574db420b;hpb=b91c842af55ec941131fdf7b09bfdf9b3124094d;p=mmh diff --git a/Makefile.am b/Makefile.am index 413e3f5..56178f9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,12 +31,27 @@ MHNSEARCHPROG = $(srcdir)/etc/mhn.find.sh auxexecdir = @libdir@ ## +## nmh _does_ have a test suite! +## +testdir = $(srcdir)/test +## It might be nice to configure testinstall and testbuild +## directories, but for now they're hard-coded here and in the test +## scripts. +## And it would be easier to clean up if tests were launched from a +## tmp directory, and/or each test cleaned up after itself on +## successful completion. +MOSTLYCLEANFILES = test/testinstall/*.actual* test/testinstall/*.expected* \ + test/testinstall/*.replgroupcomps test/testinstall/*.draft \ + test/testinstall/,*.draft* \* + +## ## 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 + @$(testdir)/teardown-test ## ## Stuff that should be cleaned via "make maintainer-clean" @@ -46,9 +61,9 @@ MAINTAINERCLEANFILES = cscope.files cscope.out ## ## And our own superclean, to get everything left by maintainer-clean. ## -SUPERCLEANFILES = Makefile.in aclocal.m4 compile config.guess config.h.in \ - config.h.in~ config.sub configure depcomp install-sh missing \ - ylwrap nmh-*.tar.gz +SUPERCLEANFILES = ChangeLog Makefile.in aclocal.m4 compile config.guess \ + config.h.in config.h.in~ config.sub configure depcomp \ + install-sh missing ylwrap nmh-*.tar.gz superclean: maintainer-clean @rm -f $(SUPERCLEANFILES) .PHONY: superclean @@ -173,11 +188,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 @@ -484,6 +494,20 @@ man/man.sed: Makefile .man.$(manext8): $(SED) -f man/man.sed $< > $@ +test: all + @test -d $(testdir)/testinstall || $(testdir)/setup-test + @$(testdir)/runalltests +.PHONY: test + +## Don't include commit hashes in ChangeLog. +ChangeLog: + @[ -d .git ] && git --no-pager log --abbrev-commit | \ + egrep -v '^commit [0-9a-f]+$$' > $@ || true +## Make ChangeLog phony so it will always get regenerated. But don't +## fail if we don't have a git repository in order to allow +## regeneration of distribution archive or RPM. +.PHONY: ChangeLog + ## ## Our RPM build target ## @@ -506,3 +530,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