aboutsummaryrefslogtreecommitdiffstats
path: root/mail/claws-mail/Makefile
blob: 8b3134397517dcb7d1b9238b5f0aa65cd92b01ed (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
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
# New ports collection makefile for:    claws-mail
# Date created:     3 January 2002
# Whom:         Simon 'corecode' Schubert <corecode@corecode.ath.cx>
#
# $FreeBSD$
#

PORTNAME=   claws-mail
PORTVERSION=    3.4.0
CATEGORIES= mail news ipv6
MASTER_SITES=   SF
MASTER_SITE_SUBDIR= sylpheed-claws
DISTFILES=  ${EXTRACT_ONLY} \
        ${THEMEFILE}
EXTRACT_ONLY=   ${DISTNAME}${EXTRACT_SUFX}

MAINTAINER= netchild@FreeBSD.org
COMMENT=    A lightweight and very featureful GTK+ based e-mail and news client

LIB_DEPENDS=    etpan:${PORTSDIR}/mail/libetpan \
        cairo:${PORTSDIR}/graphics/cairo \
        expat:${PORTSDIR}/textproc/expat2 \
        fontconfig:${PORTSDIR}/x11-fonts/fontconfig \
        freetype:${PORTSDIR}/print/freetype2 \
        png:${PORTSDIR}/graphics/png
RUN_DEPENDS=    ${LOCALBASE}/etc/mime.types:${PORTSDIR}/misc/mime-support

CONFLICTS=  sylpheed-claws

THEMEVERSION=   20070116
THEMEFILE=  claws-mail-themes-${THEMEVERSION}.tar.gz

USE_BZIP2=  yes
USE_GETTEXT=    yes
USE_GMAKE=  yes
USE_ICONV=  yes
USE_XORG=   ice sm x11 xau xcursor xdmcp xext xfixes xi xinerama xrandr \
        xrender
USE_GNOME=  gnomehack pkgconfig gtk20 glib20 atk libartlgpl2 pango libxml2
GNU_CONFIGURE=  yes
WANT_GNOME= yes
INSTALLS_ICONS= yes

MAN1=       claws-mail.1

CONFIGURE_ARGS= \
        --with-libiconv-prefix=${LOCALBASE} \
        --with-manualdir=${DOCSDIR}/manual \
        --with-faqdir=${DOCSDIR}/faq

CONFIGURE_ENV=  CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" \
        CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
        LDFLAGS="-L${LOCALBASE}/lib" \
        LIBS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"

OPTIONS=    ALL     "Enable all options except GNUTLS."         off \
        ASPELL      "Enable spell checking support."    on \
        BOGOFILTER  "Enable bogofilter support."        off \
        COMPFACE    "Enable X-Face support."        on \
        DEBUG       "Enable debug support."         off \
        DILLO       "Enable Dillo HTML viewer."     off \
        GNOMEPRINT  "Enable extended print support (deprecated)."   off \
        GNUTLS      "Enable gnuTLS support."        off \
        GPGME       "Enable PGP/GnuPG support using GPGME." off \
        IPV6        "Enable ipv6 support."          on \
        JPILOT      "Enable JPilot support."        off \
        LDAP        "Enable LDAP support."          off \
        SA_PLUG     "Enable SpamAssassin support."      off \
        STARTUP     "Enable startup notification support."  on \
        THEMES      "Install additional themes."        on

.include <bsd.port.pre.mk>

.if ${HAVE_GNOME:Mgnomeprint} != "" || defined(WITH_GNOMEPRINT)
PLIST_SUB+=     GNOMEPRINT=""
USE_GNOME+=     libgnomeprint libgnomeprintui libgnomecanvas
CONFIGURE_ARGS+=    --enable-gnomeprint
.else
PLIST_SUB+=     GNOMEPRINT="@comment "
CONFIGURE_ARGS+=    --disable-gnomeprint
.endif

.if defined(WITH_BOGOFILTER) || defined(WITH_ALL)
RUN_DEPENDS+=       bogofilter:${PORTSDIR}/mail/bogofilter
CONFIGURE_ARGS+=    --enable-bogofilter-plugin
PLIST_SUB+=     BOGO_PLUG=""
.else
CONFIGURE_ARGS+=    --disable-bogofilter-plugin
PLIST_SUB+=     BOGO_PLUG="@comment "
.endif

.if defined(WITH_COMPFACE) || defined(WITH_ALL)
LIB_DEPENDS+=       compface.1:${PORTSDIR}/mail/faces
CONFIGURE_ARGS+=    --enable-compface
.else
CONFIGURE_ARGS+=    --disable-compface
.endif
.if defined(WITH_ASPELL) || defined(WITH_ALL)
LIB_DEPENDS+=       pspell.16:${PORTSDIR}/textproc/aspell
CONFIGURE_ARGS+=    --enable-aspell
.else
CONFIGURE_ARGS+=    --disable-aspell
.endif
.if defined(WITH_JPILOT) || defined(WITH_ALL)
LIB_DEPENDS+=       pisock:${PORTSDIR}/palm/pilot-link
RUN_DEPENDS+=       jpilot:${PORTSDIR}/palm/jpilot
CONFIGURE_ARGS+=    --enable-jpilot
.else
CONFIGURE_ARGS+=    --disable-jpilot
.endif
.if defined(WITH_LDAP) || defined(WITH_ALL)
USE_OPENLDAP=       yes
CONFIGURE_ARGS+=    --enable-ldap
.else
CONFIGURE_ARGS+=    --disable-ldap
.endif
.if defined(WITH_SA_PLUG) || defined(WITH_ALL)
RUN_DEPENDS+=       spamd:${PORTSDIR}/mail/p5-Mail-SpamAssassin
CONFIGURE_ARGS+=    --enable-spamassassin-plugin
PLIST_SUB+=     SA_PLUG=""
.else
CONFIGURE_ARGS+=    --disable-spamassassin-plugin
PLIST_SUB+=     SA_PLUG="@comment "
.endif
.if defined(WITH_GNUTLS)
CONFIGURE_ARGS+=    --enable-gnutls --disable-openssl
LIB_DEPENDS+=       gnutls.26:${PORTSDIR}/security/gnutls
.else
CONFIGURE_ARGS+=    --disable-gnutls
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
CONFIGURE_ARGS+=    --enable-openssl --with-openssl-includes=${OPENSSLINC} \
            --with-openssl-libs=${OPENSSLLIB}
CONFIGURE_ENV+= OPENSSL_CFLAGS="-I${OPENSSLINC}" \
            OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto -lssl"
.endif
.if defined(WITH_GPGME) || defined(WITH_ALL)
PLIST_SUB+=     GPGME=""
CONFIGURE_ARGS+=    --enable-pgpmime-plugin --enable-pgpcore-plugin \
            --enable-pgpinline-plugin
LIB_DEPENDS+=       gpgme:${PORTSDIR}/security/gpgme \
            gpg-error:${PORTSDIR}/security/libgpg-error
RUN_DEPENDS+=       gpg:${PORTSDIR}/security/gnupg
.else
PLIST_SUB+=     GPGME="@comment "
CONFIGURE_ARGS+=    --disable-pgpmime-plugin --disable-pgpcore-plugin \
            --disable-pgpinline-plugin
.endif
.if defined(WITHOUT_THEMES)
PLIST_SUB+= THEMES="@comment "
.else
PLIST_SUB+= THEMES=""
.endif
.if defined(WITH_DEBUG) || defined(WITH_ALL)
CONFIGURE_ARGS+=    --enable-maintainer-mode --enable-crash-dialog
STRIP=
.endif
.if defined(WITH_DILLO) || defined(WITH_ALL)
PLIST_SUB+= DILLO=""
RUN_DEPENDS+=   dillo:${PORTSDIR}/www/dillo
.else
PLIST_SUB+= DILLO="@comment "
CONFIGURE_ARGS+=    --disable-dillo-viewer-plugin
.endif

.if !defined(WITHOUT_IPV6) || defined(WITH_ALL)
CONFIGURE_ARGS+=    --enable-ipv6
.else
CONFIGURE_ARGS+=    --disable-ipv6
.endif

.if !defined(WITHOUT_STARTUP) || defined(WITH_ALL)
LIB_DEPENDS+=       startup-notification-1.0:${PORTSDIR}/x11/startup-notification
CONFIGURE_ARGS+=    --enable-startup-notification
.else
CONFIGURE_ARGS+=    --disable-startup-notification
.endif

post-extract:
.if !defined(WITHOUT_THEMES)
    @${MKDIR} ${WRKSRC}/themes
    @cd ${WRKDIR} && ${GZIP_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${THEMEFILE} ${EXTRACT_AFTER_ARGS}
.endif

post-patch:
    @${REINPLACE_CMD} -e \
        's|-lresolv||g; s|-lpisock\"|-liconv &|g' ${WRKSRC}/configure
    @${REINPLACE_CMD} -e 's|/etc|${LOCALBASE}&|g ; s|/usr/share|${LOCALBASE}/share|g' \
        ${WRKSRC}/src/procmime.c
    @${REINPLACE_CMD} -e "s|po intl src|po src| ; s:@CLAWS_GNOME2:#@CLAWS_GNOME2:g" ${WRKSRC}/Makefile.in
    @${REINPLACE_CMD} -e "s:-Wno-unused-function::" ${WRKSRC}/src/Makefile.in
    @for f in `${FIND} ${WRKSRC}/tools -type f -print`; do \
        ${REINPLACE_CMD} -e "s|/usr/bin/perl|${PERL}|" $$f; done
.if defined(NOPORTDOCS)
    @${REINPLACE_CMD} -e 's|src manual faq tools|src tools|' ${WRKSRC}/Makefile.in
.endif

post-install:
.if !defined(NOPORTDOCS)
.for i in NEWS README RELEASE_NOTES TODO
    @${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
    @${INSTALL_DATA} ${WRKSRC}/tools/README ${DOCSDIR}/README.tools
.endif
    @${MKDIR} ${DATADIR}
    cd ${WRKSRC}/tools && \
        ${INSTALL_SCRIPT} OOo2claws-mail.pl acroread2claws-mail.pl \
        calypso_convert.pl convert_mbox.pl eud2gc.py filter_conv.pl \
        filter_conv_new.pl fix_date.sh freshmeat_search.pl \
        gif2xface.pl google_msgid.pl google_search.pl \
        kmail-mailbox2claws-mail.pl kmail2claws-mail.pl \
        kmail2claws-mail_v2.pl multiwebsearch.conf multiwebsearch.pl \
        nautilus2claws-mail.sh outlook2claws-mail.pl tb2claws-mail \
        tbird2claws.py textviewer.pl textviewer.sh \
        thunderbird-filters-convertor.pl uudec uuooffice vcard2xml.py \
        ${DATADIR}
    @${MKDIR} ${PREFIX}/share/applications
    @${INSTALL_DATA} ${WRKSRC}/claws-mail.desktop ${PREFIX}/share/applications/
.if !defined(WITHOUT_THEMES)
    @${MKDIR} ${DATADIR}/themes
    @cd ${WRKDIR}/${THEMEFILE:C/.tar.gz//} && ${FIND} . -mindepth 2 -print | \
        ${GREP} -vE '(Makefile.*|INSTALL)' | \
        ${CPIO} -pdu -R ${BINOWN}:${BINGRP} --quiet ${DATADIR}/themes/
    @${CHMOD} -R a+r ${DATADIR}/themes
    @${FIND} ${DATADIR}/themes -type d -print0 | ${XARGS} -0 ${CHMOD} 755
    @${FIND} ${DATADIR}/themes -type f -print0 | ${XARGS} -0 ${CHMOD} 644
.endif
    @${MKDIR} ${PREFIX}/share/pixmaps
    @${INSTALL_DATA} ${WRKSRC}/claws-mail*.png ${PREFIX}/share/pixmaps/

.include <bsd.port.post.mk>