Lines 6-91
Link Here
|
6 |
# |
6 |
# |
7 |
|
7 |
|
8 |
PORTNAME= suphp |
8 |
PORTNAME= suphp |
9 |
PORTVERSION= 0.2.3 |
9 |
PORTVERSION= 0.3 |
10 |
PORTREVISION= 1 |
|
|
11 |
CATEGORIES= www |
10 |
CATEGORIES= www |
12 |
MASTER_SITES= http://www.suphp.org/download/ |
11 |
MASTER_SITES= http://www.suphp.org/download/ |
13 |
|
12 |
|
14 |
MAINTAINER= sheepkiller@cultdeadsheep.org |
13 |
MAINTAINER= sheepkiller@cultdeadsheep.org |
15 |
COMMENT= suPHP is a combination which provides a wrapper for PHP |
14 |
COMMENT= A combination which provides a wrapper for PHP |
16 |
|
15 |
|
17 |
BUILD_DEPENDS= ${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache13 |
16 |
BUILD_DEPENDS= ${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache13 |
18 |
RUN_DEPENDS= ${LOCALBASE}/bin/php:${PORTSDIR}/www/php4-cgi |
17 |
RUN_DEPENDS= ${LOCALBASE}/bin/php:${PORTSDIR}/www/php4-cgi |
19 |
|
18 |
|
20 |
USE_REINPLACE= yes |
19 |
HAS_CONFIGURE= yes |
|
|
20 |
USE_GMAKE= yes |
21 |
CONFLICTS= mod_php4-4* |
21 |
|
22 |
|
22 |
MAKE_ARGS+= APXS="${APXS}" |
|
|
23 |
APXS?= ${LOCALBASE}/sbin/apxs |
23 |
APXS?= ${LOCALBASE}/sbin/apxs |
24 |
WWW_USER?= www |
|
|
25 |
WWW_GROUP?= www |
26 |
LOG_PATH?= /var/log |
24 |
LOG_PATH?= /var/log |
27 |
PHP_PATH?= ${LOCALBASE}/bin/php |
25 |
PHP_PATH?= ${LOCALBASE}/bin/php |
|
|
26 |
APACHE_USER?= www |
28 |
|
27 |
|
29 |
.include <bsd.port.pre.mk> |
28 |
CONFIGURE_ARGS+= --with-php=${PHP_PATH} \ |
30 |
|
29 |
--with-logfile=${LOG_PATH}/suphp.log \ |
31 |
.if exists(${LOCALBASE}/libexec/apache/libphp4.so) |
30 |
--with-apache-user=${APACHE_USER} \ |
32 |
IGNORE="suPHP conflicts with mod_php4. It works only with php4-cgi" |
31 |
--with-min-gid=80 \ |
|
|
32 |
--with-min-uid=80 \ |
33 |
--with-apxs=${APXS} |
34 |
|
35 |
## Available knobs: |
36 |
## WITHOUT_CHECKPATH: disable check if script resides in DOCUMENT_ROOT |
37 |
.if defined(WITHOUT_CHECKPATH) |
38 |
CONFIGURE_ARGS+= --disable-checkpath |
33 |
.endif |
39 |
.endif |
34 |
|
40 |
## WITHOUT_CHECKUID: accept UIDs that are not listed in /etc/passwd |
35 |
pre-configure: |
41 |
.if defined(WITHOUT_CHECKUID) |
36 |
@${ECHO} |
42 |
CONFIGURE_ARGS+= --disable-checkuid |
37 |
@${ECHO} "*-------------------------------------------------------------*" |
|
|
38 |
@${ECHO} " Options :" |
39 |
@${ECHO} " - WWW_USER = Apache's User (default www)" |
40 |
@${ECHO} " - Define CHECK_PATH, to enable suExec-like path checking" |
41 |
@${ECHO} " (based on DocumentRoot directive)." |
42 |
@${ECHO} " - LOG_PATH=/path/to/your/logs. Default /var/log/." |
43 |
@${ECHO} " - PHP_PATH=/path/to/bin/php. Default ${LOCALBASE}/bin/php." |
44 |
@${ECHO} "*-------------------------------------------------------------*" |
45 |
@${ECHO} |
46 |
|
47 |
do-configure: |
48 |
@${ECHO} "Setting User to : ${WWW_USER}" |
49 |
@${REINPLACE_CMD} -e 's!OPT_APACHE_USER "wwwrun"!OPT_APACHE_USER "${WWW_USER}"!' \ |
50 |
${WRKSRC}/config.h |
51 |
@${ECHO} "Setting Group to : ${WWW_GROUP}" |
52 |
@${REINPLACE_CMD} -e 's!OPT_APACHE_GROUP "wwwrun"!OPT_APACHE_GROUP "${WWW_USER}"!' \ |
53 |
${WRKSRC}/config.h |
54 |
@${ECHO} "Setting checkpath. (if enabled)" |
55 |
.if !defined(CHECK_PATH) |
56 |
@${REINPLACE_CMD} -e 's!#define OPT_CHECKPATH!/*#define OPT_CHECKPATH*/!' \ |
57 |
${WRKSRC}/config.h |
58 |
.endif |
43 |
.endif |
59 |
@${ECHO} "Setting logs path" |
44 |
## WITHOUT_CHECKGID: accept GIDs that are not listed in /etc/group |
60 |
@${REINPLACE_CMD} -e 's,OPT_LOGFILE "/opt/apache/var/logs/suphp_log",OPT_LOGFILE "${LOG_PATH}/suphp_log",' \ |
45 |
.if defined(WITHOUT_CHECKGID) |
61 |
${WRKSRC}/config.h |
46 |
CONFIGURE_ARGS+= --disable-checkgid |
62 |
@${ECHO} "Setting php path" |
47 |
.endif |
63 |
@${REINPLACE_CMD} -e 's,OPT_PATH_TO_PHP "/usr/bin/php",OPT_PATH_TO_PHP "${PHP_PATH}",' \ |
48 |
|
64 |
${WRKSRC}/config.h |
49 |
show-options: |
65 |
@${ECHO} "Setting suphp path in mod_suphp" |
50 |
@${EGREP} '^##' ${.CURDIR}/Makefile | ${SED} 's/##//' |
66 |
@${REINPLACE_CMD} -e "s,/usr/sbin/suphp,${PREFIX}/sbin/suphp," ${WRKSRC}/apache/mod_suphp.c |
|
|
67 |
|
51 |
|
68 |
post-build: |
52 |
pre-everything:: |
69 |
@(cd ${WRKSRC}/apache && ${APXS} -c mod_suphp.c) |
53 |
@${MAKE} show-options |
70 |
|
54 |
|
71 |
post-install: |
55 |
post-install: |
72 |
@(cd ${WRKSRC}/apache && ${APXS} -i -a -n suphp ${WRKSRC}/apache/mod_suphp.so) |
|
|
73 |
.if !defined(NOPORTDOCS) |
56 |
.if !defined(NOPORTDOCS) |
74 |
@${MKDIR} ${DOCSDIR} ${DOCSDIR}/apache ${DOCSDIR}/de-doc ${DOCSDIR}/de-doc/apache |
57 |
@${MKDIR} ${DOCSDIR} |
75 |
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} |
58 |
@${CP} -Rfp ${WRKSRC}/doc/* ${DOCSDIR} |
76 |
${INSTALL_DATA} ${WRKSRC}/INSTALL ${DOCSDIR} |
|
|
77 |
${INSTALL_DATA} ${WRKSRC}/LICENSE ${DOCSDIR} |
78 |
${INSTALL_DATA} ${WRKSRC}/apache/CONFIG ${DOCSDIR}/apache |
79 |
${INSTALL_DATA} ${WRKSRC}/apache/README ${DOCSDIR}/apache |
80 |
${INSTALL_DATA} ${WRKSRC}/apache/INSTALL ${DOCSDIR}/apache |
81 |
${INSTALL_DATA} ${WRKSRC}/apache/LICENSE ${DOCSDIR}/apache |
82 |
${INSTALL_DATA} -d ${WRKSRC}/de-doc/ ${DOCSDIR} |
83 |
${INSTALL_DATA} ${WRKSRC}/de-doc/README.de ${DOCSDIR}/de-doc/ |
84 |
${INSTALL_DATA} ${WRKSRC}/de-doc/INSTALL.de ${DOCSDIR}/de-doc/ |
85 |
${INSTALL_DATA} ${WRKSRC}/de-doc/apache/README.de ${DOCSDIR}/de-doc/apache |
86 |
${INSTALL_DATA} ${WRKSRC}/de-doc/apache/INSTALL.de ${DOCSDIR}/de-doc/apache |
87 |
${INSTALL_DATA} ${WRKSRC}/de-doc/apache/CONFIG.de ${DOCSDIR}/de-doc/apache |
88 |
.endif |
59 |
.endif |
89 |
@${CAT} ${PKGMESSAGE} |
60 |
@${CAT} ${PKGMESSAGE} |
90 |
|
61 |
|
91 |
.include <bsd.port.post.mk> |
62 |
.include <bsd.port.mk> |