aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaichi <daichi@FreeBSD.org>2003-06-25 14:50:53 +0800
committerdaichi <daichi@FreeBSD.org>2003-06-25 14:50:53 +0800
commitfe4210785111cadcbe829df2fa63ed772a0ec886 (patch)
tree71cad3f7416cc08113913fca313ec116a8c7eb4b
parent6c5a1418eeb11297d31b41925b56659c897e75ea (diff)
downloadfreebsd-ports-gnome-fe4210785111cadcbe829df2fa63ed772a0ec886.tar.gz
freebsd-ports-gnome-fe4210785111cadcbe829df2fa63ed772a0ec886.tar.zst
freebsd-ports-gnome-fe4210785111cadcbe829df2fa63ed772a0ec886.zip
Add suphp 0.2.2,
suPHP is a combination which provides a wrapper for PHP. PR: 42790 Submitted by: Clement Laforet <sheepkiller@cultdeadsheep.org>
-rw-r--r--www/Makefile1
-rw-r--r--www/suphp/Makefile88
-rw-r--r--www/suphp/distinfo1
-rw-r--r--www/suphp/files/patch-Makefile33
-rw-r--r--www/suphp/files/patch-config.h9
-rw-r--r--www/suphp/files/patch-suphp.c34
-rw-r--r--www/suphp/pkg-descr8
-rw-r--r--www/suphp/pkg-message11
-rw-r--r--www/suphp/pkg-plist20
9 files changed, 205 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile
index 9e8a837ae779..ba0de3ba4ec4 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -457,6 +457,7 @@
SUBDIR += squirm
SUBDIR += squishdot
SUBDIR += ssserver
+ SUBDIR += suphp
SUBDIR += surfraw
SUBDIR += swiggle
SUBDIR += swish++
diff --git a/www/suphp/Makefile b/www/suphp/Makefile
new file mode 100644
index 000000000000..48a679ca0dc3
--- /dev/null
+++ b/www/suphp/Makefile
@@ -0,0 +1,88 @@
+# New ports collection makefile for: suphp
+# Date created: 15 September 2002
+# Whom: Clement Laforet <sheepkiller@cultdeadsheep.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= suphp
+PORTVERSION= 0.2.2
+PORTREVISION= 1
+CATEGORIES= www
+MASTER_SITES= http://www.suphp.org/download/
+
+MAINTAINER= sheepkiller@cultdeadsheep.org
+COMMENT= suPHP is a combination which provides a wrapper for PHP
+
+BUILD_DEPENDS= ${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache13
+RUN_DEPENDS= ${LOCALBASE}/bin/php:${PORTSDIR}/lang/php4
+
+USE_REINPLACE= yes
+HAS_CONFIGURE= no
+
+MAKE_ARGS+= APXS="${APXS}"
+APXS?= ${LOCALBASE}/sbin/apxs
+WWW_USER?= www
+WWW_GROUP?= www
+LOG_PATH?= /var/log
+PHP_PATH?= ${LOCALBASE}/bin/php
+
+pre-configure:
+ @${ECHO}
+ @${ECHO} "*-------------------------------------------------------------*"
+ @${ECHO} " suPHP conflicts with mod_php4. It works only with php command"
+ @${ECHO} " line binairy."
+ @${ECHO} " Options :"
+ @${ECHO} " - WWW_USER = Apache's User (default www)"
+ @${ECHO} " - Define CHECK_PATH, to enable suExec-like path checking"
+ @${ECHO} " (based on DocumentRoot directive)."
+ @${ECHO} " - LOG_PATH=/path/to/your/logs. Default /var/log/."
+ @${ECHO} " - PHP_PATH=/path/to/bin/php. Default ${LOCALBASE}/bin/php."
+ @${ECHO} "*-------------------------------------------------------------*"
+ @${ECHO}
+
+do-configure:
+ @${ECHO} "Setting User to : ${WWW_USER}"
+ @${REINPLACE_CMD} -e 's!OPT_APACHE_USER "wwwrun"!OPT_APACHE_USER "${WWW_USER}"!' \
+ ${WRKSRC}/config.h
+ @${ECHO} "Setting Group to : ${WWW_GROUP}"
+ @${REINPLACE_CMD} -e 's!OPT_APACHE_GROUP "wwwrun"!OPT_APACHE_GROUP "${WWW_USER}"!' \
+ ${WRKSRC}/config.h
+ @${ECHO} "Setting checkpath. (if enabled)"
+.if !defined(CHECK_PATH)
+ @${REINPLACE_CMD} -e 's!#define OPT_CHECKPATH!/*#define OPT_CHECKPATH*/!' \
+ ${WRKSRC}/config.h
+.endif
+ @${ECHO} "Setting logs path"
+ @${REINPLACE_CMD} -e 's,OPT_LOGFILE "/opt/apache/var/logs/suphp_log",OPT_LOGFILE "${LOG_PATH}/suphp_log",' \
+ ${WRKSRC}/config.h
+ @${ECHO} "Setting php path"
+ @${REINPLACE_CMD} -e 's,OPT_PATH_TO_PHP "/usr/bin/php",OPT_PATH_TO_PHP "${PHP_PATH}",' \
+ ${WRKSRC}/config.h
+ @${ECHO} "Setting suphp path in mod_suphp"
+ @${REINPLACE_CMD} -e "s,/usr/sbin/suphp,${PREFIX}/sbin/suphp," ${WRKSRC}/apache/mod_suphp.c
+
+pre-install:
+ ${APXS} -i -a -c -n suphp ${WRKSRC}/apache/mod_suphp.c
+
+post-install:
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR} ${DOCSDIR}/apache ${DOCSDIR}/de-doc ${DOCSDIR}/de-doc/apache
+ ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/INSTALL ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/LICENSE ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/apache/CONFIG ${DOCSDIR}/apache
+ ${INSTALL_DATA} ${WRKSRC}/apache/README ${DOCSDIR}/apache
+ ${INSTALL_DATA} ${WRKSRC}/apache/INSTALL ${DOCSDIR}/apache
+ ${INSTALL_DATA} ${WRKSRC}/apache/LICENSE ${DOCSDIR}/apache
+ ${INSTALL_DATA} -d ${WRKSRC}/de-doc/ ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/de-doc/README.de ${DOCSDIR}/de-doc/
+ ${INSTALL_DATA} ${WRKSRC}/de-doc/INSTALL.de ${DOCSDIR}/de-doc/
+ ${INSTALL_DATA} ${WRKSRC}/de-doc/apache/README.de ${DOCSDIR}/de-doc/apache
+ ${INSTALL_DATA} ${WRKSRC}/de-doc/apache/INSTALL.de ${DOCSDIR}/de-doc/apache
+ ${INSTALL_DATA} ${WRKSRC}/de-doc/apache/CONFIG.de ${DOCSDIR}/de-doc/apache
+.endif
+ @${RM} mod_suphp.o
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/www/suphp/distinfo b/www/suphp/distinfo
new file mode 100644
index 000000000000..7cb1c8848772
--- /dev/null
+++ b/www/suphp/distinfo
@@ -0,0 +1 @@
+MD5 (suphp-0.2.2.tar.gz) = c035fa4ffc73b3cb037791ab85fe94fa
diff --git a/www/suphp/files/patch-Makefile b/www/suphp/files/patch-Makefile
new file mode 100644
index 000000000000..a472d9849926
--- /dev/null
+++ b/www/suphp/files/patch-Makefile
@@ -0,0 +1,33 @@
+--- Makefile.orig Wed Oct 23 22:16:50 2002
++++ Makefile Tue Nov 12 12:10:58 2002
+@@ -2,9 +2,9 @@
+ ## Makefile for suPHP ##
+ ##############################################
+
+-SUPHP_INSTALL = /usr/sbin/suphp
++SUPHP_INSTALL = $(PREFIX)/sbin/suphp
+
+-CC = gcc
++#CC = gcc
+ CFLAGS = -c -Wall
+ LD = gcc
+ LDFLAGS = -o
+@@ -31,11 +31,7 @@
+ touch suphp.h
+
+ install: suphp
+- if [ $$UID = 0 ]; then \
+- cp suphp ${SUPHP_INSTALL}; \
+- else \
+- echo -e "You need to be root to install suPHP."; \
+- fi
++ $(INSTALL) -o root -g wheel -m 4755 suphp ${SUPHP_INSTALL}
+
+ clean:
+ rm *.o
+@@ -43,3 +39,5 @@
+
+ rmbackups:
+ rm *~
++
++all: suphp
diff --git a/www/suphp/files/patch-config.h b/www/suphp/files/patch-config.h
new file mode 100644
index 000000000000..310ec652982c
--- /dev/null
+++ b/www/suphp/files/patch-config.h
@@ -0,0 +1,9 @@
+--- config.h.orig Wed Oct 23 22:16:50 2002
++++ config.h Wed Nov 13 16:30:35 2002
+@@ -24,5 +24,6 @@
+ #define OPT_MIN_UID 100
+ #define OPT_MIN_GID 100
+ #define OPT_APACHE_USER "wwwrun"
++#define OPT_APACHE_GROUP "wwwrun"
+ #define OPT_PATH_TO_PHP "/usr/bin/php"
+ #define OPT_LOGFILE "/opt/apache/var/logs/suphp_log"
diff --git a/www/suphp/files/patch-suphp.c b/www/suphp/files/patch-suphp.c
new file mode 100644
index 000000000000..832fd84d1868
--- /dev/null
+++ b/www/suphp/files/patch-suphp.c
@@ -0,0 +1,34 @@
+--- suphp.c.orig Wed Oct 23 22:16:50 2002
++++ suphp.c Wed Nov 13 16:26:01 2002
+@@ -68,6 +68,7 @@
+ {
+ // Check, if program has been started by Apache
+ struct passwd *apacheuser;
++ struct group *apachegroup;
+ struct passwd *calluser;
+ struct passwd *targetuser;
+ struct group *targetgroup;
+@@ -76,6 +77,7 @@
+ path_translated = getenv("SCRIPT_FILENAME");
+
+ apacheuser = getpwnam(OPT_APACHE_USER);
++ apachegroup = getgrnam(OPT_APACHE_GROUP);
+ calluser = getpwuid(getuid());
+
+ if (calluser->pw_uid!=apacheuser->pw_uid)
+@@ -105,13 +107,13 @@
+
+ // Get gid and uid of the file and check it
+ targetuser = getpwuid(file_get_uid(path_translated));
+- if (targetuser->pw_uid < OPT_MIN_UID)
++ if (targetuser->pw_uid < OPT_MIN_UID && targetuser->pw_uid != apacheuser->pw_uid)
+ {
+ log_error ("UID of %s (%d / %s) < %d", path_translated, targetuser->pw_uid, targetuser->pw_name, OPT_MIN_UID);
+ error_exit(ERRCODE_LOW_UID);
+ }
+ targetgroup = getgrgid(file_get_gid(path_translated));
+- if (targetgroup->gr_gid < OPT_MIN_GID)
++ if (targetgroup->gr_gid < OPT_MIN_GID && targetgroup->gr_gid != apachegroup->gr_gid)
+ {
+ log_error ("GID of %s (%d / %s) < %d", path_translated, targetgroup->gr_gid, targetgroup->gr_name, OPT_MIN_GID);
+ error_exit(ERRCODE_LOW_GID);
diff --git a/www/suphp/pkg-descr b/www/suphp/pkg-descr
new file mode 100644
index 000000000000..04e588bb5945
--- /dev/null
+++ b/www/suphp/pkg-descr
@@ -0,0 +1,8 @@
+suPHP is a combination of an Apache module (mod_suphp) and an executable
+which provides a wrapper for PHP. With both together, it is possible to
+execute PHP scripts with the permissions of their owner without having
+to place a PHP binary in each user's cgi-bin directory. suPHP doesn't
+need Apache's suExec, provides a logging function and support for
+different php.ini's.
+
+WWW: http://www.suphp.org
diff --git a/www/suphp/pkg-message b/www/suphp/pkg-message
new file mode 100644
index 000000000000..9c723ef6a0eb
--- /dev/null
+++ b/www/suphp/pkg-message
@@ -0,0 +1,11 @@
+----------------------------------------------------------------
+You have installed mod_suphp, a module that provides a wrapper
+for PHP for Apache.
+
+For help on using this module, please see the suPHP homepage:
+ http://www.suphp.org
+
+Important hints:
+Using suPHP can break some PHP-scripts, because of Apache's CGI
+interface.
+-----------------------------------------------------------------
diff --git a/www/suphp/pkg-plist b/www/suphp/pkg-plist
new file mode 100644
index 000000000000..b14a8b924309
--- /dev/null
+++ b/www/suphp/pkg-plist
@@ -0,0 +1,20 @@
+sbin/suphp
+libexec/apache/mod_suphp.so
+@exec %D/sbin/apxs -e -a -n suphp %D/%f
+@unexec echo "===> If you do not plan on reinstalling suphp, you must manually remove"; echo "===> references to it in httpd.conf."
+%%PORTDOCS%%share/doc/suphp/apache/CONFIG
+%%PORTDOCS%%share/doc/suphp/apache/README
+%%PORTDOCS%%share/doc/suphp/apache/INSTALL
+%%PORTDOCS%%share/doc/suphp/apache/LICENSE
+%%PORTDOCS%%share/doc/suphp/de-doc/apache/README.de
+%%PORTDOCS%%share/doc/suphp/de-doc/apache/INSTALL.de
+%%PORTDOCS%%share/doc/suphp/de-doc/apache/CONFIG.de
+%%PORTDOCS%%share/doc/suphp/de-doc/README.de
+%%PORTDOCS%%share/doc/suphp/de-doc/INSTALL.de
+%%PORTDOCS%%share/doc/suphp/README
+%%PORTDOCS%%share/doc/suphp/INSTALL
+%%PORTDOCS%%share/doc/suphp/LICENSE
+%%PORTDOCS%%@dirrm share/doc/suphp/de-doc/apache
+%%PORTDOCS%%@dirrm share/doc/suphp/de-doc
+%%PORTDOCS%%@dirrm share/doc/suphp/apache
+%%PORTDOCS%%@dirrm share/doc/suphp/