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:   26-Apr-2006 17:49:53
  Branch: HEAD                             Handle: 2006042616495200

  Modified files:
    openpkg-src/apache2     apache2.base apache2.spec

  Log:
    support for different MPMs, currently prefork and worker only

  Summary:
    Revision    Changes     Path
    1.2         +9  -0      openpkg-src/apache2/apache2.base
    1.72        +37 -3      openpkg-src/apache2/apache2.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/apache2/apache2.base
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 apache2.base
  --- openpkg-src/apache2/apache2.base  13 Apr 2006 15:54:27 -0000      1.1
  +++ openpkg-src/apache2/apache2.base  26 Apr 2006 15:49:52 -0000      1.2
  @@ -33,6 +33,15 @@
       MaxClients          150
       MaxRequestsPerChild 0
   </IfModule>
  +<IfModule mpm_worker_module>
  +    MinSpareThreads     25
  +    MaxSpareThreads     75
  +    ThreadsPerChild     25
  +    StartServers        2
  +    ServerLimit         16
  +    MaxClients          150
  +    MaxRequestsPerChild 0
  +</IfModule>
   HostnameLookups         off
   UseCanonicalName        on
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/apache2/apache2.spec
  ============================================================================
  $ cvs diff -u -r1.71 -r1.72 apache2.spec
  --- openpkg-src/apache2/apache2.spec  13 Apr 2006 15:54:27 -0000      1.71
  +++ openpkg-src/apache2/apache2.spec  26 Apr 2006 15:49:52 -0000      1.72
  @@ -39,7 +39,10 @@
   Group:        Web
   License:      ASF
   Version:      %{V_apache}
  -Release:      20060413
  +Release:      20060426
  +
  +#   package options (generic)
  +%option       with_mpm                  prefork
   
   #   package options (suexec related)
   %option       with_suexec               yes
  @@ -117,8 +120,24 @@
       }
   
   %prep
  +    #   some pre-flight checks on options specified
  +%if "%{with_mpm}" != "prefork" && "%{with_mpm}" != "worker"
  +    ( echo "Invalid value specified for option 'with_mpm'. Currently the"
  +      echo "only supported Multi-Processing Modules (MPMs) are ..."
  +      echo "- 'prefork' -- non-threaded, pre-forking web server (default)"
  +      echo "- 'worker'  -- hybrid multi-threaded multi-process web server"
  +    ) | %{l_rpmtool} msg -b -t error
  +    exit 1
  +%endif
  +
  +    #   unpack Apache distribution
       %setup -q -c
       %patch -p0 -d httpd-%{V_apache}
  +    %{l_shtool} subst \
  +        -e 's;(" PLATFORM ");(%{l_openpkg_release -F "OpenPKG/%%s"});g' \
  +        httpd-%{V_apache}/server/core.c
  +
  +    #   unpack optional extension modules
   %if "%{with_mod_perl}" == "yes"
       %setup -q -T -D -a 1
   %endif
  @@ -175,7 +194,12 @@
             --with-program-name=apache2 \
             --sysconfdir=%{l_prefix}/etc/apache2 \
             --libexecdir=%{l_prefix}/libexec/apache2 \
  -          --with-mpm=prefork \
  +          --with-mpm=%{with_mpm} \
  +%if "%{with_mpm}" == "worker"
  +          --enable-threads \
  +%else
  +          --disable-threads \
  +%endif
   %if "%{with_suexec}" == "yes"
             --enable-suexec \
             --with-suexec-bin=%{l_prefix}/sbin/suexec \
  @@ -222,12 +246,22 @@
             --enable-vhost-alias \
             --enable-auth-dbm \
             --disable-shared \
  -          --disable-threads \
             --with-dbm=db42 \
             --with-berkeley-db=%{l_prefix} \
             --with-expat=%{l_prefix} \
             --with-iconv=%{l_prefix}
   
  +      #   check whether requested MPM '%{with_mpm}' has been actually 
selected
  +      #   setting might affect package dependencies, therefore fallbacks
  +      #   are not acceptable
  +      if ! grep '^MPM_NAME = %{with_mpm}$' build/config_vars.mk >/dev/null 
2>&1; then
  +          ( echo "The Multi-Processing Module (MPM) '%{with_mpm}' requested 
using the 'with_mpm'"
  +            echo "option doesn't seem to be availble on this particular 
platform."
  +            echo "Please check corresponding 'config.log' for details."
  +          ) | %{l_rpmtool} msg -b -t error
  +          exit 1
  +      fi
  +
         #   build package
         %{l_make} %{l_mflags}
       ) || exit $?
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to