nmh: Import nmh-1.7rc1 as wip/nmh
authorLeonardo Taccari <leot@NetBSD.org>
Thu, 3 Aug 2017 11:58:11 +0000 (13:58 +0200)
committerLeonardo Taccari <leot@NetBSD.org>
Thu, 3 Aug 2017 11:58:11 +0000 (13:58 +0200)
nmh (new MH) is a powerful electronic mail handling system. It was
originally based on version 6.8.3 of the MH message system developed by
the RAND Corporation and the University of California. It is intended
to be a (mostly) compatible drop-in replacement for MH.

nmh consists of a collection of fairly simple single-purpose programs
to send, receive, save, retrieve, and manipulate e-mail messages. Since
nmh is a suite rather than a single monolithic program, you may freely
intersperse nmh commands with other commands at your shell prompt,
or write custom scripts which use these commands in flexible ways.

Based on mail/nmh with few adjustments that will be needed for the next nmh-1.7
release.

Please note this is a RC release and it is intended to ease testing and updating
of mail/nmh!

nmh/DESCR [new file with mode: 0644]
nmh/Makefile [new file with mode: 0644]
nmh/PLIST [new file with mode: 0644]
nmh/distinfo [new file with mode: 0644]
nmh/files/mhn.defaults.dist [new file with mode: 0644]
nmh/options.mk [new file with mode: 0644]
nmh/patches/patch-ca [new file with mode: 0644]
nmh/patches/patch-cd [new file with mode: 0644]

