aboutsummaryrefslogtreecommitdiffstats
path: root/mail/fetchmail/Makefile
blob: 4e77572f20b1ee61354e517f2a643faeeae095b6 (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
# New ports collection makefile for:    fetchmail
# Date created:     25 Feb 2000
# Whom:         Ville Eerola <ve@sci.fi>
#
# $FreeBSD$
#
# NOTE:  The fetchmailconf program (an interactive program for
# writing .fetchmailrc files) requires Python, Tk, X11, etc..
# The fetchmail program itself does not need Python, but if you
# want fetchmailconf to work, define WITH_X11

PORTNAME=   fetchmail
PORTVERSION=    6.3.0
PORTREVISION=   1
CATEGORIES= mail ipv6
MASTER_SITES=   http://download.berlios.de/%SUBDIR%/ \
        http://home.pages.de/~mandree/%SUBDIR%/ \
        http://home.leo.org/~barner/freebsd/distfiles/
MASTER_SITE_SUBDIR= fetchmail

MAINTAINER= barner@FreeBSD.org
COMMENT=    Batch mail retrieval utility for IMAP/POP2/POP3/ETRN/ODMR

USE_BZIP2=  yes
USE_REINPLACE=  yes
USE_GMAKE=  yes
GNU_CONFIGURE=  yes
USE_OPENSSL=    yes
CONFIGURE_TARGET=   --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS= --enable-opie --enable-RPA --enable-POP2 --enable-SDPS \
        --with-hesiod=no --enable-fallback=no
# bsd.openssl.mk will add the LDFLAGS to CONFIGURE_ENV:
LDFLAGS=    -L${LOCALBASE}/lib
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
        CFLAGS="-I${LOCALBASE}/include ${CFLAGS}"
MAKE_ENV+=  ${CONFIGURE_ENV}
MAN1=       fetchmail.1
MLINKS=     fetchmail.1 fetchmailconf.1

.if defined(WITH_X11)
USE_PYTHON= yes
RUN_DEPENDS+=   ${LOCALBASE}/lib/${PYTHON_VERSION}/site-packages/_tkinter.so:${PORTSDIR}/x11-toolkits/py-tkinter
.endif

.include <bsd.port.pre.mk>

CONFIGURE_ARGS+=    --with-ssl=${OPENSSLBASE}

DOCS=       FAQ FEATURES NEWS NOTES README README.SSL \
        design-notes.html fetchmail-FAQ.html fetchmail-features.html \
        esrs-design-notes.html

.if !defined(WITHOUT_NLS)
CONFIGURE_ARGS+=    --enable-nls
PLIST_SUB+=     NLS=""
USE_GETTEXT=        yes
.else
CONFIGURE_ARGS+=    --disable-nls
PLIST_SUB+=     NLS="@comment "
.endif

.if defined(KRB5_HOME) && exists(${KRB5_HOME}/lib/libkrb5.a)
CONFIGURE_ARGS += --with-kerberos5=${KRB5_HOME}
.elif exists(/usr/lib/libkrb.a) && defined(MAKE_KERBEROS4)
CONFIGURE_ARGS += --with-kerberos=/usr
.endif

.if defined(WITH_NTLM)
CONFIGURE_ARGS += --enable-NTLM
DOCS+=      README.NTLM
PLIST_SUB+= NTLMDOCS="%%PORTDOCS%%"
.else
PLIST_SUB+= NTLMDOCS="%%PORTDOCS%%@comment "
.endif

pre-patch:
    @${REINPLACE_CMD} -e "s,^#!/usr/bin/env python,#!${LOCALBASE}/bin/python,g" \
        ${WRKSRC}/fetchmailconf.py
    @${CP} ${FILESDIR}/fetchmailconf ${WRKDIR}/fetchmailconf
    @${REINPLACE_CMD} -e "s,@LOCALBASE@,${LOCALBASE},g" \
         ${WRKDIR}/fetchmailconf
post-install:
.if !defined(NOPORTDOCS)
    ${INSTALL} -d -m 555 -o ${DOCOWN} -g ${DOCGRP} ${DOCSDIR}
    cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
.endif

    ${INSTALL_SCRIPT} ${WRKDIR}/fetchmailconf ${PREFIX}/bin

pre-configure:
.if defined(WITH_NTLM)
    @${ECHO_CMD} "Building in support for NTLM/MSN authentication."
.else
    @${ECHO_CMD} "Add -DWITH_NTLM to add support for NTLM/MSN authentication."
.endif
.if defined(WITH_X11)
    @${ECHO_CMD) "Adding Python/Tkinter dependencies for fetchmailconf."
.else
    @${ECHO_CMD} "Add -DWITH_X11 to add Python/Tkinter dependencies for fetchmailconf."
.endif
.if defined(WITHOUT_NLS)
    @${ECHO_CMD} "Using national language support (NLS)."
.else
    @${ECHO_CMD} "You can use -DWITHOUT_NLS to suppress national language support (NLS)."
.endif

.include <bsd.port.post.mk>