aboutsummaryrefslogtreecommitdiffstats
path: root/www/cherokee/Makefile
blob: 1962b1a3cefb8e8c969d593b62aa31d2586677f7 (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
# New ports collection makefile for:    cherokee
# Date created:         01 Jun 2002
# Whom:             silence <oksala@videotron.ca>
#
# $FreeBSD$
#

PORTNAME=   cherokee
PORTVERSION=    0.11.3
CATEGORIES= www
MASTER_SITES=   http://www.cherokee-project.com/download/0.11/${PORTVERSION}/ \
        LOCAL/beech

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

LIB_DEPENDS=    pcre.0:${PORTSDIR}/devel/pcre \
        GeoIP.5:${PORTSDIR}/net/GeoIP

CONFLICTS=  cherokee-devel-[0-9]*
USE_GNOME=  gnomehack gnometarget pkgconfig
USE_LDCONFIG=   yes
USE_RC_SUBR=    cherokee.sh
USE_BISON=  build
USE_MYSQL=  yes
USE_PYTHON= 2.4+
USE_OPENLDAP=   yes
GNU_CONFIGURE=  yes
CPPFLAGS=   -I${LOCALBASE}/include ${PTHREAD_CFLAGS}
LDFLAGS=    -L${LOCALBASE}/lib ${PTHREAD_LIBS}
CONFIGURE_ENV=  CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS= --with-wwwroot=${PREFIX}/www/cherokee \
        --localstatedir=/var \
        --enable-readdir_r \
        --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 \
        spawn-fcgi.1 cherokee-tweak.1 cherokee-worker.1
PORTDOCS=   *

OPTIONS=    OPENSSL "TLS/SSL support via openssl"   on \
        GNUTLS  "TLS/SSL support via gnutls"    off \
        IPV6    "IPv6 support"          on

.include <bsd.port.pre.mk>

.ifndef WITHOUT_OPENSSL
CONFIGURE_ARGS+=--enable-tls=openssl
.elifdef WITH_GNUTLS
LIB_DEPENDS+=   gnutls.26:${PORTSDIR}/security/gnutls
CONFIGURE_ARGS+=--enable-tls=gnutls
.else
CONFIGURE_ARGS+=--disable-tls
.endif

.ifdef WITHOUT_IPV6
CONFIGURE_ARGS+=--disable-ipv6
.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:%sysconfdir%:${PREFIX}/etc:g; \
        s:%datadir%:${PREFIX}/share:g; \
        s:%wwwroot%:${PREFIX}/www/cherokee:g; \
        s:%prefix%:${PREFIX}:g; \
        s:%localstatedir%:/var:g; \
        s:#.*User.*nobody:User www:g; \
        s:#.*Group.*nogroup:Group www:g; \
        s:#.*PollMethod.*poll:PollMethod kqueue:g' \
        $$i > $${i%.pre};done
    @${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}/contrib/05to06.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/contrib/06to07.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/contrib/07to08.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/contrib/08to09.py
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|/usr/local/bin/python|' \
        ${WRKSRC}/contrib/09to010.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

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

.include <bsd.port.post.mk>