aboutsummaryrefslogtreecommitdiffstats
path: root/mail/popa3d/Makefile
blob: 9469526f49dace22050f5ed5d7b8b27dc0021932 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Created by: Sergey Samoyloff <gonza@techline.ru>
# $FreeBSD$

PORTNAME=   popa3d
PORTVERSION=    1.0.3
CATEGORIES= mail
MASTER_SITES=   http://www.openwall.com/popa3d/ \
        ftp://ftp.openwall.com/pub/projects/popa3d/
PKGNAMESUFFIX?= ${SMTP_AFTER_POP3_SUFFIX}${STANDALONE_SUFFIX}${PKGNAMESUFFIX2}

MAINTAINER= ports@FreeBSD.org
COMMENT=    Secure, performance, tiny POP3 daemon

ALL_TARGET= popa3d
PLIST=      ${WRKDIR}/.PLIST.more
CFLAGS+=    -DPREFIX=${PREFIX}

OPTIONS_DEFINE= SMTP_AFTER_POP3 STANDALONE_POP3 SETPROCTITLE DOCS
NO_OPTIONS_SORT=yes
SMTP_AFTER_POP3_DESC=Enable SMTP-after-POP support
STANDALONE_POP3_DESC=Enable standalone server mode
SETPROCTITLE_DESC=Enable setproctitle() support

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MSTANDALONE_POP3}
STANDALONE_SUFFIX=  -standalone
PLIST_SUB+= STANDALONE_POP3=""
CONFLICTS?= popa3d-0.* popa3d-before-sendmail-0.*
USE_RC_SUBR=    popa3d
PKGMESSAGE= ${NONEXISTENT}
PKGDEINSTALL=   ${NONEXISTENT}
.else
SUB_FILES=  pkg-message
PLIST_SUB+= STANDALONE_POP3="@comment "
.endif

.if ${PORT_OPTIONS:MSMTP_AFTER_POP3}
SMTP_AFTER_POP3_SUFFIX= -before-sendmail
EXTRA_PATCHES+= ${FILESDIR}/pop-before-sendmail.patch
PLIST_SUB+= SMTP_AFTER_POP3=""
CONFLICTS?= popa3d-0.* popa3d-standalone-0.*
.else
PLIST_SUB+= SMTP_AFTER_POP3="@comment "
CONFLICTS?= popa3d-standalone-0.* popa3d-before-sendmail-0.*
.endif

.if ${PORT_OPTIONS:MSETPROCTITLE}
EXTRA_PATCHES+= ${FILESDIR}/setproctitle.patch
.endif

.include <bsd.port.pre.mk>

pre-configure:
    @${CAT} ${PKGDIR}/pkg-plist >${PLIST}
.if !exists(/var/empty)
    @${REINPLACE_CMD} -e "s=/var/empty=${PREFIX}/empty=" \
        ${WRKSRC}/params.h
    @${ECHO_CMD} "@exec ${MKDIR} %D/empty" >>${PLIST}
    @${ECHO_CMD} "@dirrm empty" >>${PLIST}
.endif

.if ${PORT_OPTIONS:MSMTP_AFTER_POP3} && !defined(WITHOUT_POPAUTH_M4)
    @${ECHO_CMD} "@cwd ${CFDIR}" >>${PLIST}
    @${ECHO_CMD} "hack/popauth.m4" >>${PLIST}
.endif
.if ${PORT_OPTIONS:MSTANDALONE_POP3}
    @${REINPLACE_CMD} -e 's|^\(#define POP_STANDALONE\).*|\1 1|' \
        ${WRKSRC}/params.h
.endif
.if defined(MAILBOX_HOME)
    @${REINPLACE_CMD} -e 's|^#define \(MAIL_SPOOL_PATH\).*|#undef \1|' \
        ${WRKSRC}/params.h
.endif

pre-install:
    @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
.if !exists(/var/empty)
    @${MKDIR} ${PREFIX}/empty
.endif

do-install:
    ${INSTALL} ${COPY} -m 500 \
        ${WRKSRC}/popa3d ${STAGEDIR}${PREFIX}/libexec/popa3d
    ${INSTALL_MAN} ${WRKSRC}/popa3d.8 ${STAGEDIR}${MANPREFIX}/man/man8/
.if ${PORT_OPTIONS:MSMTP_AFTER_POP3} && !defined(WITHOUT_POPAUTH_M4)
    ${MKDIR} ${STAGEDIR}${CFDIR}/hack
    ${INSTALL_DATA} ${FILESDIR}/popauth.m4 ${STAGEDIR}${CFDIR}/hack/
.endif

.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_MAN} ${WRKSRC}/DESIGN ${STAGEDIR}${DOCSDIR}/
    ${INSTALL_MAN} ${WRKSRC}/LICENSE ${STAGEDIR}${DOCSDIR}/
.if ${PORT_OPTIONS:MSMTP_AFTER_POP3}
    ${INSTALL_DATA} ${FILESDIR}/POPAUTH ${STAGEDIR}${DOCSDIR}/
.endif
.endif

.if exists(${LOCALBASE}/share/sendmail/cf/mailer/uucp.m4)
CFDIR=      ${LOCALBASE}/share/sendmail/cf
.else
CFDIR=      /usr/share/sendmail/cf
.endif

.include <bsd.port.post.mk>