aboutsummaryrefslogtreecommitdiffstats
path: root/mail/tpop3d/Makefile
blob: 74b4e632a82f82aa848d8ef1591ee4d316e5b84f (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# New ports collection makefile for:    tpop3d
# Date created:     27 July 2001
# Whom:         chris@shagged.org
#
# $FreeBSD$
#

PORTNAME=   tpop3d
PORTVERSION=    1.5.4
CATEGORIES= mail
MASTER_SITES=   ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= tpop3d

MAINTAINER= boris@tagnet.ru
COMMENT=    Virtual-domain capable POP3 server supporting MySQL, PgSQL etc auth

USE_OPENSSL=    yes
GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --enable-auth-other \
        --enable-tcp-wrappers \
        --enable-tls \
        --with-mailspool-directory=/var/mail
CONFIGURE_TARGET=   --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}

OPTIONS=    MYSQL       "Use MySQL authentication"          off \
        PGSQL       "Use PgSQL authentication"          off \
        LDAP        "Use LDAP authentication"           off \
        PERLAUTH    "Use Perl authentication"           off \
        PASSWDAUTH  "Use /etc/passwd authentication"        off \
        FLATAUTH    "Use /etc/passwd-style flat file authentication"    off \
        GDBMAUTH        "Use authentication against GNU dbm files"      off \
        MAILDIR     "Compile Maildir support"           on \
        MBOXINDICES "Save Mbox indices"             off \
        DRAC        "Enable DRAC RFC for POP-before-SMTP relaying"  off \
        FIX_PERLAUTH    "Only try it if perl-auth coredumps"        off

.include <bsd.port.pre.mk>

# MySQL authentication
.if defined(WITH_MYSQL)
.if defined(WITH_PGSQL)
BROKEN= MySQL and PgSQL authentication can not be build together
.endif
USE_MYSQL=      yes
CONFIGURE_ARGS+=    --enable-auth-mysql \
            --with-mysql-lib-dir=${LOCALBASE}/lib/mysql \
            --with-mysql-include-dir=${LOCALBASE}/include/mysql
.endif

.if defined(WITH_PGSQL)
USE_PGSQL=      yes
DEFAULT_PGSQL_VER=  80
CONFIGURE_ARGS+=    --enable-auth-pgsql \
            --with-pgsql-lib-dir=${LOCALBASE}/lib \
            --with-pgsql-include-dir=${LOCALBASE}/include
.endif

.if defined(WITH_LDAP)
USE_OPENLDAP=       yes
CONFIGURE_ARGS+=    --enable-auth-ldap --with-openldap-root=${LOCALBASE}
.endif

# Perl authentication
.if defined(WITH_PERLAUTH)
USE_PERL5=      yes
CONFIGURE_ARGS+=    --enable-auth-perl
.endif

.if defined(WITH_FLATAUTH)
CONFIGURE_ARGS+=    --enable-auth-flatfile
.endif

.if defined(WITH_GDBMAUTH)
LIB_DEPENDS=    gdbm:${PORTSDIR}/databases/gdbm
CONFIGURE_ARGS+=    --enable-auth-gdbm
.endif

.if defined(WITH_PASSWDAUTH)
CONFIGURE_ARGS+=    --enable-auth-passwd
.endif

.if defined(WITH_MAILDIR)
CONFIGURE_ARGS+=    --enable-mbox-maildir
.endif

.if defined(WITH_MBOXINDICES)
CONFIGURE_ARGS+=    --enable-mbox-bsd-save-indices
.endif

.if defined(WITH_DRAC)
CONFIGURE_ARGS+=    --enable-drac
BUILD_DEPENDS+=     ${LOCALBASE}/lib/libdrac.a:${PORTSDIR}/mail/drac
LDFLAGS+=       -L${LOCALBASE}/lib
.endif

.if defined(WITH_FIX_PERLAUTH)
EXTRA_PATCHES+=${PATCHDIR}/extra-patch-auth_perl.c
.endif

USE_RC_SUBR=    tpop3d.sh
DEFAULT_CONFIG= ${PREFIX}/etc/tpop3d.conf.dist

MAN5=       tpop3d.conf.5
MAN8=       tpop3d.8
.if !defined(NOPORTDOCS)
PORTDOCS=   CHANGES CREDITS FAQ HACKING INSTALL PORTABILITY \
            README README.POP-before-SMTP README.auth_mysql TODO
.endif

post-patch:
    @${REINPLACE_CMD} 's,^CFLAGS =, CFLAGS = \@CFLAGS\@,' \
        ${WRKSRC}/Makefile.in
    @${REINPLACE_CMD} 's,/etc/tpop3d,${PREFIX}/etc/tpop3d,g' \
        ${WRKSRC}/tpop3d.conf.5 ${WRKSRC}/tpop3d.8

post-install:
    ${INSTALL_DATA} ${FILESDIR}/tpop3d.conf.dist ${DEFAULT_CONFIG}
    @if [ ! -f ${PREFIX}/etc/tpop3d.conf ]; then            \
        ${INSTALL_DATA} ${FILESDIR}/tpop3d.conf.dist        \
            ${PREFIX}/etc/tpop3d.conf ;         \
    fi
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif

.include <bsd.port.post.mk>