aboutsummaryrefslogtreecommitdiffstats
path: root/mail/dk-milter/Makefile
blob: 0a591cf2e452cd52f5ccfa0502fa9e96747199ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# New ports collection makefile for:    dk-milter
# Date created:             22 May 2005
# Whom:                 ache
#
# $FreeBSD$
#

PORTNAME=   dk-milter
PORTVERSION=    0.4.1
PORTREVISION=   4
CATEGORIES= mail
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= dk-milter

MAINTAINER= dinoex@FreeBSD.org
COMMENT=    Domainkeys milter for Sendmail

USE_RC_SUBR=    milter-dk.sh

.if defined(WITH_POSTFIX_MILTER) || defined(WITH_POSTFIX) || defined(WITH_POSTFIX_CURRENT)
SENDMAIL_MILTER_IN_BASE=    yes
PKGMESSAGE= pkg-message.postfix

.if defined(WITH_POSTFIX_CURRENT)
RUN_DEPENDS+=   ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix-current
.else
RUN_DEPENDS+=   ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix
.endif
.endif

.if !defined(SENDMAIL_MILTER_IN_BASE)
.if defined(SENDMAIL_WITH_SHARED_MILTER)
LIB_DEPENDS+=   milter.3:${PORTSDIR}/mail/${SENDMAIL_MILTER_PORT}
.else
BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/${SENDMAIL_MILTER_PORT}
.endif
.endif

SENDMAIL_MILTER_PORT?=  sendmail
WCONF=      ${WRKSRC}/devtools/Site
MAN8=       dk-filter.8
DOCSFILES=  FEATURES INSTALL KNOWNBUGS LICENSE README RELEASE_NOTES \
        dk-filter/autorespond.csh

SITE+=      ${FILESDIR}/site.config.m4
.if !defined(SENDMAIL_MILTER_IN_BASE)
SITE+=      ${FILESDIR}/site.config.m4.milter
.endif

.include <bsd.port.pre.mk>

SUB_LIST=   "RC_SCRIPT=${PREFIX}/etc/rc.d/${USE_RC_SUBR:S/.sh$//}${RC_SUBR_SUFFIX}"

.if defined(SENDMAIL_WITHOUT_MILTER)
pre-fetch:
    @${ECHO_MSG}
    @${ECHO_MSG} You must unset variable SENDMAIL_WITHOUT_MILTER,
    @${ECHO_MSG} and rebuild sendmail in the ports
    @${FALSE}
.endif

pre-configure:
    ${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|' \
        -e 's|-D_THREAD_SAFE|${PTHREAD_CFLAGS}|' \
        -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
        -e "s|\`-O'|\`${CFLAGS}'|g" \
        ${WRKSRC}/devtools/OS/FreeBSD
    ${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \
        -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
        ${SITE} > ${WCONF}/site.config.m4

post-install:
    -${STRIP_CMD} ${PREFIX}/libexec/dk-filter
    ${INSTALL_SCRIPT} ${WRKSRC}/dk-filter/gentxt.csh \
        ${PREFIX}/sbin/gentxt-dk
.for i in ${MAN8}
    @${RM} -f ${MANPREFIX}/man/cat8/${i} ${MANPREFIX}/man/cat8/${i}.gz
    ${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man8/
.endfor
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
.for i in ${DOCSFILES}
    ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}/
.endfor
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>