OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Christoph Schug
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 01-Aug-2007 00:24:38
Branch: HEAD Handle: 2007073123243600
Added files:
openpkg-src/apache-suphp
apache-suphp.conf apache-suphp.patch
apache-suphp.spec suphp.conf
Log:
new package: apache-suphp 0.6.2 (Apache Extension: PHP script
executions wrapper)
Summary:
Revision Changes Path
1.1 +13 -0 openpkg-src/apache-suphp/apache-suphp.conf
1.1 +47 -0 openpkg-src/apache-suphp/apache-suphp.patch
1.1 +138 -0 openpkg-src/apache-suphp/apache-suphp.spec
1.1 +31 -0 openpkg-src/apache-suphp/suphp.conf
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/apache-suphp/apache-suphp.conf
============================================================================
$ cvs diff -u -r0 -r1.1 apache-suphp.conf
--- /dev/null 2007-08-01 00:22:01 +0200
+++ apache-suphp.conf 2007-08-01 00:24:37 +0200
@@ -0,0 +1,13 @@
+##
+## apache-suphp.conf -- Apache configuration for suPHP
+##
+
+# load DSO
+LoadModule suphp_module @l_prefix@/libexec/apache/mod_suphp.so
+
+suPHP_Engine on
+suPHP_ConfigPath @l_prefix@/etc/php/
+suPHP_AddHandler x-httpd-php
+AddHandler x-httpd-php .php
+
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/apache-suphp/apache-suphp.patch
============================================================================
$ cvs diff -u -r0 -r1.1 apache-suphp.patch
--- /dev/null 2007-08-01 00:22:01 +0200
+++ apache-suphp.patch 2007-08-01 00:24:37 +0200
@@ -0,0 +1,47 @@
+Index: src/Configuration.cpp
+--- src/Configuration.cpp.orig 2005-02-27 18:53:05 +0100
++++ src/Configuration.cpp 2005-09-07 13:31:39 +0200
+@@ -21,6 +21,8 @@
+ #include <string>
+ #include <vector>
+
++#include "config.h"
++
+ #include "IniFile.hpp"
+ #include "Util.hpp"
+
+@@ -81,7 +83,11 @@
+ }
+
+ suPHP::Configuration::Configuration() {
++#ifdef OPT_LOGFILE
++ this->logfile = OPT_LOGFILE;
++#else
+ this->logfile = "/var/log/suphp.log";
++#endif
+ #ifdef OPT_APACHE_USER
+ this->webserver_user = OPT_APACHE_USER;
+ #else
+Index: src/apache/mod_suphp.c
+--- src/apache2/mod_suphp.c.orig Mon Nov 6 01:57:12 2006
++++ src/apache2/mod_suphp.c Tue Jul 31 22:28:28 2007
+@@ -111,7 +111,7 @@
+ #define SUPHP_ENGINE_UNDEFINED 2
+
+ #ifndef SUPHP_PATH_TO_SUPHP
+-#define SUPHP_PATH_TO_SUPHP "/usr/sbin/suphp"
++#define SUPHP_PATH_TO_SUPHP "@l_prefix@/sbin/suphp"
+ #endif
+
+ typedef struct {
+@@ -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}
+ };
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/apache-suphp/apache-suphp.spec
============================================================================
$ cvs diff -u -r0 -r1.1 apache-suphp.spec
--- /dev/null 2007-08-01 00:22:01 +0200
+++ apache-suphp.spec 2007-08-01 00:24:38 +0200
@@ -0,0 +1,138 @@
+##
+## apache-suphp.spec -- OpenPKG RPM Package Specification
+## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
+## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
+##
+## Permission to use, copy, modify, and distribute this software for
+## any purpose with or without fee is hereby granted, provided that
+## the above copyright notice and this permission notice appear in all
+## copies.
+##
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+## SUCH DAMAGE.
+##
+
+# package information
+Name: apache-suphp
+Summary: Apache Extension: PHP script executions wrapper
+URL: http://www.suphp.org/
+Vendor: Sebastian Marsching
+Packager: OpenPKG Foundation e.V.
+Distribution: OpenPKG Community
+Class: EVAL
+Group: Web
+License: GPL
+Version: 0.6.2
+Release: 20070801
+
+# package options
+%option with_suphp_caller %{l_nusr}
+%option with_suphp_phpcgi %{l_prefix}/cgi/php
+%option with_suphp_ugid_mode paranoid
+%option with_suphp_ugid_check yes
+
+# list of sources
+Source0: http://www.suphp.org/download/suphp-%{version}.tar.gz
+Source1: apache-suphp.conf
+Source2: suphp.conf
+Patch0: apache-suphp.patch
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20060823, gcc, gcc::with_cxx = yes
+PreReq: OpenPKG, openpkg >= 20060823
+BuildPreReq: apache, php
+PreReq: apache, php
+AutoReq: no
+AutoReqProv: no
+
+%description
+ The suPHP Apache module together with suPHP itself provides an easy
+ way to run PHP scripts with different users on the same server.
+
+ It provides security, because the PHP scripts are not run with the
+ rights of the webserver's user. In addition to that you probably
+ won't have to use PHP's "safe mode", which applies many restrictions
+ on the scripts.
+
+%track
+ prog apache-suphp = {
+ version = %{version}
+ url = http://www.suphp.org/Download.html
+ regex = suphp-(__VER__)\.tar\.gz
+ }
+
+%prep
+ %setup -q -n suphp-%{version}
+ %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
+
+%build
+ CC="%{l_cc}" \
+ CFLAGS="%{l_cflags -O}" \
+ AUTOCONF="true" \
+ AUTOHEADER="true" \
+ AUTOMAKE="true" \
+ ACLOCAL="true" \
+ ./configure \
+ --prefix=%{l_prefix} \
+ --sysconfdir=%{l_prefix}/etc/apache \
+ --with-apr="%{l_prefix}/bin/apr-1-config" \
+ --with-apxs="%{l_prefix}/sbin/apxs" \
+ --with-apache-user=%{with_suphp_caller} \
+ --with-php=%{with_suphp_phpcgi} \
+ --with-logfile=%{l_prefix}/var/apache/log/apache-suphp.log \
+%if "%{with_suphp_ugid_check}" == "no"
+ --disable-checkuid \
+ --disable-checkgid \
+%endif
+ --with-setid-mode=%{with_suphp_ugid_mode} \
+ --enable-shared
+
+ %{l_make} %{l_mflags -O}
+
+%install
+ rm -rf $RPM_BUILD_ROOT
+
+ # install suPHP
+ %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
+
+ # install default configuration files
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE suphp.conf} \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE apache-suphp.conf} \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
+
+ # determine installation files
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%config %{l_prefix}/etc/apache/suphp.conf' \
+ '%config %{l_prefix}/etc/apache/apache.d/apache-suphp.conf' \
+ '%attr(4755,%{l_susr},%{l_sgrp}) %{l_prefix}/sbin/suphp'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
+%post
+ # after upgrade, restart service
+ [ $1 -eq 2 ] || exit 0
+ eval `%{l_rc} apache status 2>/dev/null`
+ [ ".$apache_active" = .yes ] && %{l_rc} apache restart
+ exit 0
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/apache-suphp/suphp.conf
============================================================================
$ cvs diff -u -r0 -r1.1 suphp.conf
--- /dev/null 2007-08-01 00:22:01 +0200
+++ suphp.conf 2007-08-01 00:24:38 +0200
@@ -0,0 +1,31 @@
+;;
+;; suphp.conf -- suPHP configuration file
+;;
+
+[global]
[EMAIL PROTECTED]@
+
+check_vhost_docroot=true
+docroot=/
+;chroot=/my/chroot
+
+errors_to_browser=false
+
[EMAIL PROTECTED]@/var/apache/log/apache-suphp.log
+loglevel=info
+
+env_path=/bin:/usr/bin
+
+umask=0077
+min_uid=100
+min_gid=100
+
+allow_file_group_writeable=false
+allow_file_others_writeable=false
+allow_directory_group_writeable=false
+allow_directory_others_writeable=false
+
+[handlers]
+x-httpd-php=php:@l_prefix@/cgi/php
+x-suphp-cgi=execute:!self
+
@@ .
______________________________________________________________________
OpenPKG http://openpkg.org
CVS Repository Commit List [email protected]