瀏覽代碼

add optional support for the PECL memcache extension, sponsored by Ciao GmbH <http://www.ciao-group.com/>

Christoph Schug 17 年之前
父節點
當前提交
89e1d15bcc
共有 2 個文件被更改,包括 58 次插入12 次删除
  1. 29 6
      apache-php/apache-php.spec
  2. 29 6
      php/php.spec

+ 29 - 6
apache-php/apache-php.spec

@@ -27,6 +27,7 @@
 %define       V_php_suhosin_e           0.9.23
 %define       V_php_hardened            5.1.6-0.4.15
 %define       V_php_kolab               5.2.5
+%define       V_php_pecl_memcache       2.2.3
 
 #   package information
 Name:         apache-php
@@ -39,7 +40,7 @@ Class:        BASE
 Group:        Web
 License:      PHP
 Version:      %{V_php}
-Release:      20080312
+Release:      20080325
 
 #   package options
 %option       with_suhosin              no
@@ -87,9 +88,10 @@ Release:      20080312
 %option       with_xml                  no
 %option       with_xslt                 no
 %option       with_zlib                 no
+%option       with_pecl_memcache        no
 
 #   fixing implicit extension dependencies and correlations
-%if "%{with_mm}" == "yes"
+%if "%{with_mm}" == "yes" || "%{with_pecl_memcache}" == "yes"
 %undefine     with_session
 %define       with_session       yes
 %endif
@@ -107,7 +109,7 @@ Release:      20080312
 %undefine     with_imap
 %define       with_imap          yes
 %endif
-%if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes"
+%if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes" || "%{with_pecl_memcache}" == "yes"
 %undefine     with_zlib
 %define       with_zlib          yes
 %endif
@@ -125,6 +127,7 @@ Source0:      http://static.php.net/www.php.net/distributions/php-%{V_php}.tar.g
 Source1:      http://download.suhosin.org/suhosin-%{V_php_suhosin_e}.tgz
 Source2:      apache-php.ini
 Source3:      apache-php.conf
+Source4:      http://pecl.php.net/get/memcache-%{V_php_pecl_memcache}.tgz
 Patch0:       http://www.hardened-php.net/hardening-patch-%{V_php_hardened}.patch.gz
 Patch1:       http://download.suhosin.org/suhosin-patch-%{V_php_suhosin_p}.patch.gz
 Patch2:       http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/php/php-%{V_php_kolab}/KOLAB_Annotations.patch
@@ -136,7 +139,7 @@ BuildPreReq:  OpenPKG, openpkg >= 20050615, gcc, flex, bison
 PreReq:       OpenPKG, openpkg >= 20050615
 BuildPreReq:  apache
 PreReq:       apache
-%if "%{with_suhosin}" == "yes"
+%if "%{with_suhosin}" == "yes" || "%{with_pecl_memcache}" == "yes"
 BuildPreReq:  autoconf
 %endif
 %if "%{with_sqlite}" == "yes"
@@ -262,6 +265,10 @@ PreReq:       libxml
 BuildPreReq:  tidy
 PreReq:       tidy
 %endif
+%if "%{with_pecl_memcache}" == "yes"
+BuildPreReq:  memcached
+PreReq:       memcached
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -301,6 +308,11 @@ AutoReqProv:  no
         url       = http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/php/
         regex     = php-(\d+(\.\d+)+)/
     }
+    prog apache-php:pecl_memcache = {
+        version   = %{V_php_pecl_memcache}
+        url       = http://pecl.php.net/package/memcache/
+        regex     = memcache-(2(\.\d+)+)\.tgz
+    }
 
 %prep
     %setup -q -n php-%{V_php}
@@ -312,8 +324,16 @@ AutoReqProv:  no
     %patch -p1 -P 1
     mv suhosin-%{V_php_suhosin_e} ext/suhosin
     rm -f package.xml
-    export PHP_AUTOCONF=autoconf-213
-    ./buildconf --copy --force
+%endif
+%if "%{with_pecl_memcache}" == "yes"
+    %setup -q -n php-%{V_php} -T -D -a 4
+    mv memcache-%{V_php_pecl_memcache} ext/memcache
+%endif
+%if "%{with_suhosin}" == "yes" || "%{with_pecl_memcache}" == "yes"
+    #   in case we add extensions the configure script needs to be newly
+    #   generated
+    export PHP_AUTOCONF="autoconf-213"
+    rm -f configure && ./buildconf --copy --force
     $PHP_AUTOCONF
 %endif
     %{l_shtool} subst \
@@ -537,6 +557,9 @@ AutoReqProv:  no
         --with-tidy=%{l_prefix} \
 %else
         --without-tidy \
