aboutsummaryrefslogtreecommitdiffstats
path: root/mail/wanderlust/Makefile
blob: 00196cf430eb5bbe01c7e060e7b0de15f8a4a4cb (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
182
183
184
185
186
187
188
189
190
191
# New ports collection makefile for:    Wanderlust (for emacs)
# Date created:     7 Apr 1999
# Whom:         MANTANI Nobutaka <nobutaka@nobutaka.com>
#
# $FreeBSD$
#

PORTNAME=   wanderlust
PORTVERSION=    1.1.0
CATEGORIES= mail elisp
MASTER_SITES=   ftp://ftp.gohome.org/wl/stable/ \
        ftp://ftp.jaist.ac.jp/pub/GNU/elisp/wanderlust/stable/ \
        ftp://daidai.kuis.kyoto-u.ac.jp/pub/mirror/ftp.gohome.org/pub/elisp/wl/stable/ \
        ftp://ftp.ring.gr.jp/pub/text/elisp/wl/stable/
PKGNAMESUFFIX=  -${EMACS_PORT_NAME}
DISTNAME=   wl-${PORTVERSION}

MAINTAINER= nobutaka@nobutaka.com

SEMI_VER=   1.13.7
SEMI_COOKIE=    semi-${EMACS_PORT_NAME}-${SEMI_VER}.FreeBSD-packages

.if !defined (IS_SLAVE)
# for emacs19
EMACS_NAME=     emacs
EMACS_PORT_NAME=    emacs
EMACS_VER=      19.34
EMACS_LIBDIR=       share/emacs
EMACS_LIBDIR_WITH_VER=  share/emacs/${EMACS_VER}
.endif

EMACS_CMD=  ${PREFIX}/bin/${EMACS_NAME}-${EMACS_VER}

BUILD_DEPENDS=  ${EMACS_CMD}:${PORTSDIR}/editors/${EMACS_PORT_NAME}

.if !defined(HAVE_COMMON_PORT)
HAVE_COMMON_PORT=   no
.endif
.if (${HAVE_COMMON_PORT} == "yes")
# depends on common port
RUN_DEPENDS=    ${PKG_DBDIR}/${EMACS_PORT_NAME:S/xemacs21-mule/xemacs-mule/}-common-${MULE_VER}:${PORTSDIR}/editors/${EMACS_PORT_NAME}-common
.else
RUN_DEPENDS=    ${EMACS_CMD}:${PORTSDIR}/editors/${EMACS_PORT_NAME}
.endif
# depends on semi
BUILD_DEPENDS+= ${PREFIX}/share/semi/${SEMI_COOKIE}:${PORTSDIR}/editors/semi-${EMACS_PORT_NAME}-current
RUN_DEPENDS+=   ${PREFIX}/share/semi/${SEMI_COOKIE}:${PORTSDIR}/editors/semi-${EMACS_PORT_NAME}-current

.if (${EMACS_PORT_NAME} == "xemacs21-mule")
ALL_TARGET= package
INSTALL_TARGET= install-package
.endif
.if (${EMACS_PORT_NAME} == "emacs20" || ${EMACS_PORT_NAME} == "mule")
ALL_TARGET= all info
.endif

.if !defined(WITH_IM) && exists(${LOCALBASE}/bin/imput)
WITH_IM=    yes
.endif

.if defined(WITH_IM) && ${WITH_IM} == yes
BUILD_DEPENDS+= imput:${PORTSDIR}/mail/im
RUN_DEPENDS+=   imput:${PORTSDIR}/mail/im
.endif

DIRSECTION= "The Emacs editor and associated tools"
DOCSDIR=    ${PREFIX}/share/doc/wanderlust
DOCS=       00README 00README.ja ChangeLog ChangeLog.ja
SAMPLESDIR= ${PREFIX}/share/examples/wanderlust/en
SAMPLESDIR_JA=  ${PREFIX}/share/examples/wanderlust/ja
SAMPLES=    dot.addresses dot.wl dot.folders

PLIST_SUB=  EMACS_LIBDIR=${EMACS_LIBDIR} EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \
        EMACS_PACKAGESDIR=${EMACS_PACKAGESDIR} DIRSECTION=${DIRSECTION}

PLISTORIG=  ${PKGDIR}/PLIST.${EMACS_PORT_NAME}
PLIST=      ${WRKDIR}/PLIST

MAKE_ARGS=  EMACS=${EMACS_CMD} LISPDIR=${PREFIX}/${EMACS_LIBDIR}/site-lisp \
        FLAGS="-batch -q -no-site-file -l ${WRKDIR}/wanderlust-startup.el"
.if (${EMACS_PORT_NAME} == "xemacs20") || (${EMACS_PORT_NAME} == "xemacs21-mule")
MAKE_ARGS+= XEMACS=${EMACS_CMD}
.endif
.if (${EMACS_PORT_NAME} == "xemacs21-mule")
MAKE_ARGS+= PACKAGEDIR=${PREFIX}/${EMACS_PACKAGESDIR}
.else
MAKE_ARGS+= INFODIR=${PREFIX}/info
.endif

post-configure:
    @${SED} \
        -e "s,%%PREFIX%%,${PREFIX},g" \
        -e "s,%%EMACS_LIBDIR%%,${EMACS_LIBDIR},g" \
        -e "s,%%EMACS_LIBDIR_WITH_VER%%,${EMACS_LIBDIR_WITH_VER},g" \
        -e "s,%%EMACS_PACKAGESDIR%%,${EMACS_PACKAGESDIR},g" \
        < ${FILESDIR}/wanderlust-startup.${EMACS_PORT_NAME}.el.tmpl > ${WRKDIR}/wanderlust-startup.el

pre-build:
.if (${EMACS_PORT_NAME} == "xemacs21-mule")
    @${CP} ${FILESDIR}/_pkg.el ${WRKSRC}
.endif

pre-install:
.if (${EMACS_PORT_NAME} != "xemacs21-mule")
    @${MKDIR} ${PREFIX}/${EMACS_LIBDIR}/site-lisp/wl
.endif
.if defined(WITH_IM) && ${WITH_IM} == yes
    @${CAT} ${PLISTORIG} > ${PLIST}
.else
    @${GREP} -vw 'im-wl\.elc\?' ${PLISTORIG} > ${PLIST}
.endif

post-install:
    @${MAKE} install-info
.if !defined(NOPORTDOCS)
    @${MAKE} install-docs
.endif
.if (${EMACS_PORT_NAME} == "xemacs20")
    @${MAKE} install-icons
.endif
    @${MAKE} install-samples
    @${MAKE} install-utils
.if (${EMACS_PORT_NAME} == "xemacs21-mule")
    @${MAKE} install-manifest
.endif
    @${CAT} ${PKGDIR}/MESSAGE

# local targets
install-info:
.if (${EMACS_PORT_NAME} == "xemacs21-mule")
    @if [ ! -f ${PREFIX}/${EMACS_PACKAGESDIR}/info/dir ]; then \
        ${SED} -ne '1,/Menu:/p' /usr/share/info/dir > ${PREFIX}/${EMACS_PACKAGESDIR}/info/dir; \
    fi
    @install-info --section=${DIRSECTION} ${PREFIX}/${EMACS_PACKAGESDIR}/info/wl-ja.info ${PREFIX}/${EMACS_PACKAGESDIR}/info/dir
.endif
.if (${EMACS_PORT_NAME} == "emacs20" || ${EMACS_PORT_NAME} == "mule")
    @${INSTALL_DATA} ${WRKSRC}/doc/wl-ja.info ${PREFIX}/info
    @install-info --section=${DIRSECTION} ${PREFIX}/info/wl-ja.info ${PREFIX}/info/dir
.endif

install-docs:
    @${MKDIR} ${DOCSDIR}
    @for i in ${DOCS} ; do \
        ${INSTALL_DATA} ${WRKSRC}/$$i ${DOCSDIR} ; \
    done
    @${INSTALL_DATA} ${WRKSRC}/doc/wl-ja.texi ${DOCSDIR}

install-icons:
    @${MKDIR} ${PREFIX}/${EMACS_LIBDIR}/etc/wl
    @(cd ${WRKSRC}/etc/icons ; \
    for i in *.xpm ; do \
        ${INSTALL_DATA} $$i ${PREFIX}/${EMACS_LIBDIR}/etc/wl ; \
    done)

install-samples:
    @${MKDIR} ${SAMPLESDIR}
    @${MKDIR} ${SAMPLESDIR_JA}
    @for i in ${SAMPLES} ; do \
    ${INSTALL_DATA} ${WRKSRC}/samples/en/$$i ${SAMPLESDIR} ; \
    ${INSTALL_DATA} ${WRKSRC}/samples/ja/$$i ${SAMPLESDIR_JA} ; \
    done

install-utils:
.if (${EMACS_PORT_NAME} == "xemacs21-mule")
    @${INSTALL_DATA} ${WRKDIR}/wanderlust-startup.el ${PREFIX}/${EMACS_PACKAGESDIR}/lisp/wl
    @${INSTALL_DATA} ${WRKSRC}/utils/bbdb-wl.el ${PREFIX}/${EMACS_PACKAGESDIR}/lisp/wl
    @${INSTALL_DATA} ${WRKSRC}/utils/rfc2368.el ${PREFIX}/${EMACS_PACKAGESDIR}/lisp/wl
    @${INSTALL_DATA} ${WRKSRC}/utils/ssl.el ${PREFIX}/${EMACS_PACKAGESDIR}/lisp/wl
    @${INSTALL_DATA} ${WRKSRC}/utils/wl-mailto.el ${PREFIX}/${EMACS_PACKAGESDIR}/lisp/wl
.else
.if (${EMACS_PORT_NAME} == "emacs" || ${EMACS_PORT_NAME} == "mule")
    @${INSTALL_DATA} ${WRKDIR}/wanderlust-startup.el ${PREFIX}/${EMACS_LIBDIR_WITH_VER}/site-lisp
.if (${EMACS_PORT_NAME} == "emacs")
    @${INSTALL_DATA} ${WRKDIR}/wl-${PORTVERSION}/wl-mule.el ${PREFIX}/${EMACS_LIBDIR}/site-lisp/wl
.endif
.else
    @${INSTALL_DATA} ${WRKDIR}/wanderlust-startup.el ${PREFIX}/${EMACS_LIBDIR}/site-lisp
.endif
    @${INSTALL_DATA} ${WRKSRC}/utils/bbdb-wl.el ${PREFIX}/${EMACS_LIBDIR}/site-lisp/wl
    @${INSTALL_DATA} ${WRKSRC}/utils/rfc2368.el ${PREFIX}/${EMACS_LIBDIR}/site-lisp/wl
    @${INSTALL_DATA} ${WRKSRC}/utils/ssl.el ${PREFIX}/${EMACS_LIBDIR}/site-lisp/wl
    @${INSTALL_DATA} ${WRKSRC}/utils/wl-mailto.el ${PREFIX}/${EMACS_LIBDIR}/site-lisp/wl
.endif

install-manifest:
    @${CAT} ${PKGDIR}/PLIST.${EMACS_PORT_NAME} | ${GREP} -e "^%%EMACS_PACKAGESDIR%%" | \
        ${SED} -e "s!^%%EMACS_PACKAGESDIR%%!!" > ${WRKDIR}/${MANIFEST}
    @${INSTALL_DATA} ${WRKDIR}/${MANIFEST} ${PREFIX}/${EMACS_PACKAGESDIR}/pkginfo/
    @${INSTALL_DATA} ${FILESDIR}/_pkg.el ${PREFIX}/${EMACS_PACKAGESDIR}/lisp/wl

.include <bsd.port.mk>