aboutsummaryrefslogtreecommitdiffstats
path: root/www/cherokee/Makefile
blob: 90b2df86cef9d8748588e4e6fd64dd0e8e8cb3aa (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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# Whom: silence <oksala@videotron.ca>
# $FreeBSD$

PORTNAME=   cherokee
PORTVERSION=    1.2.101
PORTREVISION=   3
CATEGORIES= www
MASTER_SITES=   http://www.cherokee-project.com/download/1.2/${PORTVERSION}/ \
        http://cherokee.osuosl.org/1.0/${PORTVERSION}/ \
        http://mirror.its.uidaho.edu/pub/cherokee/1.2/\${PORTVERSION}/ \
        http://www.gtlib.gatech.edu/pub/cherokee/1.2/\${PORTVERSION}/ \
        ftp://mirrors.secution.com/cherokee/1.2/${PORTVERSION}/ \
        ftp://ftp.easynet.be/cherokee/1.2/${PORTVERSION}/ \
        http://ftp.heanet.ie/mirrors/cherokee/1.2/${PORTVERSION}/ \
        http://www.ftp.ne.jp/infosystems/cherokee/1.2/${PORTVERSION}/ \
        http://www.ring.gr.jp/archives/net/cherokee/1.2/${PORTVERSION}/ \
        http://ftp.nluug.nl/pub/internet/cherokee/1.2/${PORTVERSION}/ \
        http://ftp.surfnet.nl/pub/internet/cherokee/1.2/${PORTVERSION}/ \
        http://mirror.is.co.za/mirrors/cherokee/1.2/${PORTVERSION}/ \
        http://mirror.aarnet.edu.au/pub/cherokee/1.2/\${PORTVERSION}/ \
        http://ftp.ntua.gr/pub/www/cherokee/1.2/\${PORTVERSION}/ \
        http://ftp.cc.uoc.gr/mirrors/cherokee/1.2/\${PORTVERSION}/ \
        http://cherokee.mirror.garr.it/mirrors/cherokee/1.2/\${PORTVERSION}/ \
        http://ftp.yz.yamagata-u.ac.jp/pub/network/cherokee/1.2/\${PORTVERSION}/ \
        http://ftp.icm.edu.pl/packages/cherokee/1.2/\${PORTVERSION}/ \
        ftp://download.srv.ro/pub/cherokee/1.2/\${PORTVERSION}/ \
        http://mirror.yandex.ru/mirrors/cherokee-project.com/1.2/\${PORTVERSION}/ \
        http://cherokee.hyperial.com/1.2/\${PORTVERSION}/ \
        http://cherokee.labs.itb.ac.id/1.2/\${PORTVERSION}/ \
        http://mirror.cpsc.ucalgary.ca/mirror/cherokee/1.2/\${PORTVERSION}/ \
        http://www.feel3.de/mirrors/cherokee/1.2/\${PORTVERSION}/ \
        http://cherokee.pubcrawler.com/1.2/\${PORTVERSION}/

# Disabled mirrors
# due to 404
#       http://cherokee-project.pl/mirror/cherokee/1.0/${PORTVERSION}/ \
#       http://ftp.saix.net/Cherokee/1.0/${PORTVERSION}/ \
#       http://sunsite.rediris.es/mirror/cherokee/1.0/\${PORTVERSION}/

# due to site down
#       http://mirror.apung.web.id/cherokee/1.0/\${PORTVERSION}/ \

MAINTAINER= ports@FreeBSD.org
COMMENT=    Extremely fast and flexible web server

USE_GNOME=  gnomehack pkgconfig
USE_OPENSSL=    yes
USE_LDCONFIG=   yes
USE_GETTEXT=    yes
USE_RC_SUBR=    cherokee
SUB_FILES=  pkg-install pkg-message
USE_GMAKE=  yes
GNU_CONFIGURE=  yes
CPPFLAGS+=  -I${LOCALBASE}/include ${PTHREAD_CFLAGS}
LDFLAGS+=   -L${LOCALBASE}/lib ${PTHREAD_LIBS}

CHEROKEE_VARDIR?=   /var
CHEROKEE_LOGDIR?=   ${CHEROKEE_VARDIR}/log
CHEROKEE_ACCESSLOG?=    ${CHEROKEE_LOGDIR}/cherokee.access
CHEROKEE_ERRORLOG?= ${CHEROKEE_LOGDIR}/cherokee.error

# Adjust this if you need to run Cherokee as a distinct user:group
CHEROKEE_USER=  www
CHEROKEE_GROUP= www

# This should be ok since 1.0.9, cherokee drops privileges
# after opening logfiles as a security measure
CHEROKEE_LOGFILE_FILEMODE=  0600
CHEROKEE_LOGFILE_USER=  root
CHEROKEE_LOGFILE_GROUP= wheel

# Directory where to put RRD files, by default
CHEROKEE_RRDDIR=/var/lib/cherokee/graphs

CONFIGURE_ARGS= --with-wwwroot=${PREFIX}/www/cherokee \
        --localstatedir=${CHEROKEE_VARDIR} \
        --disable-static
DEFCONFS=   cherokee.conf
CONFSUBDIRS=    ssl mods-available mods-enabled sites-available sites-enabled
MAN1=       cget.1 cherokee-config.1 cherokee.1 cherokee-admin.1 cherokee-admin-launcher.1 \
        cherokee-tweak.1 cherokee-worker.1 
PORTDOCS=   *

OPTIONS=    IPV6      "IPv6 support"    on  \
        MYSQL     "MySQL Database"  off \
        LDAP      "LDAP Support"    off \
        GEOIP     "GeoIP Support (recommended)" on  \
        FFMPEG    "FFMpeg Support"  off \
        NLS   "NLS Support" on  \
        INTPCRE   "Use Internal PCRE Library"   off \
        ADMIN     "Build the Admin Interface"   on  \
        RRDTOOL   "Usage Graphs Support"  off   \
        UWSGI     "uWSGI Support" off

.include <bsd.port.options.mk>

.ifdef WITH_ADMIN
USE_PYTHON= 2.5+
PLIST_SUB+= ADMIN=""
.else
CONFIGURE_ARGS+=--disable-admin
PLIST_SUB+= ADMIN="@comment "
.endif

.include <bsd.port.pre.mk>

CONFIGURE_ARGS+=    --with-wwwuser=${CHEROKEE_USER} --with-wwwgroup=${CHEROKEE_GROUP}

.ifdef WITHOUT_IPV6
CONFIGURE_ARGS+=    --disable-ipv6
.endif

.ifdef WITH_MYSQL
USE_MYSQL=  yes
CONFIGURE_ARGS+=    --with-mysql=yes
PLIST_SUB+= MYSQL=""
.else
CONFIGURE_ARGS+=    --with-mysql=no
PLIST_SUB+= MYSQL="@comment "
.endif

.ifdef WITH_LDAP
USE_OPENLDAP=   yes
CONFIGURE_ARGS+=    --with-ldap=yes
PLIST_SUB+= LDAP=""
.else
CONFIGURE_ARGS+=    --with-ldap=no
PLIST_SUB+= LDAP="@comment "
.endif

.ifdef WITH_GEOIP
LIB_DEPENDS+=   GeoIP.5:${PORTSDIR}/net/GeoIP
CONFIGURE_ARGS+=    --with-geoip=yes
PLIST_SUB+= GEOIP=""
.else
CONFIGURE_ARGS+=    --with-geoip=no
PLIST_SUB+= GEOIP="@comment "
.endif

.ifdef WITH_FFMPEG
LIB_DEPENDS+=   avformat:${PORTSDIR}/multimedia/ffmpeg \
        avcodec:${PORTSDIR}/multimedia/ffmpeg \
        avutil:${PORTSDIR}/multimedia/ffmpeg
CONFIGURE_ARGS+=    --with-ffmpeg=yes
.else
CONFIGURE_ARGS+=    --with-ffmpeg=no
.endif

.ifdef WITH_NLS
PLIST_SUB+= NLS=""
.else
CONFIGURE_ARGS+=    --disable-nls
PLIST_SUB+= NLS="@comment "
.endif

.ifdef WITH_INTPCRE
CONFIGURE_ARGS+=    --enable-internal-pcre
.else
LIB_DEPENDS+=   pcre.1:${PORTSDIR}/devel/pcre
.endif

.ifdef WITH_RRDTOOL
RUN_DEPENDS+=   rrdtool:${PORTSDIR}/databases/rrdtool
.endif

.ifdef WITH_UWSGI
RUN_DEPENDS+=   uwsgi:${PORTSDIR}/www/uwsgi
.endif

post-patch:
    @${FIND} ${WRKSRC} -name Makefile.in | ${XARGS} \
        ${REINPLACE_CMD} -e 's|@mkdir_p@|${MKDIR} --|g'
    @${REINPLACE_CMD} -e '/cherokee_replace.*%sysconfdir%/d;/^SUBDIRS/s|doc ||;\
        /^install-data-am/s|install-data-local|install-data-local-config|;\
        /^SUBDIRS/s|windows||'\
        ${WRKSRC}/Makefile.in
    @for i in ${BUILD_WRKSRC}/*.sample.pre;do ${SED} -e \
        's:%wwwroot%:${PREFIX}/www/cherokee:g; \
        s:%prefix%:${PREFIX}:g; \
        s:%localstatedir%:/var:g' \
        $$i > $${i%.pre};done

    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/admin/CTK/CTK-run.pre
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/cherokee/cherokee-admin-launcher
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/admin/server.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/admin/upgrade_config.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/cherokee/cherokee-tweak
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/doc/cookbook_dbslayer.html
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/doc/test_images.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/contrib/tracelor.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/po/po_stats.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/qa/fcgi.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/qa/run-tests.py

post-install:
    @${INSTALL} -d ${CONFSUBDIRS:S|^|${PREFIX}/etc/cherokee/|}
    @for i in ${DEFCONFS};do\
        ${INSTALL_DATA} ${WRKSRC}/$$i.sample ${PREFIX}/etc/cherokee/$$i.default;done
    @${INSTALL_DATA} ${WRKSRC}/performance.conf.sample ${PREFIX}/etc/cherokee/cherokee.conf.perf_sample
    @:>${PREFIX}/etc/cherokee/mods-enabled/.empty
    @:>${PREFIX}/etc/cherokee/sites-available/.empty
    @:>${PREFIX}/etc/cherokee/sites-enabled/.empty
    @:>${PREFIX}/etc/cherokee/ssl/.empty
    @for i in `${FIND} ${PREFIX}/etc/cherokee/ -name \*.default`;do\
        if [ ! -f $${i%.default} ];then ${CP} $$i $${i%.default};fi;done
    @for i in `${FIND} ${PREFIX}/etc/cherokee/ -name \*.sample`;do\
        if [ ! -f $${i%.sample} ];then ${CP} $$i $${i%.sample};fi;done

.if !defined(NOPORTDOCS)
    @cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR}
.endif

.ifdef WITH_ADMIN
    @cd ${DATADIR}/admin && ${FIND} . -name "*.py" |\
    ${XARGS} ${PYTHON_CMD} ${PYTHON_LIBDIR}/py_compile.py
.endif

    @${SETENV} \
         CHEROKEE_LOGFILE_FILEMODE=${CHEROKEE_LOGFILE_FILEMODE} \
         CHEROKEE_LOGFILE_USER=${CHEROKEE_LOGFILE_USER} \
         CHEROKEE_LOGFILE_GROUP=${CHEROKEE_LOGFILE_GROUP} \
         CHEROKEE_ERRORLOG=${CHEROKEE_ERRORLOG} \
         CHEROKEE_ACCESSLOG=${CHEROKEE_ACCESSLOG} \
         CHEROKEE_WITH_RRDTOOL=${WITH_RRDTOOL} \
         CHEROKEE_RRDDIR=${CHEROKEE_RRDDIR} \
         CHEROKEE_RRDDIR_USER=${CHEROKEE_USER} \
         CHEROKEE_RRDDIR_GROUP=${CHEROKEE_GROUP} \
         ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

    @${ECHO_MSG} "==============================================================="
    @${CAT} ${PKGMESSAGE}
    @${ECHO_MSG} "==============================================================="

.include <bsd.port.post.mk>