From d7c679a9a88394a31b58665c115050fcc7241dd9 Mon Sep 17 00:00:00 2001 From: jlam Date: Thu, 22 Sep 2005 22:00:41 +0000 Subject: [PATCH] Convert to use options framework. --- mail/nmh/Makefile | 12 +++--------- mail/nmh/options.mk | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 mail/nmh/options.mk diff --git a/mail/nmh/Makefile b/mail/nmh/Makefile index a71aa3e33286..c5fe7d37c3b4 100644 --- a/mail/nmh/Makefile +++ b/mail/nmh/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.56 2005/03/24 21:12:56 wiz Exp $ +# $NetBSD: Makefile,v 1.57 2005/09/22 22:00:41 jlam Exp $ DISTNAME= nmh-1.0.4 PKGREVISION= 6 @@ -20,11 +20,12 @@ CONFLICTS+= ja-mh6-[0-9]* # Locks supported by `mail.local' are ".lock" and flock(2). .include "../../mk/bsd.prefs.mk" +.include "options.mk" # Mail Transport Agent - either "smtp" or "sendmail" NMH_MTA?= smtp -GNU_CONFIGURE= # defined +GNU_CONFIGURE= yes USE_PKGINSTALL= yes CONFIGURE_ARGS+= --libdir=${PREFIX}/libexec/nmh @@ -88,13 +89,6 @@ CONF_FILES+= ${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f} .endfor .undef f -.if defined(NMH_HASH_BACKUP) && (${NMH_HASH_BACKUP} == yes) -post-configure: - ${MV} ${WRKSRC}/config.h ${WRKSRC}/config.h.bak - ${SED} -e 's/^\(#define *BACKUP_PREFIX\) *.*/\1 "#"/' \ - < ${WRKSRC}/config.h.bak > ${WRKSRC}/config.h -.endif - # This hopefully makes sure the permissions and ownership are right. pre-install: ${INSTALL_DATA_DIR} ${EGDIR} diff --git a/mail/nmh/options.mk b/mail/nmh/options.mk new file mode 100644 index 000000000000..1d379ad1090c --- /dev/null +++ b/mail/nmh/options.mk @@ -0,0 +1,21 @@ +# $NetBSD: options.mk,v 1.1 2005/09/22 22:00:42 jlam Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.nmh +PKG_SUPPORTED_OPTIONS= nmh-backup-hash +PKG_OPTIONS_LEGACY_VARS+= NMH_HASH_BACKUP:nmh-backup-hash + +.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) +post-configure: nmh-hash-backup + +nmh-hash-backup: + cd ${WRKSRC}; file=config.h; \ + ${SED} -e 's/^\(#define *BACKUP_PREFIX\) *.*/\1 "#"/' \ + $$file > $$file.new; \ + ${MV} -f $$file.new $$file +.endif