aboutsummaryrefslogtreecommitdiffstats
path: root/mail/alpine/Makefile
blob: 54245ec19129672039d599da1dd990770a7b0e14 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# $FreeBSD$

PORTNAME?=  alpine
PORTVERSION=    2.00
PORTREVISION?=  4
CATEGORIES?=    mail news ipv6
MASTER_SITES=   ftp://ftp.cac.washington.edu/alpine/
DIST_SUBDIR=    alpine-${PORTVERSION}

MAINTAINER= c.petrik.sosa@gmail.com
COMMENT?=   Mail and news client descended from Pine

OPTIONS_DEFINE+=    THREADS MOUSE NLS ISPELL NOSPELL
OPTIONS_DEFAULT+=   THREADS MOUSE
MOUSE_DESC= Enable mouse support for xterm
ISPELL_DESC=    Use ispell instead of aspell as default speller
NOSPELL_DESC=   Use no default speller (overrides both)
.if !defined(PICO_ALPINE_SLAVE)
OPTIONS_DEFINE+=    PICO IPV6 LDAP PASSFILE CONS25 QUOTA MAILDIR SSL
OPTIONS_DEFAULT+=   PICO SSL
PICO_DESC=  Build and install pico, the default editor
PASSFILE_DESC=  Support for a stored password file (DANGEROUS)
CONS25_DESC=    Add a patch to support color for default console
QUOTA_DESC= Add a patch for disk quota checking on IMAP
MAILDIR_DESC=   Add a patch for maildir support
.endif

USE_BZIP2=  yes

MAKE_JOBS_UNSAFE=   yes

GNU_CONFIGURE=  yes

.if !defined(PICO_ALPINE_SLAVE)
CONFIGURE_ARGS+=--with-system-pinerc=${PREFIX}/etc/alpine.conf \
        --with-system-fixed-pinerc=${PREFIX}/etc/alpine.conf.fixed \
        --with-password-prog=/usr/bin/passwd \
        --with-system-mail-directory=/var/mail \
        --enable-background-post --without-krb5 --without-tcl
.endif
CONFIGURE_ARGS+=--with-debug-level=2

MAKE_ARGS+= CC="${CC}" CXX="${CXX}" GCCCFLAGS="${CFLAGS}"

USE_OPENSSL=    yes

NO_STAGE=   yes
.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MTHREADS}
CONFIGURE_ARGS+=    --with-pthread
.else
CONFIGURE_ARGS+=    --without-pthread
.endif

.if ${PORT_OPTIONS:MMOUSE}
CONFIGURE_ARGS+=    --enable-mouse
.else
CONFIGURE_ARGS+=    --disable-mouse
.endif

.if ${PORT_OPTIONS:MNLS}
CONFIGURE_ARGS+=    --enable-nls
.else
CONFIGURE_ARGS+=    --disable-nls
.endif

.if ! ${PORT_OPTIONS:MNOSPELL}
.if ! ${PORT_OPTIONS:MISPELL}
CONFIGURE_ARGS+=--with-interactive-spellcheck=${LOCALBASE}/bin/aspell
BUILD_DEPENDS+= aspell:${PORTSDIR}/textproc/aspell
RUN_DEPENDS+=   aspell:${PORTSDIR}/textproc/aspell
.else
CONFIGURE_ARGS+=    --with-interactive-spellcheck=${LOCALBASE}/bin/ispell
BUILD_DEPENDS+= ispell:${PORTSDIR}/textproc/ispell
RUN_DEPENDS+=   ispell:${PORTSDIR}/textproc/ispell
.endif
.else
CONFIGURE_ARGS+=--without-simple-spellcheck --without-interactive-spellcheck
.endif

.if !defined(PICO_ALPINE_SLAVE)
.if ${PORT_OPTIONS:MPICO}
RUN_DEPENDS+=   pico:${PORTSDIR}/editors/pico-alpine
.endif

.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+=    --with-ipv6
.else
CONFIGURE_ARGS+=    --without-ipv6
.endif

.if ${PORT_OPTIONS:MLDAP}
USE_OPENLDAP=       yes
CONFIGURE_ARGS+=    --with-ldap --with-ldap-dir=${LOCALBASE}
.else
CONFIGURE_ARGS+=    --without-ldap
.endif