+%endif
+%if "%{with_pecl_memcache}" == "yes"
+        --enable-memcache \
 %endif
         --with-apxs2=%{l_prefix}/sbin/apxs \
         --disable-cli \

+ 29 - 6
php/php.spec

@@ -27,6 +27,7 @@
 %define       V_php_suhosin_e           0.9.23
 %define       V_php_hardened            5.1.6-0.4.15
 %define       V_php_kolab               5.2.5
+%define       V_php_pecl_memcache       2.2.3
 
 #   package information
 Name:         php
@@ -39,7 +40,7 @@ Class:        BASE
 Group:        Language
 License:      PHP
 Version:      %{V_php}
-Release:      20080312
+Release:      20080325
 
 #   package options
 %option       with_suhosin              no
@@ -87,9 +88,10 @@ Release:      20080312
 %option       with_xml                  no
 %option       with_xslt                 no
 %option       with_zlib                 no
+%option       with_pecl_memcache        no
 
 #   fixing implicit extension dependencies and correlations
-%if "%{with_mm}" == "yes"
+%if "%{with_mm}" == "yes" || "%{with_pecl_memcache}" == "yes"
 %undefine     with_session
 %define       with_session       yes
 %endif
@@ -107,7 +109,7 @@ Release:      20080312
 %undefine     with_imap
 %define       with_imap          yes
 %endif
-%if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes"
+%if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes" || "%{with_pecl_memcache}" == "yes"
 %undefine     with_zlib
 %define       with_zlib          yes
 %endif
@@ -124,6 +126,7 @@ Release:      20080312
 Source0:      http://static.php.net/www.php.net/distributions/php-%{V_php}.tar.gz
 Source1:      http://download.suhosin.org/suhosin-%{V_php_suhosin_e}.tgz
 Source2:      php.ini
+Source3:      http://pecl.php.net/get/memcache-%{V_php_pecl_memcache}.tgz
 Patch0:       http://www.hardened-php.net/hardening-patch-%{V_php_hardened}.patch.gz
 Patch1:       http://download.suhosin.org/suhosin-patch-%{V_php_suhosin_p}.patch.gz
 Patch2:       http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/php/php-%{V_php_kolab}/KOLAB_Annotations.patch
@@ -133,7 +136,7 @@ Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
 BuildPreReq:  OpenPKG, openpkg >= 20050615, gcc, flex, bison
 PreReq:       OpenPKG, openpkg >= 20050615
-%if "%{with_suhosin}" == "yes"
+%if "%{with_suhosin}" == "yes" || "%{with_pecl_memcache}" == "yes"
 BuildPreReq:  autoconf
 %endif
 %if "%{with_sqlite}" == "yes"
@@ -259,6 +262,10 @@ PreReq:       libxml
 BuildPreReq:  tidy
 PreReq:       tidy
 %endif
+%if "%{with_pecl_memcache}" == "yes"
+BuildPreReq:  memcached
+PreReq:       memcached
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -300,6 +307,11 @@ AutoReqProv:  no
         url       = http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/php/
         regex     = php-(\d+(\.\d+)+)/
     }
+    prog php:pecl_memcache = {
+        version   = %{V_php_pecl_memcache}
+        url       = http://pecl.php.net/package/memcache/
+        regex     = memcache-(2(\.\d+)+)\.tgz
+    }
 
 %prep
     %setup -q
@@ -311,8 +323,16 @@ AutoReqProv:  no
     %patch -p1 -P 1
     mv suhosin-%{V_php_suhosin_e} ext/suhosin
     rm -f package.xml
-    export PHP_AUTOCONF=autoconf-213
-    ./buildconf --copy --force
+%endif
+%if "%{with_pecl_memcache}" == "yes"
+    %setup -q -n php-%{V_php} -T -D -a 3
+    mv memcache-%{V_php_pecl_memcache} ext/memcache
+%endif
+%if "%{with_suhosin}" == "yes" || "%{with_pecl_memcache}" == "yes"
+    #   in case we add extensions the configure script needs to be newly
+    #   generated
+    export PHP_AUTOCONF="autoconf-213"
+    rm -f configure && ./buildconf --copy --force
     $PHP_AUTOCONF
 %endif
     %{l_shtool} subst \
@@ -533,6 +553,9 @@ AutoReqProv:  no
         --with-tidy=%{l_prefix} \
 %else
         --without-tidy \
+%endif
+%if "%{with_pecl_memcache}" == "yes"
+        --enable-memcache \
 %endif
         --enable-cli \
         --enable-cgi \