Update mail/postfix-current to version 3.2.20161008,4
[dports.git] / mail / alpine / Makefile
1 # $FreeBSD$
2
3 PORTNAME?=      alpine
4 PORTVERSION=    2.20
5 PORTREVISION?=  1
6 CATEGORIES?=    mail news ipv6
7 MASTER_SITES=   http://patches.freeiz.com/alpine/release/src/
8 DIST_SUBDIR=    alpine-${PORTVERSION}
9
10 MAINTAINER=     mbeis@xs4all.nl
11 COMMENT?=       Mail and news client descended from Pine
12
13 LICENSE=        APACHE20
14
15 OPTIONS_DEFINE=         DOCS SSL THREADS MOUSE NLS ISPELL NOSPELL
16 OPTIONS_DEFAULT+=       DOCS SSL THREADS MOUSE
17 SSL_DESC=       Build with SSL (installs: security/openssl if pre 10.x)
18 MOUSE_DESC=     Enable mouse support for xterm
19 ISPELL_DESC=    Use ispell instead of aspell as default speller
20 NOSPELL_DESC=   Use no default speller (overrides both)
21
22 .if !defined(PICO_ALPINE_SLAVE)
23
24 OPTIONS_DEFINE+=        PICO IPV6 LDAP PASSFILE CONS25 MAILDIR SSL
25 OPTIONS_DEFAULT+=       PICO SSL
26 PICO_DESC=      Build and install pico, the default editor
27 PASSFILE_DESC=  Support for a stored password file (DANGEROUS)
28 CONS25_DESC=    Add a patch to support color for default console
29 MAILDIR_DESC=   Add a patch for maildir support
30 .endif
31
32 USES=           libtool ncurses tar:xz
33
34 MAKE_JOBS_UNSAFE=       yes
35
36 GNU_CONFIGURE=  yes
37
38 .if !defined(PICO_ALPINE_SLAVE)
39
40 PORTDOCSbase=   LICENSE NOTICE README
41 PORTDOCSdoc=    brochure.txt
42 PORTDOCShtml=   tech-notes/background.html tech-notes/cmd-line.html \
43                 tech-notes/config-notes.html tech-notes/config.html \
44                 tech-notes/index.html tech-notes/installation.html \
45                 tech-notes/introduction.html tech-notes/low-level.html \
46                 tech-notes/tech-notes.txt
47 PORTDOCS=       ${PORTDOCSbase} ${PORTDOCSdoc} ${PORTDOCShtml}
48
49 CONFIGURE_ARGS+=--with-system-pinerc=${PREFIX}/etc/alpine.conf \
50                 --with-system-fixed-pinerc=${PREFIX}/etc/alpine.conf.fixed \
51                 --with-password-prog=/usr/bin/passwd \
52                 --with-system-mail-directory=/var/mail
53
54 .endif
55 CONFIGURE_ARGS+=--with-debug-level=2 \
56                 --enable-background-post --without-krb5 --without-tcl
57
58 MAKE_ARGS+=     CC="${CC}" CXX="${CXX}" GCCCFLAGS="${CFLAGS}"
59
60 .include <bsd.port.options.mk>
61
62 .if ${PORT_OPTIONS:MSSL}
63 USE_OPENSSL=    yes
64 .if  ${OSVERSION} < 1000000
65 # OpenSSL is pre v1.0 in FBSD9.x so the ports version needs to be used
66 WITH_OPENSSL_PORT=      yes
67 .endif
68
69 CONFIGURE_ARGS+=        --with-ssl-dir=${OPENSSLDIR} \
70                         --with-ssl-include-dir=${OPENSSLINC} \
71                         --with-ssl-lib-dir=${OPENSSLLIB} \
72                         --with-ssl-certs-dir=${OPENSSLDIR}/certs
73 .else
74 CONFIGURE_ARGS+=        --without-ssl
75 USE_OPENSSL=            no
76 .endif
77
78 .include <bsd.port.pre.mk>
79
80 THREADS_CONFIGURE_WITH= pthread
81 MOUSE_CONFIGURE_ENABLE= mouse
82 NLS_CONFIGURE_ENABLE=   nls
83 IPV6_CONFIGURE_WITH=    ipv6
84
85 .if ! ${PORT_OPTIONS:MNOSPELL}
86 .if ! ${PORT_OPTIONS:MISPELL}
87 CONFIGURE_ARGS+=--with-interactive-spellcheck=${LOCALBASE}/bin/aspell
88 BUILD_DEPENDS+= aspell:textproc/aspell
89 RUN_DEPENDS+=   aspell:textproc/aspell
90 .else
91 CONFIGURE_ARGS+=        --with-interactive-spellcheck=${LOCALBASE}/bin/ispell
92 BUILD_DEPENDS+= ispell:textproc/aspell-ispell
93 RUN_DEPENDS+=   ispell:textproc/aspell-ispell
94 .endif
95 .else
96 CONFIGURE_ARGS+=--without-simple-spellcheck --without-interactive-spellcheck
97 .endif
98
99 .if !defined(PICO_ALPINE_SLAVE)
100 .if ${PORT_OPTIONS:MPICO}
101 RUN_DEPENDS+=   pico:editors/pico-alpine
102 .endif
103
104 .if ${PORT_OPTIONS:MLDAP}
105 USE_OPENLDAP=           yes
106 CONFIGURE_ARGS+=        --with-ldap-dir=${LOCALBASE}
107 .else
108 CONFIGURE_ARGS+=        --without-ldap
109 .endif
110
111 .if ${PORT_OPTIONS:MPASSFILE}
112 ALPINE_PASSFILE?=       .alpine.pwd
113 CONFIGURE_ARGS+=        --with-passfile=.alpine.pwd
114 .endif
115
116 .if ${PORT_OPTIONS:MMAILDIR}
117 PATCH_SITES=            http://patches.freeiz.com/alpine/patches/alpine-${PORTVERSION}/
118 PATCHFILES+=            maildir.patch.gz
119 PATCH_DIST_ARGS+=       -E --quiet -d ${PATCH_WRKSRC} -p1
120 .endif
121
122 .if ${PORT_OPTIONS:MCONS25}
123 EXTRA_PATCHES=          ${FILESDIR}/cons25-alpine_keymenu.c
124 .endif
125
126 pre-patch:
127         @${CHMOD} -R u+w ${WRKSRC}
128
129 post-patch:
130         @${CP} ${WRKSRC}/imap/Makefile ${WRKSRC}/imap/Makefile.presed
131         @${SED} -e "s#^\(all:.*\) bundled\$$#\1#" \
132             ${WRKSRC}/imap/Makefile.presed > ${WRKSRC}/imap/Makefile
133         @${CP} ${WRKSRC}/pico/Makefile.in ${WRKSRC}/pico/Makefile.in.presed
134         @${SED} -e "s#^bin_PROGRAMS = pico.*#bin_PROGRAMS =#" \
135             -e "s#\$$(pico_SOURCES) \$$(pilot_SOURCES)##" \
136             ${WRKSRC}/pico/Makefile.in.presed > ${WRKSRC}/pico/Makefile.in
137         @${CP} ${WRKSRC}/Makefile.in ${WRKSRC}/Makefile.in.presed
138         @${SED} -e "s#doc/pico.1 doc/pilot.1 ##" \
139             ${WRKSRC}/Makefile.in.presed > ${WRKSRC}/Makefile.in
140         @${CP} ${WRKSRC}/imap/src/osdep/unix/Makefile \
141             ${WRKSRC}/imap/src/osdep/unix/Makefile.presed
142         @${SED} -e "s#^LOCKPGM=.*#LOCKPGM= ${PREFIX}/libexec/mlock#" \
143             ${WRKSRC}/imap/src/osdep/unix/Makefile.presed \
144             > ${WRKSRC}/imap/src/osdep/unix/Makefile
145         @for i in ${WRKSRC}/README ${WRKSRC}/doc/alpine.1 \
146             ${WRKSRC}/doc/*.txt \
147             ${WRKSRC}/doc/tech-notes/*.txt \
148             ${WRKSRC}/doc/tech-notes/*.html \
149             ${WRKSRC}/pith/pine.hlp ; do \
150                 ${CP} $$i $$i.presed ; \
151                 ${SED} -e "s:/usr/local/lib/:${PREFIX}/etc/:g" \
152                     -e "s:/usr/local/pine.conf:${PREFIX}/etc/pine.conf:g" \
153                     -e "s:pine\.conf:alpine.conf:g" \
154                     -e "s:/usr/local:${PREFIX}:g" \
155                     -e "s:@@PREFIX@@:${PREFIX}:g" \
156                     $$i.presed > $$i ; \
157         done
158
159 post-install:
160         ${STAGEDIR}${PREFIX}/bin/alpine -conf > ${STAGEDIR}${PREFIX}/etc/alpine.conf.sample
161 .if ${PORT_OPTIONS:MDOCS}
162         ${INSTALL} -d ${STAGEDIR}${DOCSDIR} ${STAGEDIR}${DOCSDIR}/tech-notes
163 .for f in ${PORTDOCSbase}
164         ${INSTALL_MAN} ${WRKSRC}/$f ${STAGEDIR}${DOCSDIR}
165 .endfor
166 .for f in ${PORTDOCSdoc}
167         ${INSTALL_MAN} ${WRKSRC}/doc/$f ${STAGEDIR}${DOCSDIR}
168 .endfor
169 .for f in ${PORTDOCShtml}
170         ${INSTALL_MAN} ${WRKSRC}/doc/$f ${STAGEDIR}${DOCSDIR}/tech-notes
171 .endfor
172 .endif
173
174 #       PKG_PREFIX=${STAGEDIR}${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
175 #       @${CAT} ${PKGMESSAGE}
176
177 .endif  # !defined(PICO_ALPINE_SLAVE)
178
179 .include <bsd.port.post.mk>