.if ${PORT_OPTIONS:MPASSFILE}
ALPINE_PASSFILE?=   .alpine.pwd
CONFIGURE_ARGS+=    --with-passfile=.alpine.pwd
.endif

.if ${PORT_OPTIONS:MCONS25}
EXTRA_PATCHES=  ${FILESDIR}/cons25-alpine_keymenu.c
.endif

.if ${PORT_OPTIONS:MQUOTA} || ${PORT_OPTIONS:MMAILDIR}
PATCH_SITES=    ${MASTER_SITE_LOCAL}
PATCH_SITE_SUBDIR=  dougb/alpine-${PORTVERSION}/
PATCH_DIST_ARGS+=   -E --quiet -d ${PATCH_WRKSRC} -p1
.endif

.if ${PORT_OPTIONS:MQUOTA}
PATCHFILES+=    quota.patch.gz
.endif

.if ${PORT_OPTIONS:MMAILDIR}
PATCHFILES+=    maildir.patch.gz
.endif

.if ${PORT_OPTIONS:MSSL}
CONFIGURE_ARGS+=    --with-ssl-dir=${OPENSSLDIR} \
            --with-ssl-include-dir=${OPENSSLINC} \
            --with-ssl-lib-dir=${OPENSSLLIB} \
            --with-ssl-certs-dir=${OPENSSLDIR}/certs
.else
CONFIGURE_ARGS+=    --without-ssl
.endif

MAN1=       alpine.1 rpdump.1 rpload.1

pre-patch:
    @${CHMOD} -R u+w ${WRKSRC}

post-patch:
    @${CP} ${WRKSRC}/imap/Makefile ${WRKSRC}/imap/Makefile.presed
    @${SED} -e "s#^\(all:.*\) bundled\$$#\1#" \
        ${WRKSRC}/imap/Makefile.presed > ${WRKSRC}/imap/Makefile
    @${CP} ${WRKSRC}/pico/Makefile.in ${WRKSRC}/pico/Makefile.in.presed
    @${SED} -e "s#^bin_PROGRAMS = pico.*#bin_PROGRAMS =#" \
        -e "s#\$$(pico_SOURCES) \$$(pilot_SOURCES)##" \
        ${WRKSRC}/pico/Makefile.in.presed > ${WRKSRC}/pico/Makefile.in
    @${CP} ${WRKSRC}/Makefile.in ${WRKSRC}/Makefile.in.presed
    @${SED} -e "s#doc/pico.1 doc/pilot.1 ##" \
        ${WRKSRC}/Makefile.in.presed > ${WRKSRC}/Makefile.in
    @${CP} ${WRKSRC}/imap/src/osdep/unix/Makefile \
        ${WRKSRC}/imap/src/osdep/unix/Makefile.presed
    @${SED} -e "s#^LOCKPGM=.*#LOCKPGM= ${PREFIX}/libexec/mlock#" \
        ${WRKSRC}/imap/src/osdep/unix/Makefile.presed \
        > ${WRKSRC}/imap/src/osdep/unix/Makefile
    @for i in ${WRKSRC}/README ${WRKSRC}/doc/alpine.1 \
        ${WRKSRC}/doc/tech-notes.txt ${WRKSRC}/doc/tech-notes/*.html \
        ${WRKSRC}/pith/pine.hlp ; do \
        ${CP} $$i $$i.presed ; \
        ${SED} -e "s:/usr/local/lib/:${PREFIX}/etc/:g" \
            -e "s:/usr/local/pine.conf:${PREFIX}/etc/pine.conf:g" \
            -e "s:pine\.conf:alpine.conf:g" \
            -e "s:/usr/local:${PREFIX}:g" \
            -e "s:@@PREFIX@@:${PREFIX}:g" \
            $$i.presed > $$i ; \
    done

post-install:
.if ${PORT_OPTIONS:MDOCS}
    ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} ${DOCSDIR} \
        ${DOCSDIR}/tech-notes
    ${INSTALL_DATA} ${WRKSRC}/LICENSE ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/NOTICE ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/brochure.txt ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/tech-notes.txt ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/tech-notes/*.html ${DOCSDIR}/tech-notes
.endif
    PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

    @${CAT} ${PKGMESSAGE}
.endif  # !defined(PICO_ALPINE_SLAVE)

.include <bsd.port.post.mk>