Merge from vendor branch TNF:
[pkgsrcv2.git] / mail / nmh / Makefile
1 # $NetBSD: Makefile,v 1.36 2000/03/16 13:44:53 wiz Exp $
2 # FreeBSD Id: Makefile,v 1.2 1997/08/04 06:51:28 markm Exp
3 #
4
5 DISTNAME=       nmh-1.0.4
6 CATEGORIES=     mail
7 MASTER_SITES=   ftp://ftp.mhost.com/pub/nmh/ \
8                 ftp://ftp.gw.com/pub/unix/mail/mh/nmh/
9
10 MAINTAINER=     kim@tac.nyc.ny.us
11 HOMEPAGE=       http://www.mhost.com/nmh/
12
13 CONFLICTS=      ja-mh-*
14
15 # We choose DOT_LOCKING in our patches because ".lock" files are
16 # the most common locking mechanism supported by mail software.
17 # It also works well over NFS.
18
19 # Locks supported by `mail.local' are ".lock" and flock(2).
20
21 .include "../../mk/bsd.prefs.mk"
22
23 # Mail Transport Agent - either "smtp" or "sendmail"
24 NMH_MTA?=       smtp
25
26 GNU_CONFIGURE=  yes
27 CONFIGURE_ARGS+= \
28                 --libdir=${PREFIX}/libexec/nmh \
29                 --sysconfdir=${PREFIX}/etc/nmh \
30                 --enable-nmh-pop \
31                 --with-mts=${NMH_MTA}
32
33 .ifdef NMH_EDITOR
34 CONFIGURE_ARGS+=--with-editor=${NMH_EDITOR}
35 .endif
36
37 .ifdef NMH_PAGER
38 CONFIGURE_ARGS+=--with-pager=${NMH_PAGER}
39 .endif
40
41 .if defined(KERBEROS) && ${KERBEROS} == 4
42 USE_KERBEROS=   yes
43 CONFIGURE_ARGS+=--with-krb4=yes
44 .else
45 CONFIGURE_ARGS+=--with-krb4=no
46 .endif
47
48 DOCDIR=         share/doc/nmh
49
50 BUILD_DEFS+=    NMH_MTA NMH_EDITOR NMH_PAGER NMH_HASH_BACKUP
51
52 # Since we patch the autoconf files as well as their outputs, avoid attempt
53 # to regenerate header input files with 'autoheader' by Makefile.
54 post-patch:
55         ${TOUCH} ${WRKSRC}/stamp-h.in
56
57 .if defined(NMH_HASH_BACKUP) && (${NMH_HASH_BACKUP} == yes)
58 post-configure:
59         ${MV} ${WRKSRC}/config.h ${WRKSRC}/config.h.bak
60         ${SED} -e 's/^\(#define  *BACKUP_PREFIX\)  *.*/\1 "#"/' \
61             < ${WRKSRC}/config.h.bak > ${WRKSRC}/config.h
62 .endif
63
64 # ABOUT CONFIGURATION FILES:
65 # - mhn.defaults is generated by nmh during make; we don't use that
66 #   copy because its contents depend on what happened to be installed
67 #   on the build system; we want a reliably reconstructable package
68 # - mhn.defaults and mts.conf are only created if they don't exist;
69 #   the PLIST only has mhn.defaults.dist and mts.conf.dist, so that
70 #   local modifications to the configuration files won't get lost on
71 #   upgrading the package
72
73 post-install:
74         @${INSTALL_DATA_DIR} ${PREFIX}/${DOCDIR}
75         @for f in `${GREP} '^${DOCDIR}/' ${PKGDIR}/PLIST`; do \
76             ${INSTALL_DATA} ${WRKSRC}/`basename $$f` ${PREFIX}/${DOCDIR}; \
77         done
78         @${INSTALL_DATA} ${FILESDIR}/mhn.defaults.dist ${PREFIX}/etc/nmh
79         @if [ ! -f ${PREFIX}/etc/nmh/mhn.defaults ]; then \
80             ${CP} -p \
81                 ${PREFIX}/etc/nmh/mhn.defaults.dist \
82                 ${PREFIX}/etc/nmh/mhn.defaults; \
83         fi
84         @if [ ! -f ${PREFIX}/etc/nmh/mts.conf ]; then \
85             ${CP} -p \
86                 ${PREFIX}/etc/nmh/mts.conf.dist \
87                 ${PREFIX}/etc/nmh/mts.conf; \
88         fi
89         @PKG_PREFIX='${PREFIX}' ${SH} -f ${PKGDIR}/INSTALL
90
91 .include "../../mk/bsd.pkg.mk"