pkgsrc/mail/courier-imap/Makefile
jlam daad0f3d6c Modify the pkginstall framework so that it manages all aspects of
INSTALL/DEINSTALL script creation within pkgsrc.

If an INSTALL or DEINSTALL script is found in the package directory,
it is automatically used as a template for the pkginstall-generated
scripts.  If instead, they should be used simply as the full scripts,
then the package Makefile should set INSTALL_SRC or DEINSTALL_SRC
explicitly, e.g.:

	INSTALL_SRC=	${PKGDIR}/INSTALL
	DEINSTALL_SRC=	# emtpy

As part of the restructuring of the pkginstall framework internals,
we now *always* generate temporary INSTALL or DEINSTALL scripts.  By
comparing these temporary scripts with minimal INSTALL/DEINSTALL
scripts formed from only the base templates, we determine whether or
not the INSTALL/DEINSTALL scripts are actually needed by the package
(see the generate-install-scripts target in bsd.pkginstall.mk).

In addition, more variables in the framework have been made private.
The *_EXTRA_TMPL variables have been renamed to *_TEMPLATE, which are
more sensible names given the very few exported variables in this
framework.  The only public variables relating to the templates are:

	INSTALL_SRC		INSTALL_TEMPLATE
	DEINSTALL_SRC		DEINSTALL_TEMPLATE
				HEADER_TEMPLATE

The packages in pkgsrc have been modified to reflect the changes in
the pkginstall framework.
2006-03-14 01:14:26 +00:00

87 lines
3.1 KiB
Makefile

# $NetBSD: Makefile,v 1.51 2006/03/14 01:14:29 jlam Exp $
DISTNAME= courier-imap-4.0.6
PKGREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=courier/}
EXTRACT_SUFX= .tar.bz2
MAINTAINER= jlam@pkgsrc.org
COMMENT= IMAP server for access to maildir-style mailboxes
HOMEPAGE= http://www.courier-mta.org/imap/
DEPENDS+= courier-maildir>=0.52.1:../../mail/courier-maildir
USE_TOOLS+= env gmake perl
USE_LANGUAGES= c c++
USE_LIBTOOL= yes
PKG_SUPPORTED_OPTIONS+= fam
# PKGNAME is a parameter to the following file
PKGNAME= ${DISTNAME}
.include "../../mail/courier-maildir/Makefile.common"
CONFIGURE_ARGS+= --datadir=${PREFIX}/share/courier
CONFIGURE_ARGS+= --libexecdir=${PREFIX}/libexec/courier
CONFIGURE_ARGS+= --with-mailuser=${ROOT_USER:Q}
CONFIGURE_ARGS+= --with-piddir=${VARBASE}/run
CONFIGURE_ARGS+= --program-transform-name='s/\.rc$$//'
CONFIGURE_ENV+= OPENSSL=${SSLBASE}/bin/openssl
INSTALL_AM_MAKEFLAGS= sysconfdir=${EGDIR}
INSTALL_MAKE_FLAGS= ${MAKE_FLAGS} AM_MAKEFLAGS=${INSTALL_AM_MAKEFLAGS:Q}
GEN_FILES= imapd imapd-ssl pop3d pop3d-ssl
SSLCNF_FILES= imapd.cnf pop3d.cnf
FILES_SUBST+= SSLCERTS=${SSLCERTS:Q}
FILES_SUBST+= GEN_FILES=${GEN_FILES:Q}
MAKE_DIRS= ${VARBASE}/run
CONF_FILES_PERMS= # empty
.for FILE in ${GEN_FILES}
CONF_FILES+= ${EGDIR}/${FILE}.dist ${PKG_SYSCONFDIR}/${FILE}
.endfor
.for FILE in ${SSLCNF_FILES}
CONF_FILES_PERMS+= ${EGDIR}/${FILE} ${PKG_SYSCONFDIR}/${FILE} \
${ROOT_USER} ${ROOT_GROUP} 0600
.endfor
RCD_SCRIPTS= courierimap courierimaps courierpop courierpops
SUBST_CLASSES+= courier
SUBST_MESSAGE.courier= "Convert to match courier-mta expectations."
SUBST_FILES.courier= imap/imapd.dist.in imap/imapd-ssl.dist.in \
imap/pop3d.dist.in imap/pop3d-ssl.dist.in \
imap/imapd.cnf.in imap/pop3d.cnf.in \
imap/mkimapdcert.in imap/mkpop3dcert.in \
imap/imapd.8.in imap/courierpop3d.8.in \
imapd-ssl.rc.in imapd.rc.in \
pop3d-ssl.rc.in pop3d.rc.in
SUBST_SED.courier= -e "s|^IMAPDSTART=.*|IMAPDSTART=YES|g" \
-e "s|^IMAPDSSLSTART=.*|IMAPDSSLSTART=YES|g" \
-e "s|^POP3DSTART=.*|POP3DSTART=YES|g" \
-e "s|^POP3DSSLSTART=.*|POP3DSSLSTART=YES|g" \
-e "s|@datadir@/imapd.pem|${SSLCERTS}/imapd.pem|g" \
-e "s|@datadir@/imapd.rand|@sysconfdir@/imapd.rand|g" \
-e "s|@datadir@/pop3d.pem|${SSLCERTS}/pop3d.pem|g" \
-e "s|@datadir@/pop3d.rand|@sysconfdir@/pop3d.rand|g" \
-e "s|@libexecdir@/couriertcpd|@sbindir@/couriertcpd|g" \
-e "s|@sbindir@/imaplogin|@libexecdir@/imaplogin|g" \
-e "s|@sbindir@/pop3login|@libexecdir@/courierpop3login|g" \
-e "s|@bindir@/pop3d|@libexecdir@/courierpop3d|g"
SUBST_STAGE.courier= pre-configure
.include "../../security/courier-authlib/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
post-install:
${INSTALL_DATA_DIR} ${EGDIR}
${INSTALL_DATA_DIR} ${DOCDIR}/imap
${INSTALL_DATA} ${WRKSRC}/imap/BUGS.html ${DOCDIR}/imap
${INSTALL_DATA} ${WRKSRC}/imap/README.html ${DOCDIR}/imap
${INSTALL_DATA} ${WRKSRC}/imap/README.proxy.html ${DOCDIR}/imap
${INSTALL_DATA} ${WRKSRC}/imap/imapd.pam ${EGDIR}/imap.pam
${INSTALL_DATA} ${WRKSRC}/imap/pop3d.pam ${EGDIR}/pop3.pam
.include "../../mk/bsd.pkg.mk"