1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-18 03:46:03 +00:00
freebsd-ports/mail/sendmail/Makefile
Dirk Meyer 085b5c0861 Fix support for "site.config.m4.local",
so User-Options will be part of the build.
2002-04-29 10:33:21 +00:00

202 lines
6.5 KiB
Makefile

# New ports collection makefile for: sendmail
# Date created: 20 Apr 2000
# Whom: dirk.meyer@dinoex.sub.org
#
# $FreeBSD$
#
PORTNAME= sendmail
PORTVERSION= 8.12.3
PORTREVISION= 1
CATEGORIES= mail ipv6
MASTER_SITES= ftp://ftp.sendmail.org/pub/sendmail/ \
${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/mail/sendmail/&,}
DISTNAME= ${PORTNAME}.${PORTVERSION}
MAINTAINER= dinoex@FreeBSD.org
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
WCONF= ${WRKSRC}/devtools/Site
SITE= ${FILESDIR}/site.config.m4.pre4
PLIST= ${WRKDIR}/.PLIST.more
DOCS= KNOWNBUGS LICENSE PGPKEYS README RELEASE_NOTES \
sendmail/TRACEFLAGS sendmail/SECURITY sendmail/TUNING
MAN1= mailq.1 newaliases.1 vacation.1
MAN5= aliases.5
MAN8= sendmail.8 mailstats.8 makemap.8 praliases.8 smrsh.8 \
mail.local.8 rmail.8 editmap.8
# Options to define Features:
# SENDMAIL_WITHOUT_IPV6=yes
# SENDMAIL_WITHOUT_MILTER=yes
# SENDMAIL_WITH_TLS=yes
# SENDMAIL_WITH_SASL=yes
# SENDMAIL_WITH_LDAP=yes
.if defined(SENDMAIL_WITH_LDAP)
PKGNAMESUFFIX?= -ldap
LIB_DEPENDS+= ldap.2:${PORTSDIR}/net/openldap2
LIB_DEPENDS+= lber.2:${PORTSDIR}/net/openldap2
.endif
.if defined(SENDMAIL_WITH_SASL)
LIB_DEPENDS+= sasl.8:${PORTSDIR}/security/cyrus-sasl
PKGNAMESUFFIX?= -sasl
.endif
.if defined(SENDMAIL_WITH_TLS) || defined(WITH_TLS)
PKGNAMESUFFIX?= -tls
USE_OPENSSL= yes
.endif
# Build site.config.m4
.if exists(${DESTDIR}/etc/mail/mailer.conf)
SITE+= ${FILESDIR}/site.config.m4
.if ! defined(SENDMAIL_WITHOUT_IPV6)
SITE+= ${FILESDIR}/site.config.m4.ipv6
.endif
.endif
.if defined(SENDMAIL_WITH_TLS) || defined(WITH_TLS)
.if ! exists(${DESTDIR}/etc/mail/mailer.conf)
SITE+= ${FILESDIR}/site.config.m4.ssl
.endif
SITE+= ${FILESDIR}/site.config.m4.tls
.endif
.if defined(SENDMAIL_WITH_SASL)
SITE+= ${FILESDIR}/site.config.m4.sasl
.endif
.if defined(SENDMAIL_WITH_LDAP)
SITE+= ${FILESDIR}/site.config.m4.ldap
.endif
.if ! defined(SENDMAIL_WITHOUT_MILTER)
SITE+= ${FILESDIR}/site.config.m4.milter
.endif
# install directly if no mailwrapper support
.if ! exists(${DESTDIR}/etc/mail/mailer.conf)
PREFIX?= ${DESTDIR}/usr
MANPREFIX?= ${DESTDIR}/usr/share
.endif
PLIST_SUB+= PREFIX=${PREFIX:S=${PREFIX}/==}
SENDMAIL= ${PREFIX}/sbin/sendmail
post-extract:
@${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/sm-client.sh \
> ${WRKSRC}/sm-client.sh
@${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/sendmail.sh \
> ${WRKSRC}/sendmail.sh
do-configure:
${PERL} -pi -e "s,\`-pthread\',\`${PTHREAD_LIBS}\'," \
${WRKSRC}/devtools/OS/FreeBSD
${PERL} -pi -e "s,\`-O\',\`${CFLAGS}\'," ${WRKSRC}/devtools/OS/FreeBSD
${SED} -e "s=%%PREFIX%%=${PREFIX}=" -e "s=%%LOCALBASE%%=${LOCALBASE}=" \
${SITE} > ${WCONF}/site.config.m4
.if ! defined(SENDMAIL_WITHOUT_MILTER)
post-build:
( cd ${WRKSRC}/libmilter && ${MAKE} )
.endif
pre-install:
@${CAT} ${PKGDIR}/pkg-plist >${PLIST}
.if ! defined(SENDMAIL_WITHOUT_MILTER)
@${CAT} ${FILESDIR}/pkg-milter >>${PLIST}
.endif
if ! pw groupshow smmsp; then pw groupadd smmsp -g 90; fi
if ! pw usershow smmsp; then pw useradd smmsp -g smmsp -u 90 \
-h - -d /nonexistent -s /nonexistent -c "Sendmail Queue"; fi
.if !defined(NOPORTDOCS)
@cd ${WRKSRC} && find cf -type f | \
${AWK} '{print "share/sendmail/" $$1}' >>${PLIST}
@cd ${WRKSRC} && find -d cf -type d | \
${AWK} '{print "@dirrm share/sendmail/" $$1}' >>${PLIST}
@${ECHO_CMD} "@dirrm share/sendmail" >>${PLIST}
.for i in ${DOCS}
@${ECHO_CMD} `${BASENAME} ${i}` | \
${AWK} '{print "share/doc/sendmail/" $$1}' >>${PLIST}
.endfor
@${ECHO_CMD} "@dirrm share/doc/sendmail" >>${PLIST}
.endif
# We want mail.local and rmail for our system.
# the build install catmans only, we have to fix this.
post-install:
( cd ${WRKSRC}/mail.local && ${MAKE} force-install )
( cd ${WRKSRC}/rmail && ${MAKE} force-install )
.if ! defined(SENDMAIL_WITHOUT_MILTER)
${MKDIR} ${PREFIX}/include/libmilter
${INSTALL_DATA} ${WRKSRC}/include/libmilter/mfapi.h \
${WRKSRC}/include/libmilter/mfdef.h \
${PREFIX}/include/libmilter/
${INSTALL_DATA} \
${WRKSRC}/obj.`${WRKSRC}/devtools/bin/Build -A`/libmilter/libmilter.a \
${WRKSRC}/obj.`${WRKSRC}/devtools/bin/Build -A`/libsm/libsm.a \
${WRKSRC}/obj.`${WRKSRC}/devtools/bin/Build -A`/libsmutil/libsmutil.a \
${WRKSRC}/obj.`${WRKSRC}/devtools/bin/Build -A`/libsmdb/libsmdb.a \
${PREFIX}/lib/
.endif
${INSTALL_SCRIPT} ${WRKSRC}/sm-client.sh \
${PREFIX}/etc/rc.d/sm-client.sh.sample
${INSTALL_SCRIPT} ${WRKSRC}/sendmail.sh \
${PREFIX}/etc/rc.d/sendmail.sh.sample
${CHOWN} smmsp:smmsp /var/spool/clientmqueue
${CHMOD} 770 /var/spool/clientmqueue
.for i in ${MAN8}
@${RM} -f ${MANPREFIX}/man/cat8/${i} ${MANPREFIX}/man/cat8/${i}.gz
${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man8
.endfor
.for i in ${MAN5}
@${RM} -f ${MANPREFIX}/man/cat5/${i} ${MANPREFIX}/man/cat5/${i}.gz
${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man5
.endfor
.for i in ${MAN1}
@${RM} -f ${MANPREFIX}/man/cat1/${i} ${MANPREFIX}/man/cat1/${i}.gz
${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man1
.endfor
.if !defined(NOPORTDOCS)
${MKDIR} ${PREFIX}/share/sendmail ${DOCSDIR}
@${TAR} -C ${WRKSRC} -cf - cf | \
${TAR} -C ${PREFIX}/share/sendmail -xf -
@cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}/
${INSTALL_DATA} ${WRKSRC}/doc/op/op.ps ${DOCSDIR}/op.ps
${INSTALL_DATA} ${WRKSRC}/devtools/README ${DOCSDIR}/DEVTOOLS
${INSTALL_DATA} ${WRKSRC}/sendmail/README ${DOCSDIR}/SENDMAIL
${INSTALL_DATA} ${WRKSRC}/mail.local/README ${DOCSDIR}/MAIL.LOCAL
${INSTALL_DATA} ${WRKSRC}/smrsh/README ${DOCSDIR}/SMRSH
.if ! defined(SENDMAIL_WITHOUT_MILTER)
${INSTALL_DATA} ${WRKSRC}/libmilter/README ${DOCSDIR}/MILTER
${MKDIR} ${DOCSDIR}/libmilter
@${TAR} -C ${WRKSRC}/libmilter/docs -cf - . | \
${TAR} -C ${DOCSDIR}/libmilter -xf -
.endif
.endif
.if exists(${DESTDIR}/etc/mail/mailer.conf)
@${SED} s!%%PREFIX%%!${PREFIX}!g ${PKGMESSAGE}
mailer.conf:
@${SED} \
-e "s=^sendmail[ ]*/.*$$=sendmail ${SENDMAIL}=" \
-e "s=^send-mail[ ]*/.*$$=send-mail ${SENDMAIL}=" \
-e "s=^mailq[ ]*/.*$$=mailq ${SENDMAIL}=" \
-e "s=^newaliases[ ]*/.*$$=newaliases ${SENDMAIL}=" \
-e "s=^hoststat[ ]*/.*$$=hoststat ${SENDMAIL}=" \
-e "s=^purgestat[ ]*/.*$$=purgestat ${SENDMAIL}=" \
${DESTDIR}/etc/mail/mailer.conf > ${DESTDIR}/etc/mail/mailer.conf.new
${MV} ${DESTDIR}/etc/mail/mailer.conf.new \
${DESTDIR}/etc/mail/mailer.conf
.endif
submit.cf:
${INSTALL_DATA} ${PREFIX}/share/sendmail/cf/cf/submit.mc \
${DESTDIR}/etc/mail/submit.mc
@( cd ${DESTDIR}/etc/mail && ${MAKE} \
SENDMAIL_CF_DIR=${PREFIX}/share/sendmail/cf \
SENDMAIL_MC=submit )
.include <bsd.port.pre.mk>
.if exists(${FILESDIR}/site.config.m4.local)
SITE+= ${FILESDIR}/site.config.m4.local
.endif
.include <bsd.port.post.mk>