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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
# New ports collection makefile for: elm ME+ (unofficial Elm)
# Date created: 26 June 1995
# Whom: ache
#
# $FreeBSD$
#
PORTNAME= elm+ME
PORTVERSION= ${ELM_VERSION}.${ELM_REVISION}${ELM_PATCHLEVEL:S/_//}
CATEGORIES= mail
DISTNAME= elm-${ELM_VERSION}ME+${ELM_REVISION}
# here are the main repositories.
MASTER_SITES= ftp://ftp.ozone.fmi.fi/KEH/ \
http://www.ozone.fmi.fi/KEH/
# the following repositories conform to the main repository.
MASTER_SITES+= ftp://ftp.lip6.fr/pub/unix/mail/elm-me/ \
ftp://ftp.tu-darmstadt.de/pub/networking/mail/elm+ME/ \
ftp://ftp.cs.tu-berlin.de/pub/net/mail/elm-me-plus/ \
ftp://ftp.ntua.gr/pub/net/mail/elm-me/ \
ftp://ftp.eos.hokudai.ac.jp/pub/network/mail/elm-2.4ME+/ \
ftp://ftp.win.ne.jp/pub/network/mail/elm-2.4ME+/
# the following repositories maybe conform to the main repository.
# MASTER_SITES+= ftp://ftp.unina.it/pub/Unix/pkgs/network/mail/elm-me+/ \
# ftp://ftp.rge.com/pub/mail/elm/elm-2.4ME+/ \
# ftp://ftp.uni-trier.de/pub/unix/network/mail/elm-me+/
PATCH_SITES= ${MASTER_SITES}
PATCHFILES= # see below.
PATCH_DIST_STRIP= -p1
MAINTAINER= cyrille.lefevre@laposte.net
COMMENT= A once-popular mail user agent, unofficial clone
# not needed since config.sh is generated by scripts/pre-configure.
# BUILD_DEPENDS= ispell:${PORTSDIR}/textproc/ispell
# BUILD_DEPENDS= metamail:${PORTSDIR}/mail/metamail
# BUILD_DEPENDS= pgp:${PORTSDIR}/security/pgp
# BUILD_DEPENDS= gpg:${PORTSDIR}/security/gnupg
# Global variables
#
WRKSRC= ${WRKDIR}/${DISTNAME:S/-//:S/ME+/.ME+./}
HAS_CONFIGURE= yes
USE_RC_SUBR= yes
USE_REINPLACE= yes
USE_OPENSSL= yes
CONFIGURE_SCRIPT= Configure
SCRIPTS_ENV= CONFIG_PATH="${CONFIG_PATH}" CFLAGS="${CFLAGS}" \
PREFIX="${PREFIX}" LOCALBASE="${LOCALBASE}" \
MAN1PREFIX="${MAN1PREFIX}" CONF_DIR="${CONF_DIR}" \
LIB_DIR="${LIB_DIR}" SHLIB_DIR="${SHLIB_DIR}" \
STAGE_DIR="${STAGE_DIR}" ELM_SHLIBS="${ELM_SHLIBS}" \
OPENSSLLIB="${OPENSSLLIB}" OPENSSLINC="${OPENSSLINC}" \
OPENSSLBASE="${OPENSSLBASE}"
CONFIGURE_ARGS= -b -S -P ${PREFIX} -c ../${CONFIG_PATH:T}
MAKE_ENV= MJ="FORMATTER=groff FORMATTER_OPTS=-Tlatin1"
ALL_TARGET= all documentation
INSTALLS_SHLIB= yes
LDCONFIG_DIRS= %%PREFIX%%/%%SHLIB_DIR%%
PLIST_SUB= SO_REV="${SO_REV}" \
RC_DIR="${RC_DIR:S,^${PREFIX}/,,}" \
MAIL_DIR="${MAIL_DIR:S,^${PREFIX}/,,}" \
CONF_DIR="${CONF_DIR:S,^${PREFIX}/,,}" \
LIB_DIR="${LIB_DIR:S,^${PREFIX}/,,}" \
SHLIB_DIR="${SHLIB_DIR:S,^${PREFIX}/,,}" \
ELM_SHLIBS="${ELM_SHLIBS}" \
${ELM_SHLIBS:U:S/^/ELM_/:S/$/=""/} \
${ELM_UNSHLIBS:U:S/^/ELM_/:S/$/="@comment "/}
RCSCRIPTS_SUB= SHLIB_DIR="${SHLIB_DIR}" RC_SUBR=${RC_SUBR}
MAN1= answer.1 checkalias.1 elm.1 elmalias.1 elmbindata.1 \
elmcharset.1 elmlibregister.1 elmrc-write.1 elmregister.1 \
elmstringconvert.1 elmterminal.1 elmunidata.1 elmuninstall.1 \
fastmail.1 frm.1 listalias.1 messages.1 newalias.1 newmail.1 \
printmail.1 prlong.1 readmsg.1
MLINKS= frm.1 nfrm.1 newmail.1 wnewmail.1
.if !defined(ELM_USER_SHLIBS)
OPTIONS= ELM_ICONV "libiconv support" on \
ELM_SMTP "SMTP submission protocol (RFC2746) support" on \
ELM_TLS "POP STLS and IMAP STARTTLS support" on \
OPENSSL_BASE "use the base system OpenSSL (required by TLS)" on \
OPENSSL_PORT "use OpenSSL from ports (requires by TLS)" off
.endif
.include <bsd.port.pre.mk>
# Local variables
#
ELM_VERSION= 2.4
ELM_REVISION= 119
ELM_PATCHLEVEL= _ # a...z = patch-level, _ means no patch-level.
ELM_PATCHDONE= false
.for level in _ a b c d e f g h i j k l m n o p q r s t u v w x y z
_level=${level}
. if ${_level} != _ && ${ELM_PATCHDONE} == false
PATCHFILES+= ${DISTNAME:S/+/+PL/}${level}.patch.gz
. endif
. if ${ELM_PATCHLEVEL} == ${_level}
ELM_PATCHDONE= true
. endif
.endfor
ELM_SYSTEM_SHLIBS= iconv smtp tls
.if !defined(ELM_USER_SHLIBS)
. for shlib in ${ELM_SYSTEM_SHLIBS}
. if !defined(${shlib:U:S/^/WITHOUT_ELM_/})
ELM_USER_SHLIBS+=${shlib}
. endif
. endfor
.endif
ELM_USER_SHLIBS?= ${ELM_SYSTEM_SHLIBS} # or none
ELM_SHLIBS=
.if ${ELM_USER_SHLIBS} == none
ELM_UNSHLIBS= ${ELM_SYSTEM_SHLIBS}
.else
ELM_UNSHLIBS=
. for shlib1 in ${ELM_SYSTEM_SHLIBS}
_shlib1=${shlib1}
_define= false
. for shlib2 in ${ELM_USER_SHLIBS}
_shlib2=${shlib2}
. if ${_shlib1} == ${_shlib2}
_define= true
. endif
. endfor
. if ${_define} == true
ELM_SHLIBS+= ${shlib1}
. else
ELM_UNSHLIBS+= ${shlib1}
. endif
. endfor
.endif
.if ${ELM_SHLIBS:Miconv} == iconv
USE_ICONV= yes
.endif
# evaluation should be protected 'til extraction to avoid noisy messages.
SO_REV= $$([ -f ${WRKSRC}/hdrs/patchlevel.h ] && \
${AWK} '/SHAREDTAG:/{print $$2}' ${WRKSRC}/hdrs/patchlevel.h)
MSECS= 1
STAGE_DIR= ${WRKDIR}/stage
RC_DIR= ${PREFIX}/etc/rc.d
MAIL_DIR= ${PREFIX}/etc/mail
CONF_DIR= ${MAIL_DIR}/elm
LIB_DIR= ${PREFIX}/lib/elm
SHLIB_DIR= ${PREFIX}/libexec/elm
CONFIG_PATH= ${WRKDIR}/config.sh
_RC_FILE= 00elm.sh
RC_FILE= 000.elm.sh
MIME_TYPES= elm.mimetypes
MIME_CSETS= elm.mimecharsets
TERM_INFO= elm.terminalinfo
ELM_RC= elm.rc
CONF_FILES= ${MIME_TYPES} ${MIME_CSETS} ${TERM_INFO} ${ELM_RC}
DOC_FILES= MIME.txt README.ME+ \
doc/Alias.fmtd doc/Config.fmtd doc/Cover.fmtd \
doc/Form.fmtd doc/Ref.fmtd doc/Users.fmtd
.for shlib in ${ELM_SHLIBS}
DOC_FILES+= shared_libs/${shlib:L}/README.${shlib:U}
.endfor
# Post-patch
#
post-patch: fix-permissions patch-startup-scripts patch-setgid patch-nls-files
fix-permissions:
@${CHMOD} -R u+w ${WRKSRC}
patch-startup-scripts:
@${SED} ${RCSCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/${_RC_FILE} > ${WRKDIR}/${RC_FILE}
# from <sys/unistd.h>:
# Although we have saved user/group IDs, we do not use them in setuid
# as described in POSIX 1003.1, because the feature does not work for
# root. We use the saved IDs in seteuid/setegid, which are not currently
# part of the POSIX 1003.1 specification. XXX revisit for 1003.1-2001
# as this is now mandatory.
patch-setgid:
@if [ "$$(sysctl -n kern.saved_ids)" -eq 0 ]; then \
${REINPLACE_CMD} -e 's|setgid|setegid|' \
${WRKSRC}/lib/localmbx.c \
${WRKSRC}/src/init.c ${WRKSRC}/src/lock.c; \
${REINPLACE_CMD} -e 's|have_saved_ids = 0|have_saved_ids = 1|' \
${WRKSRC}/lib/read_rc.c; \
fi
patch-nls-files:
@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/nls/LANGS
# Pre-configure
#
pre-configure: configure-shlibs
TEE?= tee
configure-shlibs:
@${CP} /dev/null ${CONFIG_PATH}
.for shlib in ${ELM_SYSTEM_SHLIBS}
@${ECHO_CMD} "\# Support for ${shlib:U}" \
> ${WRKSRC}/shared_libs/${shlib:L}/config.res
.endfor
.for shlib in ${ELM_SHLIBS}
@${ECHO_CMD} "${shlib:L}_ok='define'" \
| ${TEE} -a ${CONFIG_PATH} \
>> ${WRKSRC}/shared_libs/${shlib:L}/config.res
.endfor
.for shlib in ${ELM_UNSHLIBS}
@${ECHO_CMD} "${shlib:L}_ok='undef'" \
| ${TEE} -a ${CONFIG_PATH} \
>> ${WRKSRC}/shared_libs/${shlib:L}/config.res
.endfor
# Post-configure
#
post-configure: rename-readmes
rename-readmes:
.for shlib in ${ELM_SHLIBS}
@if [ -f ${WRKSRC}/shared_libs/${shlib:L}/README.ME+ ]; then \
${MV} ${WRKSRC}/shared_libs/${shlib:L}/README.ME+ \
${WRKSRC}/shared_libs/${shlib:L}/README.${shlib:U}; \
fi
.endfor
# Pre-install
#
pre-install: create-install-dirs backup-conf-files
create-install-dirs:
@${MKDIR} ${CONF_DIR} ${LIB_DIR} ${SHLIB_DIR}
backup-conf-files:
.for file in ${CONF_FILES}
@if [ -f ${LIB_DIR}/${file} ]; then \
${MV} ${LIB_DIR}/${file} ${CONF_DIR}/${file}.orig; \
elif [ -f ${CONF_DIR}/${file} ]; then \
${MV} ${CONF_DIR}/${file} ${CONF_DIR}/${file}.orig; \
fi
.endfor
# Post-install
#
post-install: install-startup-files install-nls-files \
install-doc-files install-mime-types \
install-conf-files restore-conf-files \
merge-global-rc-file \
remove-catman-files remove-catman-links
install-startup-files:
@${INSTALL_SCRIPT} ${WRKDIR}/${RC_FILE} ${RC_DIR}
install-nls-files:
@cd ${WRKSRC}/nls; ${MAKE} install
install-doc-files:
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
. for file in ${DOC_FILES}
@${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
@${GZIP_CMD} ${DOCSDIR}/${file:T}
. endfor
.endif
install-mime-types:
@${INSTALL_DATA} ${FILESDIR}/${MIME_TYPES} ${CONF_DIR}/${MIME_TYPES}
install-conf-files:
.for file in ${CONF_FILES}
@${INSTALL_DATA} ${CONF_DIR}/${file} ${CONF_DIR}/${file}-dist
.endfor
# for instance, don't restore obsolete files :( except elm.rc :)
restore-conf-files:
.for file in ${ELM_RC} # ${CONF_FILES}
@if [ -f ${CONF_DIR}/${file}.orig ]; then \
${MV} ${CONF_DIR}/${file}.orig ${CONF_DIR}/${file}; \
fi
.endfor
merge-global-rc-file:
@${LIB_DIR}/elmrc-write -G -I
@${LIB_DIR}/elmlibregister -G -I ${ELM_SHLIBS}
remove-catman-files:
.for sect in ${MSECS}
. for page in ${MAN${sect}}
@${RM} -f ${MAN${sect}PREFIX}/man/cat${sect}/${page}
. endfor
.endfor
remove-catman-links:
.for sect in ${MSECS}
. for page in ${MLINKS}
. if ${MAN${sect}:M${page}} == ""
@${RM} -f ${MAN${sect}PREFIX}/man/cat${sect}/${page}
. endif
. endfor
.endfor
# some sketchy hackery
FETCH_CMD_INTERIOR= ${FETCH_CMD:M*fetch*}
# only enable the hack if FETCH_CMD is fetch
.if !empty(FETCH_CMD_INTERIOR)
# some ftp servers dislike $USER@localhost...
FETCH_ENV= FTP_PASSWORD=${FTP_PASSWORD}
IFCONFIG?= ifconfig
HOSTIPADDR= ${IFCONFIG} | ${AWK} '/inet /{print $$2; exit}'
FTP_PASSWORD?= ${USER}@`${HOSTIPADDR}`
.endif
.include <bsd.port.post.mk>
|