X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=Makefile.am;h=dbb5ec81a16e6811348d97158662c74d4017fd12;hb=9e826e368de450dfdaacf38def352d6314c76b62;hp=413e3f5cd67c18f3dc7330dcd4ff91c574db420b;hpb=b91c842af55ec941131fdf7b09bfdf9b3124094d;p=mmh diff --git a/Makefile.am b/Makefile.am index 413e3f5..dbb5ec8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,12 +31,57 @@ MHNSEARCHPROG = $(srcdir)/etc/mhn.find.sh auxexecdir = @libdir@ ## +## nmh _does_ have a test suite! +## +TESTS_ENVIRONMENT = MH_OBJ_DIR=@abs_builddir@ \ + MH_TEST_DIR=@abs_builddir@/test/testdir \ + auxexecdir=$(auxexecdir) bindir=$(bindir) \ + mandir=$(mandir) sysconfdir=$(sysconfdir) +## +## Important note: the "cleanup" test should always be last +## +TESTS = test/bad-input/test-header \ + test/burst/test-burst \ + test/comp/test-comp-format \ + test/folder/test-create \ + test/folder/test-total test/format/test-localmbox \ + test/format/test-myname test/format/test-myhost \ + test/format/test-mymbox \ + test/forw/test-forw-digest \ + test/forw/test-forw-format \ + test/inc/test-deb359167 test/inc/test-eom-align \ + test/inc/test-inc-scanout test/install-mh/test-install-mh \ + test/manpages/test-manpages test/mhbuild/test-forw \ + test/mhlist/test-mhlist test/mhparam/test-mhparam \ + test/mhpath/test-mhpath \ + test/mhshow/test-cte-binary test/mhshow/test-qp \ + test/mhshow/test-subpart test/mhstore/test-mhstore \ + test/new/test-basic \ + test/pick/test-pick test/pick/test-stderr \ + test/post/test-post-basic test/post/test-post-multiple \ + test/post/test-post-dcc test/post/test-post-fcc \ + test/post/test-post-multifrom test/post/test-post-envelope \ + test/post/test-post-group \ + test/refile/test-refile \ + test/repl/test-if-str test/repl/test-trailing-newline \ + test/repl/test-multicomp \ + test/scan/test-scan \ + test/sequences/test-flist test/sequences/test-mark \ + test/whatnow/test-attach-detach test/whatnow/test-cd \ + test/whatnow/test-ls test/whom/test-whom \ + test/cleanup ## The "cleanup" test should always be last. + +check_SCRIPTS = test/common.sh +check_PROGRAMS = test/getfullname test/getfqdn test/fakesmtp + +## ## 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) + etc/mhn.defaults man/man.sed man/mh-chart.man $(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" @@ -46,9 +91,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 @@ -115,16 +160,19 @@ dist_sysconf_DATA = etc/MailAliases etc/components etc/digestcomps \ ## sysconf_DATA = etc/mhn.defaults etc/mts.conf +## +## Documentation that gets installed in docdir +## dist_doc_DATA = COPYRIGHT VERSION docs/COMPLETION-BASH docs/COMPLETION-TCSH \ docs/COMPLETION-ZSH docs/DIFFERENCES docs/FAQ \ docs/MAIL.FILTERING docs/MAILING-LISTS docs/README-ATTACHMENTS \ - docs/README-HOOKS docs/README.about docs/README.SASL \ - docs/README.developers docs/README.manpages docs/TODO + docs/README-HOOKS docs/README-components docs/README.about \ + docs/README.SASL docs/README.developers docs/README.manpages \ + docs/TODO docs/replyfilter ## ## Our man pages ## - man_MANS = man/ali.1 man/anno.1 man/ap.8 man/burst.1 man/comp.1 \ man/conflict.8 man/dist.1 man/dp.8 man/flist.1 man/flists.1 \ man/fmtdump.8 man/fnext.1 man/folder.1 man/folders.1 \ @@ -145,7 +193,6 @@ man_MANS = man/ali.1 man/anno.1 man/ap.8 man/burst.1 man/comp.1 \ ## Files we need to include in the distribution which aren't found by ## Automake using the automatic rules ## - EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in etc/sendfiles.in \ etc/mhn.defaults.sh $(MHNSEARCHPROG) nmh.spec DATE \ docs/ChangeLog_MH-3_to_MH-6.6 \ @@ -154,18 +201,22 @@ EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in etc/sendfiles.in \ man/conflict.man man/dist.man man/dp.man man/flist.man \ man/flists.man man/fmtdump.man man/fnext.man man/folder.man \ man/folders.man man/forw.man man/fprev.man man/inc.man \ - man/install-mh.man man/mark.man man/mh-alias.man man/mh-chart.man \ - man/mh-draft.man man/mh-format.man man/mh-mail.man \ - man/mh-profile.man man/mh-sequence.man man/mh-tailor.man \ - man/mhbuild.man man/mhl.man man/mhlist.man man/mhmail.man \ - man/mhn.man man/mhparam.man man/mhpath.man man/mhshow.man \ - man/mhstore.man man/msgchk.man man/msh.man man/mts.conf.man \ - man/new.man man/next.man man/nmh.man man/packf.man man/pick.man \ - man/post.man man/prev.man man/prompter.man man/rcvdist.man \ - 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/install-mh.man man/mark.man man/mh-alias.man \ + man/mh-chart-gen.sh man/mh-draft.man man/mh-format.man \ + man/mh-mail.man man/mh-profile.man man/mh-sequence.man \ + man/mh-tailor.man man/mhbuild.man man/mhl.man man/mhlist.man \ + man/mhmail.man man/mhn.man man/mhparam.man man/mhpath.man \ + man/mhshow.man man/mhstore.man man/msgchk.man man/msh.man \ + man/mts.conf.man man/new.man man/next.man man/nmh.man \ + man/packf.man man/pick.man man/post.man man/prev.man \ + man/prompter.man man/rcvdist.man 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 test/post/test-post-common.sh ## ## These are all of the definitions for each of the programs listed above. @@ -173,11 +224,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 @@ -186,17 +232,19 @@ uip_burst_SOURCES = uip/burst.c uip_comp_SOURCES = uip/comp.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c +uip_comp_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_dist_SOURCES = uip/dist.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ - uip/annosbr.c uip/distsbr.c + uip/annosbr.c uip/distsbr.c uip/forwsbr.c +uip_dist_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_flist_SOURCES = uip/flist.c uip_folder_SOURCES = uip/folder.c uip_forw_SOURCES = uip/forw.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ - uip/annosbr.c uip/distsbr.c -uip_forw_LDADD = $(LDADD) $(ICONVLIB) + uip/annosbr.c uip/distsbr.c uip/forwsbr.c +uip_forw_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_inc_SOURCES = uip/inc.c uip/scansbr.c uip/dropsbr.c uip/termsbr.c \ uip/popsbr.c @@ -256,7 +304,7 @@ uip_refile_SOURCES = uip/refile.c uip_repl_SOURCES = uip/repl.c uip/replsbr.c uip/whatnowproc.c \ uip/whatnowsbr.c uip/sendsbr.c uip/annosbr.c uip/distsbr.c -uip_repl_LDADD = $(LDADD) $(ICONVLIB) +uip_repl_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_rmf_SOURCES = uip/rmf.c @@ -274,6 +322,7 @@ uip_sortm_SOURCES = uip/sortm.c uip_whatnow_SOURCES = uip/whatnow.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c +uip_whatnow_LDADD = $(LDADD) $(READLINELIB) uip_whom_SOURCES = uip/whom.c uip/distsbr.c @@ -321,6 +370,15 @@ uip_spost_SOURCES = uip/spost.c uip/aliasbr.c uip_viamail_SOURCES = uip/viamail.c uip/mhmisc.c uip/mhoutsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c +test_getfullname_SOURCES = test/getfullname.c +test_getfullname_LDADD = sbr/libmh.a + +test_getfqdn_SOURCES = test/getfqdn.c +test_getfqdn_LDADD = + +test_fakesmtp_SOURCES = test/fakesmtp.c +test_fakesmtp_LDADD = + ## ## Our rebuild rules for files that aren't built via the normal mechanisms ## @@ -334,10 +392,8 @@ etc/mts.conf: $(srcdir)/etc/mts.conf.in Makefile rm -f $@ $(SED) -e 's,%mts%,$(MTS),' \ -e 's,%mailspool%,$(mailspool),' \ - -e 's,%etcdir%,$(sysconfdir),' \ - -e 's,%masquerade%,$(masquerade),' \ -e 's,%smtpservers%,$(smtpservers),' \ - < $(srcdir)/etc/mts.conf.in > $@ + < $(srcdir)/etc/mts.conf.in > $@ etc/mhn.defaults: $(srcdir)/etc/mhn.defaults.sh $(MHNSEARCHPROG) rm -f $@ @@ -397,7 +453,7 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/brkstring.c \ sbr/context_replace.c sbr/context_save.c \ sbr/copy.c sbr/copyip.c sbr/cpydata.c \ sbr/cpydgst.c sbr/crawl_folders.c sbr/discard.c \ - sbr/done.c sbr/dtime.c \ + sbr/done.c sbr/dtime.c sbr/escape_display_name.c \ sbr/error.c sbr/ext_hook.c sbr/fdcompare.c \ sbr/folder_addmsg.c sbr/folder_delmsgs.c \ sbr/folder_free.c sbr/folder_pack.c \ @@ -422,25 +478,25 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/brkstring.c \ sbr/snprintb.c sbr/ssequal.c sbr/strcasecmp.c \ sbr/strindex.c sbr/trimcpy.c sbr/uprf.c sbr/vfgets.c \ sbr/fmt_def.c sbr/m_msgdef.c sbr/mf.c sbr/utils.c \ - sbr/m_mktemp.c config/config.c config/version.c + sbr/m_mktemp.c sbr/getansreadline.c config/config.c \ + config/version.c sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"$(sysconfdir)"' \ -DMAILSPOOL='"$(mailspool)"' \ -DSENDMAILPATH='"$(sendmailpath)"' -DNMHBINDIR='"$(bindir)"' \ -DNMHLIBDIR='"$(libdir)"' \ - -DDEFAULT_EDITOR='"$(default_editor)"' \ - -DDEFAULT_PAGER='"$(default_pager)"' + -DDEFAULT_EDITOR='"$(editorpath)"' \ + -DDEFAULT_PAGER='"$(pagerpath)"' sbr_libdtimep_a_SOURCES = sbr/dtimep.l sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) $(DISABLE_UNUSED_MACROS_WARNING) -mts_libmts_a_SOURCES = mts/smtp/hosts.c mts/smtp/smtp.c +mts_libmts_a_SOURCES = mts/smtp/smtp.c ## ## Our rules for generating man pages (both the rule for man.sed and ## the implicit rules for man page generation). ## - manext1 = 1 manext5 = 5 manext8 = 8 @@ -448,46 +504,51 @@ manext8 = 8 $(man_MANS): man/man.sed man/man.sed: Makefile - echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@ - echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@ - echo 's,%nmhdate%,$(DATE),g' >> $@ - echo 's,%bindir%,$(bindir),g' >> $@ - echo 's,%etcdir%,$(sysconfdir),g' >> $@ - echo 's,%libdir%,$(libdir),g' >> $@ - echo 's,%mandir%,$(mandir),g' >> $@ - echo 's,%mailspool%,$(mailspool),g' >> $@ - echo 's,%sendmailpath%,$(sendmailpath),g' >> $@ - echo 's,%default_editor%,$(default_editor),g' >> $@ - echo 's,%default_pager%,$(default_pager),g' >> $@ - echo 's,%manext1%,$(manext1),g' >> $@ - echo 's,%manext5%,$(manext5),g' >> $@ - echo 's,%manext8%,$(manext8),g' >> $@ - echo '/%components%/r $(top_srcdir)/etc/components' >> $@ - echo ' s,%components%,,g' >> $@ - echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@ - echo ' s,%distcomps%,,g' >> $@ - echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@ - echo ' s,%forwcomps%,,g' >> $@ - echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@ - echo ' s,%mhl_forward%,,g' >> $@ - echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@ - echo ' s,%mhl_format%,,g' >> $@ - echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@ - echo ' s,%mhl_reply%,,g' >> $@ + @echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@ + @echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@ + @echo 's,%nmhdate%,$(DATE),g' >> $@ + @echo 's,%bindir%,$(bindir),g' >> $@ + @echo 's,%etcdir%,$(sysconfdir),g' >> $@ + @echo 's,%libdir%,$(libdir),g' >> $@ + @echo 's,%mandir%,$(mandir),g' >> $@ + @echo 's,%mailspool%,$(mailspool),g' >> $@ + @echo 's,%sendmailpath%,$(sendmailpath),g' >> $@ + @echo 's,%default_editor%,$(editorpath),g' >> $@ + @echo 's,%default_pager%,$(pagerpath),g' >> $@ + @echo 's,%manext1%,$(manext1),g' >> $@ + @echo 's,%manext5%,$(manext5),g' >> $@ + @echo 's,%manext8%,$(manext8),g' >> $@ + @echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@ + @echo ' s,%mhl_forward%,,g' >> $@ + @echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@ + @echo ' s,%mhl_format%,,g' >> $@ + @echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@ + @echo ' s,%mhl_reply%,,g' >> $@ + +man/mh-chart.man: + @$(srcdir)/man/mh-chart-gen.sh > $@ .man.$(manext1): - $(SED) -f man/man.sed $< > $@ + @$(SED) -f man/man.sed $< > $@ .man.$(manext5): - $(SED) -f man/man.sed $< > $@ + @$(SED) -f man/man.sed $< > $@ .man.$(manext8): - $(SED) -f man/man.sed $< > $@ + @$(SED) -f man/man.sed $< > $@ + +## 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 ## - rpm: dist @test -d $(rpmdir)/SOURCES || $(MKDIR_P) $(rpmdir)/SOURCES @test -d $(rpmdir)/SPECS || $(MKDIR_P) $(rpmdir)/SPECS @@ -496,13 +557,65 @@ rpm: dist @cp -p nmh.spec $(rpmdir)/SPECS @rpmbuild --define '_topdir $(rpmdir)' \ --define '_tmppath %{_topdir}/TMP' \ + --define "_sysconfdir $(DESTDIR)$(sysconfdir)" \ -ba $(rpmdir)/SPECS/nmh.spec .PHONY: rpm ## ## A target to build information needed by cscope ## - 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 +.PHONY: cscope + + +## +## Use GNU gcov to find the coverage of the test suite. +## These targets are not integrated into the other automake +## targets because they will be used so infrequently, if at all. +## +gcov: + @if ./config.status --config | grep -e --enable-debug >/dev/null; then \ + echo For best results with gcov, configure without --enable-debug; \ + fi + @echo rebuilding with AM_CFLAGS=--coverage . . . + @(make clean && make AM_CFLAGS=--coverage) > /dev/null && \ + make check AM_CFLAGS=--coverage + @for i in `find . -name '*.gcda'`; do \ + gcov -p -o `echo $$i | $(SED) 's%\\(.*\\)/%\\1 %'`; \ + done + @for i in `find . -name '*.gcno'`; do \ + if ! test -f `echo $$i | sed 's%\.gcno%.gcda%'`; then \ + echo untested: $$i; \ + fi; \ + done +gcov-mostlyclean: + @find . -name '*.gcno' -o -name '*.gcda' | xargs rm +gcov-clean: gcov-mostlyclean + @find . -name '*.gcov' | xargs rm +.PHONY: gcov gcov-mostlyclean gcov-clean + + +## +## 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