From b7ae880ff6b94898f177451fa114835c071caed3 Mon Sep 17 00:00:00 2001 From: Menno Duursma Date: Tue, 11 May 2010 22:25:46 +0200 Subject: network/suphp: Updated for version 0.6.3 --- network/suphp/README | 13 ++------- network/suphp/doinst.sh | 7 ++--- network/suphp/slack-desc | 8 +++--- network/suphp/suphp-0.6.2-vhosts.patch | 29 ------------------- network/suphp/suphp-0.6.3-vhosts.patch | 29 +++++++++++++++++++ network/suphp/suphp.SlackBuild | 51 +++++++++++++++++----------------- network/suphp/suphp.conf | 4 +-- network/suphp/suphp.info | 8 +++--- 8 files changed, 70 insertions(+), 79 deletions(-) delete mode 100644 network/suphp/suphp-0.6.2-vhosts.patch create mode 100644 network/suphp/suphp-0.6.3-vhosts.patch diff --git a/network/suphp/README b/network/suphp/README index e1e4bb9c6b..669b5b5bda 100644 --- a/network/suphp/README +++ b/network/suphp/README @@ -17,13 +17,6 @@ Some of the 'standard' /etc/httpd/httpd.conf directives include: To use different php versions 'per vhost' see: http://www.howtoforge.com/apache2_suphp_php4_php5 -suPHP needs a CGI build of the .php interpreter, usually named 'php-cgi' -implying having to (re)compile PHP with in place of '--with-apxs' - - '--enable-force-cgi-redirect' - -Note that it being somewhat slower then mod_php can be redused -(grately) by building for the FastCGI too and using mod_fcgid -however that would need additional configuration, see: -http://fastcgi.coremail.cn/configuration.htm - +mod_php can be reduced (greatly) by rebuilding PHP for FastCGI and +using mod_fcgid; however, that requires additional configuration. +See http://fastcgi.coremail.cn/configuration.htm for details. diff --git a/network/suphp/doinst.sh b/network/suphp/doinst.sh index 3f513b956f..e796ae0a4e 100644 --- a/network/suphp/doinst.sh +++ b/network/suphp/doinst.sh @@ -1,16 +1,15 @@ config() { NEW="$1" - OLD="`dirname $NEW`/`basename $NEW .new`" + OLD="$(dirname $NEW)/$(basename $NEW .new)" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD - elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } -# Add a sample config-file, if only for documentation -config etc/apache/suphp.conf.new +config etc/httpd/suphp.conf.new diff --git a/network/suphp/slack-desc b/network/suphp/slack-desc index 4bbf41e9f9..fa46fd1fd6 100644 --- a/network/suphp/slack-desc +++ b/network/suphp/slack-desc @@ -6,14 +6,14 @@ # customary to leave one space after the ':'. |-----handy-ruler------------------------------------------------------| -suphp: suPHP (a PHP module) +suphp: suPHP (an Apache module) suphp: suphp: mod_suphp is a module for executing PHP scripts with the permission -suphp: of their owers rather then the user the webserver runs as. Similar -suphp: to suEXEC for CGI/SSI, but supporting a configuration file. +suphp: of their owners rather then the user the webserver runs as. +suphp: It is similar to suEXEC for CGI/SSI but supports a configuration file. suphp: suphp: It uses a setuid root wrapper binary (/usr/sbin/suphp) to change suphp: the uid of the process executing the PHP interpreter. suphp: -suphp: suPHP is maintained by: Sebastian Marsching +suphp: suPHP is maintained by Sebastian Marsching suphp: diff --git a/network/suphp/suphp-0.6.2-vhosts.patch b/network/suphp/suphp-0.6.2-vhosts.patch deleted file mode 100644 index ea6e13c996..0000000000 --- a/network/suphp/suphp-0.6.2-vhosts.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -ur src.std/apache/mod_suphp.c src/apache/mod_suphp.c ---- src.std/apache/mod_suphp.c 2006-09-23 19:04:36.000000000 +0200 -+++ src/apache/mod_suphp.c 2007-02-15 17:29:37.000000000 +0100 -@@ -249,9 +249,9 @@ - {"suPHP_UserGroup", suphp_handle_cmd_user_group, NULL, - RSRC_CONF|ACCESS_CONF, TAKE2, "User and group scripts shall be run as"}, - #endif -- {"suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_CONF, -+ {"suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF|ACCESS_CONF, - ITERATE, "Tells mod_suphp to handle these MIME-types"}, -- {"suphp_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, ACCESS_CONF, -+ {"suphp_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, RSRC_CONF|ACCESS_CONF, - ITERATE, "Tells mod_suphp not to handle these MIME-types"}, - {NULL} - }; -diff -ur src.std/apache2/mod_suphp.c src/apache2/mod_suphp.c ---- src.std/apache2/mod_suphp.c 2006-11-06 01:57:12.000000000 +0100 -+++ src/apache2/mod_suphp.c 2007-02-15 17:30:35.000000000 +0100 -@@ -321,8 +321,8 @@ - AP_INIT_TAKE2("suPHP_UserGroup", suphp_handle_cmd_user_group, NULL, RSRC_CONF | ACCESS_CONF, - "User and group scripts shall be run as"), - #endif -- AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"), -- AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, ACCESS_CONF, "Tells mod_suphp not to handle these MIME-types"), -+ AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"), -+ AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp not to handle these MIME-types"), - {NULL} - }; - diff --git a/network/suphp/suphp-0.6.3-vhosts.patch b/network/suphp/suphp-0.6.3-vhosts.patch new file mode 100644 index 0000000000..ea6e13c996 --- /dev/null +++ b/network/suphp/suphp-0.6.3-vhosts.patch @@ -0,0 +1,29 @@ +diff -ur src.std/apache/mod_suphp.c src/apache/mod_suphp.c +--- src.std/apache/mod_suphp.c 2006-09-23 19:04:36.000000000 +0200 ++++ src/apache/mod_suphp.c 2007-02-15 17:29:37.000000000 +0100 +@@ -249,9 +249,9 @@ + {"suPHP_UserGroup", suphp_handle_cmd_user_group, NULL, + RSRC_CONF|ACCESS_CONF, TAKE2, "User and group scripts shall be run as"}, + #endif +- {"suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_CONF, ++ {"suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF|ACCESS_CONF, + ITERATE, "Tells mod_suphp to handle these MIME-types"}, +- {"suphp_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, ACCESS_CONF, ++ {"suphp_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, RSRC_CONF|ACCESS_CONF, + ITERATE, "Tells mod_suphp not to handle these MIME-types"}, + {NULL} + }; +diff -ur src.std/apache2/mod_suphp.c src/apache2/mod_suphp.c +--- src.std/apache2/mod_suphp.c 2006-11-06 01:57:12.000000000 +0100 ++++ src/apache2/mod_suphp.c 2007-02-15 17:30:35.000000000 +0100 +@@ -321,8 +321,8 @@ + AP_INIT_TAKE2("suPHP_UserGroup", suphp_handle_cmd_user_group, NULL, RSRC_CONF | ACCESS_CONF, + "User and group scripts shall be run as"), + #endif +- AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"), +- AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, ACCESS_CONF, "Tells mod_suphp not to handle these MIME-types"), ++ AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"), ++ AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp not to handle these MIME-types"), + {NULL} + }; + diff --git a/network/suphp/suphp.SlackBuild b/network/suphp/suphp.SlackBuild index 0fb2b13fb9..42515eb197 100644 --- a/network/suphp/suphp.SlackBuild +++ b/network/suphp/suphp.SlackBuild @@ -4,46 +4,47 @@ # Written by Menno E. Duursma -# Exit on most errors -set -e - PRGNAM=suphp -VERSION=0.6.2 +VERSION=0.6.3 ARCH=${ARCH:-i486} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} + CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} # Drop the package in /tmp -# The stock Apache on Slackware runs httpd onder system +# The stock Apache on Slackware runs httpd under system # user/group account 'apache'. If you happen to use some -# other account (which should improve security) change below -# and make sure /etc/apache/suphp.conf matches -HTTPD_USER=apache -HTTPD_GROUP=apache +# other account change the directives below +HTTPD_USER=${HTTPD_USER:-apache} +HTTPD_GROUP=${HTTPD_GROUP:-apache} if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" fi +set -e # Exit on most errors + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . chmod -R u+w,go+r-w,a-s . -# Apply patch to have it globally honor the suPHP_Engine directive -cat $CWD/suphp-0.6.2-vhosts.patch | patch -p0 --verbose +# Apply a patch to have it globally honor the suPHP_Engine directive +patch -p0 --verbose < $CWD/suphp-$VERSION-vhosts.patch -# Default to secure settings, as any of the configuretion options -# can be overwritten in the config-file /etc/apache/suphp.conf anyways +# Default to secure settings, as any of the configuration options +# can be overwritten in the config-file /etc/httpd/suphp.conf anyway CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ @@ -52,29 +53,28 @@ CXXFLAGS="$SLKCFLAGS" \ --with-apxs=/usr/sbin/apxs \ --sysconfdir=/etc/httpd \ --with-apache-user=$HTTPD_USER \ - --with-logfile=/var/log/apache/suphp_log + --with-logfile=/var/log/httpd/suphp_log \ + --enable-static=no \ + --build=$ARCH-slackware-linux \ + --host=$ARCH-slackware-linux -# Compile the application and install it into the $PKG directory make -make install-strip DESTDIR=$PKG +make install DESTDIR=$PKG -# The above misses Apache module ( cd $PKG - strip --strip-unneeded usr/libexec/apache/mod_suphp.so + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) -# Copy program documentation into the package mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a AUTHORS COPYING ChangeLog doc/* $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.SBo -# Add a sample configuration file mkdir -p $PKG/etc/httpd -cat $CWD/suphp.conf \ - | tr 'webserver_user=apache' "webserver_user=$HTTPD_USER" \ - >> $PKG/etc/httpd/suphp.conf.new +sed s/'webserver_user=apache'/"webserver_user=$HTTPD_USER"/g \ + $CWD/suphp.conf >> $PKG/etc/httpd/suphp.conf.new -# Copy the slack-desc (and a custom doinst.sh if necessary) into ./install mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh @@ -84,7 +84,6 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh echo "chgrp $HTTPD_GROUP usr/sbin/suphp" >> $PKG/install/doinst.sh echo "chmod 4750 usr/sbin/suphp" >> $PKG/install/doinst.sh -# Make the package; be sure to leave it in $OUTPUT cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/network/suphp/suphp.conf b/network/suphp/suphp.conf index 39bc18936b..9bd6bcbafe 100644 --- a/network/suphp/suphp.conf +++ b/network/suphp/suphp.conf @@ -1,12 +1,12 @@ [global] ;Path to logfile -logfile=/var/log/apache/suphp_log +logfile=/var/log/httpd/suphp_log ;Loglevel loglevel=info ;User Apache is running as -webserver_user=nobody +webserver_user=apache ;Path all scripts have to be in docroot=/var/www diff --git a/network/suphp/suphp.info b/network/suphp/suphp.info index 9eed775611..d34d8d10d0 100644 --- a/network/suphp/suphp.info +++ b/network/suphp/suphp.info @@ -1,8 +1,8 @@ PRGNAM="suphp" -VERSION="0.6.2" +VERSION="0.6.3" HOMEPAGE="http://www.suphp.org/" -DOWNLOAD="http://www.suphp.org/download/suphp-0.6.2.tar.gz" -MD5SUM="06ca9e592a5c6dd3dcb9360c958369c1" +DOWNLOAD="http://www.suphp.org/download/suphp-0.6.3.tar.gz" +MD5SUM="756e8893857fefed087a89959a87645a" MAINTAINER="Menno Duursma" EMAIL="druiloor@zonnet.nl" -APPROVED="BP{k}" +APPROVED="rworkman" -- cgit v1.2.3