aboutsummaryrefslogtreecommitdiffstats
path: root/www/p5-CGI-SpeedyCGI/Makefile
blob: 2c4972cf092fe43d6f831bef29130d3ddd22bed1 (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
# Created by: Lars Thegler <lars@thegler.dk>
# $FreeBSD$

PORTNAME=   CGI-SpeedyCGI
PORTVERSION=    2.22
PORTREVISION=   8
CATEGORIES= www perl5
MASTER_SITES=   CPAN
PKGNAMEPREFIX=  p5-

MAINTAINER= perl@FreeBSD.org
COMMENT=    Speed up perl CGI scripts by running them persistently

LICENSE=    GPLv2

MAKE_JOBS_UNSAFE=   yes
USES=       perl5
USE_PERL5=  configure patch

OPTIONS_DEFINE= APACHE
OPTIONS_DEFAULT=APACHE
APACHE_DESC=    Build mod_speedycgi

OPTIONS_SUB=    yes
APACHE_USE= APACHE=22+
APACHE_CONFIGURE_ENV_OFF=   WITHOUT_APACHE=yes

post-patch:
    @${REINPLACE_CMD} -e 's/__inline__//g' \
        ${WRKSRC}/src/speedy_inc.h
    @${PERL} -pi -e 's,apxs -q,${APXS} -q,;' \
        ${WRKSRC}/src/SpeedyMake.pl
    @${PERL} -pi -e 's,APXS=apxs,APXS=${APXS},;' \
        ${WRKSRC}/mod_speedycgi/Makefile.tmpl
    ${CP} ${FILESDIR}/speedy_dump.c ${WRKSRC}/speedy_dump/
    @${REINPLACE_CMD} -i '' -e 's=New(123,=Newx(=g' \
        ${WRKSRC}/src/speedy_backend_main.h
    ${REINPLACE_CMD} -e 's|@APXS_STAGE@|-S LIBEXECDIR=${STAGEDIR}${PREFIX}/${APACHEMODDIR}|' \
        ${WRKSRC}/mod_speedycgi/Makefile.tmpl

pre-install:
    @${MKDIR} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}

post-configure:
    @${PERL} -pi -e 's,^PREFIX = /usr$$,PREFIX = ${PREFIX},g;' \
        ${WRKSRC}/Makefile ${WRKSRC}/*/Makefile

post-build:
    @(cd ${WRKSRC}/speedy_dump && ${CC} ${CFLAGS} -o speedy_dump \
        -I../src speedy_dump.c)

post-install:
    @${INSTALL_PROGRAM} ${WRKSRC}/speedy/speedy ${STAGEDIR}${PREFIX}/bin/speedy_suidperl
    @${CHMOD} 4755 ${STAGEDIR}${PREFIX}/bin/speedy_suidperl
    @${INSTALL_PROGRAM} ${WRKSRC}/speedy_dump/speedy_dump \
        ${STAGEDIR}${PREFIX}/bin/speedy_dump

.include <bsd.port.mk>