diff --git a/nmh/DESCR b/nmh/DESCR
new file mode 100644 (file)
index 0000000..9bb225a
--- /dev/null
+++ b/nmh/DESCR
@@ -0,0 +1,10 @@
+nmh (new MH) is a powerful electronic mail handling system. It was
+originally based on version 6.8.3 of the MH message system developed by
+the RAND Corporation and the University of California. It is intended
+to be a (mostly) compatible drop-in replacement for MH.
+
+nmh consists of a collection of fairly simple single-purpose programs
+to send, receive, save, retrieve, and manipulate e-mail messages. Since
+nmh is a suite rather than a single monolithic program, you may freely
+intersperse nmh commands with other commands at your shell prompt,
+or write custom scripts which use these commands in flexible ways.
diff --git a/nmh/Makefile b/nmh/Makefile
new file mode 100644 (file)
index 0000000..f8a5e74
--- /dev/null
@@ -0,0 +1,107 @@
+# $NetBSD: Makefile,v 1.92 2016/03/05 11:28:49 jperkin Exp $
+
+DISTNAME=              nmh-1.7-RC1
+PKGNAME=               nmh-1.7rc1
+CATEGORIES=            mail
+MASTER_SITES=          http://savannah.nongnu.org/download/nmh/
+
+MAINTAINER=            leot@NetBSD.org
+HOMEPAGE=              http://www.nongnu.org/nmh/
+COMMENT=               Cleaned up MH mailer suite
+LICENSE=               modified-bsd
+
+CONFLICTS=             ja-mh-[0-9]*
+CONFLICTS+=            ja-mh6-[0-9]*
+
+USE_TOOLS+=            lex
+
+# We choose DOT_LOCKING in our patches because ".lock" files are
+# the most common locking mechanism supported by mail software.
+# It also works well over NFS.
+
+# Locks supported by `mail.local' are ".lock" and flock(2).
+
+.include "../../mk/bsd.prefs.mk"
+# Avoids SEGV in nmh's private version of strcasecmp() under gcc4
+.if !empty(PKGSRC_COMPILER:Mgcc*)
+CFLAGS+=               -O1
+.endif
+
+.include "options.mk"
+
+# Mail Transport Agent - either "smtp" or "sendmail"
+NMH_MTA?=              smtp
+
+GNU_CONFIGURE=         yes
+
+GNU_CONFIGURE_LIBDIR=  ${PREFIX}/libexec/nmh
+CONFIGURE_ARGS+=       --sysconfdir=${PKG_SYSCONFBASE}
+CONFIGURE_ARGS+=       --with-mts=${NMH_MTA:Q}
+CONFIGURE_ARGS+=       --without-readline
+
+DOCDIR=                        share/doc/nmh
+EGDIR=                 ${PREFIX}/share/examples/nmh
+INSTALLATION_DIRS=     ${DOCDIR} ${EGDIR}
+
+BUILD_DEFS+=           NMH_MTA NMH_EDITOR NMH_PAGER NMH_HASH_BACKUP PKG_SYSCONFBASE
+
+PKG_SYSCONFSUBDIR=     nmh
+CONF_FILES=            # empty
+.for f in              MailAliases             \
+                       components              \
+                       digestcomps             \
+                       distcomps               \
+                       forwcomps               \
+                       mhical.12hour           \
+                       mhical.24hour           \
+                       mhl.body                \
+                       mhl.digest              \
+                       mhl.format              \
+                       mhl.forward             \
+                       mhl.headers             \
+                       mhl.reply               \
+                       mhl.replywithoutbody    \
+                       mhn.defaults            \
+                       mts.conf                \
+                       rcvdistcomps            \
+                       rcvdistcomps.outbox     \
+                       replcomps               \
+                       replgroupcomps          \
+                       rmmproc.messageid       \
+                       scan.MMDDYY             \
+                       scan.YYYYMMDD           \
+                       scan.default            \
+                       scan.mailx              \
+                       scan.nomime             \
+                       scan.size               \
+                       scan.time               \
+                       scan.timely             \
+                       scan.unseen
+CONF_FILES+=           ${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f}
+.endfor
+
+# The configure script checks for arc4random(), but the program uses
+# arc4random_buf(); netbsd-5 (and presumably earlier) and some Darwin
+# versions has the one but not the other. Just disable it, because all
+# it's using the randomness for is message-ids.
+.if !empty(MACHINE_PLATFORM:MNetBSD-[1-5].*-*) || \
+    !empty(MACHINE_PLATFORM:MDarwin-[1-9].*-*) || \
+    !empty(MACHINE_PLATFORM:MDarwin-1[0-2].*-*)
+CONFIGURE_ENV+=                ac_cv_func_arc4random=no
+.endif
+
+post-install:
+       ${INSTALL_DATA} ${FILESDIR}/mhn.defaults.dist \
+           ${DESTDIR}${EGDIR}/mhn.defaults
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "Linux"
+.include "../../databases/gdbm_compat/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-ndbm='gdbm_compat -lgdbm'
+CONFIGURE_ARGS+=       --with-ndbmheader=ndbm.h
+.endif
+
+.include "../../converters/libiconv/buildlink3.mk"
+.include "../../mk/terminfo.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/nmh/PLIST b/nmh/PLIST
new file mode 100644 (file)
index 0000000..632b2ad
--- /dev/null
+++ b/nmh/PLIST
@@ -0,0 +1,189 @@
+@comment $NetBSD$
+bin/ali
+bin/anno
+bin/burst
+bin/comp
+bin/dist
+bin/flist
+bin/flists
+bin/fmttest
+bin/fnext
+bin/folder
+bin/folders
+bin/forw
+bin/fprev
+bin/inc
+bin/install-mh
+bin/mark
+bin/mhbuild
+bin/mhfixmsg
+bin/mhical
+bin/mhlist
+bin/mhlogin
+bin/mhmail
+bin/mhn
+bin/mhparam
+bin/mhpath
+bin/mhshow
+bin/mhstore
+bin/msgchk
+bin/new
+bin/next
+bin/packf
+bin/pick
+bin/prev
+bin/prompter
+bin/refile
+bin/repl
+bin/rmf
+bin/rmm
+bin/scan
+bin/send
+bin/sendfiles
+bin/show
+bin/sortm
+bin/unseen
+bin/whatnow
+bin/whom
+libexec/nmh/ap
+libexec/nmh/dp
+libexec/nmh/fmtdump
+libexec/nmh/mhl
+libexec/nmh/mkstemp
+libexec/nmh/post
+libexec/nmh/rcvdist
+libexec/nmh/rcvpack
+libexec/nmh/rcvstore
+libexec/nmh/rcvtty
+libexec/nmh/slocal
+libexec/nmh/spost
+libexec/nmh/viamail
+man/man1/ali.1
+man/man1/anno.1
+man/man1/burst.1
+man/man1/comp.1
+man/man1/dist.1
+man/man1/flist.1
+man/man1/flists.1
+man/man1/fmttest.1
+man/man1/fnext.1
+man/man1/folder.1
+man/man1/folders.1
+man/man1/forw.1
+man/man1/fprev.1
+man/man1/inc.1
+man/man1/install-mh.1
+man/man1/mark.1
+man/man1/mh-mkstemp.1
+man/man1/mhbuild.1
+man/man1/mhfixmsg.1
+man/man1/mhical.1
+man/man1/mhl.1
+man/man1/mhlist.1
+man/man1/mhlogin.1
+man/man1/mhmail.1
+man/man1/mhn.1
+man/man1/mhparam.1
+man/man1/mhpath.1
+man/man1/mhshow.1
+man/man1/mhstore.1
+man/man1/msgchk.1
+man/man1/new.1
+man/man1/next.1
+man/man1/packf.1
+man/man1/pick.1
+man/man1/prev.1
+man/man1/prompter.1
+man/man1/rcvdist.1
+man/man1/rcvpack.1
+man/man1/rcvstore.1
+man/man1/rcvtty.1
+man/man1/refile.1
+man/man1/repl.1
+man/man1/rmf.1
+man/man1/rmm.1
+man/man1/scan.1
+man/man1/send.1
+man/man1/sendfiles.1
+man/man1/show.1
+man/man1/slocal.1
+man/man1/sortm.1
+man/man1/unseen.1
+man/man1/whatnow.1
+man/man1/whom.1
+man/man5/mh-alias.5
+man/man5/mh-draft.5
+man/man5/mh-folders.5
+man/man5/mh-format.5
+man/man5/mh-mail.5
+man/man5/mh-profile.5
+man/man5/mh-sequence.5
+man/man5/mh-tailor.5
+man/man5/mh_profile.5
+man/man5/mts.conf.5
+man/man7/MH.7
+man/man7/mh-chart.7
+man/man7/mh-mime.7
+man/man7/nmh.7
+man/man8/ap.8
+man/man8/dp.8
+man/man8/fmtdump.8
+man/man8/post.8
+share/doc/nmh/COMPLETION-TCSH
+share/doc/nmh/COMPLETION-ZSH
+share/doc/nmh/COPYRIGHT
+share/doc/nmh/DIFFERENCES
+share/doc/nmh/FAQ
+share/doc/nmh/INSTALL
+share/doc/nmh/MAIL.FILTERING
+share/doc/nmh/MAILING-LISTS
+share/doc/nmh/NEWS
+share/doc/nmh/README
+share/doc/nmh/README-ATTACHMENTS
+share/doc/nmh/README-HOOKS
+share/doc/nmh/README-components
+share/doc/nmh/README.SASL
+share/doc/nmh/README.about
+share/doc/nmh/README.developers
+share/doc/nmh/README.manpages
+share/doc/nmh/TODO
+share/doc/nmh/VERSION
+share/doc/nmh/contrib/localpostproc
+share/doc/nmh/contrib/ml
+share/doc/nmh/contrib/replaliases
+share/doc/nmh/contrib/replyfilter
+share/doc/nmh/contrib/vpick
+share/examples/nmh/MailAliases
+share/examples/nmh/bash_completion_nmh
+share/examples/nmh/components
+share/examples/nmh/digestcomps
+share/examples/nmh/distcomps
+share/examples/nmh/forwcomps
+share/examples/nmh/mhical.12hour
+share/examples/nmh/mhical.24hour
+share/examples/nmh/mhl.body
+share/examples/nmh/mhl.digest
+share/examples/nmh/mhl.format
+share/examples/nmh/mhl.forward
+share/examples/nmh/mhl.headers
+share/examples/nmh/mhl.reply
+share/examples/nmh/mhl.replywithoutbody
+share/examples/nmh/mhn.defaults
+share/examples/nmh/mhshow.marker
+share/examples/nmh/mts.conf
+share/examples/nmh/rcvdistcomps
+share/examples/nmh/rcvdistcomps.outbox
+share/examples/nmh/replcomps
+share/examples/nmh/replgroupcomps
+share/examples/nmh/rmmproc.messageid
+share/examples/nmh/scan.MMDDYY
+share/examples/nmh/scan.YYYYMMDD
+share/examples/nmh/scan.curses
+share/examples/nmh/scan.default
+share/examples/nmh/scan.highlighted
+share/examples/nmh/scan.mailx
+share/examples/nmh/scan.nomime
+share/examples/nmh/scan.size
+share/examples/nmh/scan.time
+share/examples/nmh/scan.timely
+share/examples/nmh/scan.unseen
diff --git a/nmh/distinfo b/nmh/distinfo
new file mode 100644 (file)
index 0000000..5cbc1f1
--- /dev/null
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.19 2015/11/03 23:27:11 agc Exp $
+
+SHA1 (nmh-1.7-RC1.tar.gz) = 1e5d3d139d2771f61347be88737118e63a6f860d
+RMD160 (nmh-1.7-RC1.tar.gz) = f005591180c2ae8e177ed2d3baa24b6066bb14b9
+SHA512 (nmh-1.7-RC1.tar.gz) = 533ebc81ebf9070bfc754dc38d97600f18a50f23999b938348535bb5923b349ed6e3900477d15ebc4c252ca3993cc7a71af4522fdd7f52249e14d3875c1dedca
+Size (nmh-1.7-RC1.tar.gz) = 1386731 bytes
+SHA1 (patch-ca) = ffca01a1f713b565cce5f6d5b55f280902090216
+SHA1 (patch-cd) = 5a775091713bca2597a01fcd267d56e2a175588a
diff --git a/nmh/files/mhn.defaults.dist b/nmh/files/mhn.defaults.dist
new file mode 100644 (file)
index 0000000..48980d3
--- /dev/null
@@ -0,0 +1,14 @@
+#: $NetBSD: mhn.defaults.dist,v 1.1 2000/03/02 05:11:44 kim Exp $
+#:
+mhstore-store-application/PostScript: %m%P.ps
+mhstore-store-text: %m%P.txt
+mhstore-store-text/richtext: %m%P.rt
+mhstore-store-video/mpeg: %m%P.mpg
+#:
+#: If you install more packages you could enable these
+#:
+#: mhshow-show-application/PostScript: %plpr -Pps
+#: mhshow-show-application/x-ivs: %pivs_replay -o '%F'
+#: mhshow-show-image: %pxv '%f'
+#: mhshow-show-text/richtext: %prichtext -p '%F'
+#: mhshow-show-video/mpeg: %pmpeg_play '%f'" >> $TMP
diff --git a/nmh/options.mk b/nmh/options.mk
new file mode 100644 (file)
index 0000000..4a5c016
--- /dev/null
@@ -0,0 +1,30 @@
+# $NetBSD: options.mk,v 1.4 2012/08/31 02:09:49 schnoebe Exp $
+
+PKG_OPTIONS_VAR=               PKG_OPTIONS.nmh
+PKG_SUPPORTED_OPTIONS=         nmh-backup-hash sasl tls
+
+.include "../../mk/bsd.options.mk"
+
+###
+### Prepend a "#" instead of a "," to the name of a message that is
+### "removed" by rmm.
+###
+.if !empty(PKG_OPTIONS:Mnmh-backup-hash)
+CONFIGURE_ARGS+=       --with-hash-backup
+.else
+CONFIGURE_ARGS+=       --without-hash-backup
+.endif
+
+.if !empty(PKG_OPTIONS:Msasl)
+CONFIGURE_ARGS+=       --with-cyrus-sasl
+.include "../../security/cyrus-sasl/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --without-cyrus-sasl
+.endif
+
+.if !empty(PKG_OPTIONS:Mtls)
+CONFIGURE_ARGS+=       --with-tls
+.include "../../security/openssl/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --with-tls
+.endif
diff --git a/nmh/patches/patch-ca b/nmh/patches/patch-ca
new file mode 100644 (file)
index 0000000..2115c4f
--- /dev/null
@@ -0,0 +1,74 @@
+$NetBSD: patch-ca,v 1.8 2014/09/06 16:07:43 schnoebe Exp $
+
+install config files into share/examples
+
+--- Makefile.in.orig   2017-08-03 02:22:59.000000000 +0000
++++ Makefile.in
+@@ -864,6 +864,7 @@ smtpserver = @smtpserver@
+ srcdir = @srcdir@
+ supported_locks = @supported_locks@
+ sysconfdir = @sysconfdir@
++egdir = @prefix@/share/examples/nmh
+ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+@@ -4625,46 +4626,46 @@ uninstall-dist_docs_contribDATA:
+       dir='$(DESTDIR)$(docs_contribdir)'; $(am__uninstall_files_from_dir)
+ install-dist_nmhetcDATA: $(dist_nmhetc_DATA)
+       @$(NORMAL_INSTALL)
+-      @list='$(dist_nmhetc_DATA)'; test -n "$(nmhetcdir)" || list=; \
++      @list='$(dist_nmhetc_DATA)'; test -n "$(egdir)" || list=; \
+       if test -n "$$list"; then \
+-        echo " $(MKDIR_P) '$(DESTDIR)$(nmhetcdir)'"; \
+-        $(MKDIR_P) "$(DESTDIR)$(nmhetcdir)" || exit 1; \
++        echo " $(MKDIR_P) '$(DESTDIR)$(egdir)'"; \
++        $(MKDIR_P) "$(DESTDIR)$(egdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+-        echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(nmhetcdir)'"; \
+-        $(INSTALL_DATA) $$files "$(DESTDIR)$(nmhetcdir)" || exit $$?; \
++        echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(egdir)'"; \
++        $(INSTALL_DATA) $$files "$(DESTDIR)$(egdir)" || exit $$?; \
+       done
+ uninstall-dist_nmhetcDATA:
+       @$(NORMAL_UNINSTALL)
+-      @list='$(dist_nmhetc_DATA)'; test -n "$(nmhetcdir)" || list=; \
++      @list='$(dist_nmhetc_DATA)'; test -n "$(egdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(nmhetcdir)'; $(am__uninstall_files_from_dir)
+ install-nmhetcDATA: $(nmhetc_DATA)
+       @$(NORMAL_INSTALL)
+-      @list='$(nmhetc_DATA)'; test -n "$(nmhetcdir)" || list=; \
++      @list='$(nmhetc_DATA)'; test -n "$(egdir)" || list=; \
+       if test -n "$$list"; then \
+-        echo " $(MKDIR_P) '$(DESTDIR)$(nmhetcdir)'"; \
+-        $(MKDIR_P) "$(DESTDIR)$(nmhetcdir)" || exit 1; \
++        echo " $(MKDIR_P) '$(DESTDIR)$(egdir)'"; \
++        $(MKDIR_P) "$(DESTDIR)$(egdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+-        echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(nmhetcdir)'"; \
+-        $(INSTALL_DATA) $$files "$(DESTDIR)$(nmhetcdir)" || exit $$?; \
++        echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(egdir)'"; \
++        $(INSTALL_DATA) $$files "$(DESTDIR)$(egdir)" || exit $$?; \
+       done
+ uninstall-nmhetcDATA:
+       @$(NORMAL_UNINSTALL)
+-      @list='$(nmhetc_DATA)'; test -n "$(nmhetcdir)" || list=; \
++      @list='$(nmhetc_DATA)'; test -n "$(egdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+-      dir='$(DESTDIR)$(nmhetcdir)'; $(am__uninstall_files_from_dir)
++      dir='$(DESTDIR)$(egdir)'; $(am__uninstall_files_from_dir)
+ ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
diff --git a/nmh/patches/patch-cd b/nmh/patches/patch-cd
new file mode 100644 (file)
index 0000000..2847b8b
--- /dev/null
@@ -0,0 +1,15 @@
+$NetBSD: patch-cd,v 1.7 2014/09/06 16:07:43 schnoebe Exp $
+
+make sure a time_t fits in
+
+--- sbr/fmt_scan.c.orig        2017-05-17 01:03:54.000000000 +0000
++++ sbr/fmt_scan.c
+@@ -365,7 +365,7 @@ fmt_scan (struct format *format, charstr
+     char *savestr, *str;
+     char buffer[NMH_BUFSIZ], buffer2[NMH_BUFSIZ];
+     int i, c, rjust;
+-    int value;
++    long long value;
+     time_t t;
+     size_t max;
+     struct format *fmt;