aboutsummaryrefslogtreecommitdiffstats
path: root/mail/roundcube/Makefile
blob: 96b30ab7c230c9cc052d0b848fc9cbdc2fec1be6 (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
# New ports collection makefile for:    roundcube
# Date created:             Oct 21 2005
# Whom:                 Florent Thoumie <flz@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   roundcube
DISTVERSION=    0.5-rc
PORTREVISION=   1
PORTEPOCH=  1
CATEGORIES?=    mail www
MASTER_SITES=   SF/${PORTNAME}mail/${PORTNAME}mail-beta/${DISTVERSION:U}
DISTNAME=   ${PORTNAME}mail-${DISTVERSION}

MAINTAINER?=    ale@FreeBSD.org
COMMENT=    Fully skinnable XHTML/CSS webmail written in PHP

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/LICENSE

NO_BUILD=   yes
CONFLICTS=  ja-roundcube-[0-9]*

RCUBECOMP=  .htaccess SQL config index.php installer logs plugins program robots.txt skins temp
PORTDOCS=   CHANGELOG INSTALL README UPGRADING

SCRIPTS_ENV=    SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP} \
        WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} \
        WWWDIR=${WWWDIR}

WANT_PHP_WEB=   yes
USE_PHP=    pcre mbstring session iconv dom xml json intl
IGNORE_WITH_PHP=4

REINPLACE_ARGS= -i ""
.if defined(WITH_REPLACE_MAIL_URL) && !empty(WITH_REPLACE_MAIL_URL)
MAIL=       ${WITH_REPLACE_MAIL_URL}
.else
MAIL=       mail
.endif
PLIST_SUB+= MAIL=${MAIL}

OPTIONS=    MYSQL "Use MySQL backend" on \
        PGSQL "Use PostgreSQL backend" off \
        SQLITE "Use SQLite backend" off \
        SSL "Enable SSL support (imaps or google spellcheck)" off \
        LDAP "Enable LDAP support (address book)" off \
        PSPELL "Enable PSpell support (internal spellcheck)" off \
        NSC "Install network spellchecker" off

.include <bsd.port.pre.mk>

.if defined(WITHOUT_MYSQL) && !defined(WITH_PGSQL) && !defined(WITH_SQLITE)
IGNORE=     needs a database backend
.endif

.if !defined(WITHOUT_MYSQL)
USE_PHP+=   mysql
.endif

.if defined(WITH_PGSQL)
USE_PHP+=   pgsql
.endif

.if defined(WITH_SQLITE)
USE_PHP+=   sqlite
.endif

.if defined(WITH_SSL)
USE_PHP+=   openssl
.endif

.if defined(WITH_LDAP)
USE_PHP+=   ldap
.endif

.if defined(WITH_PSPELL) || defined(WITH_NSC)
USE_PHP+=   pspell
.endif

.if defined(WITH_NSC)
RCUBECOMP+= spellchecker.php
USE_PHP+=   simplexml
PLIST_SUB+= SPELLCHECK=""
.else
PLIST_SUB+= SPELLCHECK="@comment "
.endif

.if defined(WITH_NSC)
post-extract:
    @${CP} ${FILESDIR}/spellchecker.php ${WRKSRC}
.endif

post-patch:
    @${FIND} ${WRKSRC} -name \*.orig -type f -delete
.if defined(WITH_REPLACE_MAIL_URL)
    @${REINPLACE_CMD} "s/'mail'/'${MAIL}'/g" ${WRKSRC}/index.php \
        ${WRKSRC}/plugins/*/*.php \
        ${WRKSRC}/program/include/rcmail.php \
        ${WRKSRC}/program/js/editor.js \
        ${WRKSRC}/program/localization/*/labels.inc \
        ${WRKSRC}/program/steps/addressbook/mailto.inc \
        ${WRKSRC}/skins/default/functions.js
    @${REINPLACE_CMD} "s/_task=mail/_task=${MAIL}/g" \
        ${WRKSRC}/program/js/app.js
    @${REINPLACE_CMD} "s/\"mail\"/\"${MAIL}\"/g" \
        ${WRKSRC}/program/js/app.js \
        ${WRKSRC}/skins/default/includes/taskbar.html
    @${REINPLACE_CMD} "s/mail_footer/${MAIL}_footer/g" \
        ${WRKSRC}/skins/default/*.css \
        ${WRKSRC}/skins/default/templates/login.html
    @${REINPLACE_CMD} "s/mail_toolbar/${MAIL}_toolbar/g" \
        ${WRKSRC}/skins/default/*.css \
        ${WRKSRC}/skins/default/templates/login.html
    @${MV} ${WRKSRC}/program/steps/mail \
        ${WRKSRC}/program/steps/${MAIL}
    @${MV} ${WRKSRC}/skins/default/images/mail_footer.png \
        ${WRKSRC}/skins/default/images/${MAIL}_footer.png
    @${MV} ${WRKSRC}/skins/default/images/mail_toolbar.gif \
        ${WRKSRC}/skins/default/images/${MAIL}_toolbar.gif
    @${MV} ${WRKSRC}/skins/default/images/mail_toolbar.png \
        ${WRKSRC}/skins/default/images/${MAIL}_toolbar.png
    @${MV} ${WRKSRC}/skins/default/mail.css \
        ${WRKSRC}/skins/default/${MAIL}.css
    @${MV} ${WRKSRC}/skins/default/templates/mail.html \
        ${WRKSRC}/skins/default/templates/${MAIL}.html
.endif

do-install:
    -${MKDIR} ${WWWDIR}
    @cd ${WRKSRC} && ${COPYTREE_BIN} bin ${WWWDIR}
.for i in ${RCUBECOMP}
    @cd ${WRKSRC} && ${COPYTREE_SHARE} ${i} ${WWWDIR}
.endfor
    @${CHOWN} -R ${WWWOWN}:${WWWGRP} ${WWWDIR}/logs ${WWWDIR}/temp
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
.for i in ${PORTDOCS}
    @${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}/
.endfor
.endif
    @(cd ${WRKSRC}; ${FIND} bin ${RCUBECOMP} -not -type d) | ${SORT} | \
        ${SED} -ne 's,^,${WWWDIR_REL}/,p' >> ${TMPPLIST}
    @(cd ${WRKSRC}; ${FIND} bin ${RCUBECOMP} -type d) | ${SORT} -r | \
        ${SED} -ne 's,^,@dirrm ${WWWDIR_REL}/,p' >> ${TMPPLIST}
    @${ECHO_CMD} '@dirrm ${WWWDIR_REL}' >> ${TMPPLIST}

post-install:
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>