[packages/php/PHP_5_5] up to PHP 5.5.0 Beta 1

glen glen at pld-linux.org
Tue Apr 2 12:22:14 CEST 2013


commit 8328535b37e4e8c9eafe810075ce9f07d944aa01
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Apr 2 11:33:51 2013 +0300

    up to PHP 5.5.0 Beta 1
    
    Adds Zend Opcache extension and enable building it by default.
    More details here: https://wiki.php.net/rfc/optimizerplus

 dep-tests.sh |  7 +++++--
 php.spec     | 44 ++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 45 insertions(+), 6 deletions(-)
---
diff --git a/php.spec b/php.spec
index 1ff4338..854bd59 100644
--- a/php.spec
+++ b/php.spec
@@ -60,6 +60,7 @@
 %bcond_with	mysqlnd		# with mysqlnd support in mysql related extensions
 %bcond_without	mysqli		# without mysqli support (Requires mysql > 4.1)
 %bcond_without	odbc		# without ODBC extension module
+%bcond_without	opcache		# without Enable Zend OPcache extension support
 %bcond_without	openssl		# without OpenSSL support and OpenSSL extension (module)
 %bcond_without	pcre		# without PCRE extension module
 %bcond_without	pdo_sqlite	# without PDO SQLite extension module
@@ -127,7 +128,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %define		php_suffix 55
 
 %define		rel	0.3
-%define		subver	alpha6
+%define		subver	beta1
 Summary:	PHP: Hypertext Preprocessor
 Summary(fr.UTF-8):	Le langage de script embarque-HTML PHP
 Summary(pl.UTF-8):	Język skryptowy PHP
@@ -141,7 +142,7 @@ Epoch:		4
 License:	PHP
 Group:		Libraries
 Source0:	http://downloads.php.net/dsp/%{orgname}-%{version}%{subver}.tar.xz
-# Source0-md5:	c2aa16727f554fc4a1fda7db09d251f2
+# Source0-md5:	19b4558c63660ecb9c2fc71c4eb0e0f5
 Source2:	%{orgname}-mod_%{orgname}.conf
 Source3:	%{orgname}-cgi-fcgi.ini
 Source4:	%{orgname}-apache.ini
@@ -316,6 +317,7 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define		hashver		1.0
 %define		intlver		1.1.0
 %define		jsonver		1.2.1
+%define		opcachever	7.0.1-dev
 %define		pharver		2.0.1
 %define		sqlite3ver	0.7-dev
 %define		zipver		1.11.0
@@ -1184,6 +1186,21 @@ Moduł PHP ze wsparciem dla ODBC.
 %description odbc -l pt_BR.UTF-8
 Um módulo para aplicações PHP que usam ODBC.
 
+%package opcache
+Summary:	Zend Optimizer+ - PHP code optimizer
+Group:		Libraries
+URL:		https://wiki.php.net/rfc/optimizerplus
+Requires:	%{name}-common = %{epoch}:%{version}-%{release}
+Provides:	php(opcache) = %{opcachever}
+
+%description opcache
+The Zend OPcache provides faster PHP execution through opcode caching
+and optimization. It improves PHP performance by storing precompiled
+script bytecode in the shared memory. This eliminates the stages of
+reading code from the disk and compiling it on future access. In
+addition, it applies a few bytecode optimization patterns that make
+code execution faster.
+
 %package openssl
 Summary:	OpenSSL extension module for PHP
 Summary(pl.UTF-8):	Moduł OpenSSL dla PHP
@@ -2058,6 +2075,12 @@ if test "$ver" != "%{jsonver}"; then
 	: Update the jsonver macro and rebuild.
 	exit 1
 fi
+ver=$(sed -n '/#define ACCELERATOR_VERSION /{s/.* "//;s/".*$//;p}' ext/opcache/ZendAccelerator.h)
+if test "$ver" != "%{opcachever}"; then
+	: Error: Upstream Zend Opcachge version is now ${ver}, expecting %{opcachever}.
+	: Update the opcachever macro and rebuild.
+	exit 1
+fi
 ver=$(sed -rne 's,.*<version>(.+)</version>,\1,p' ext/bz2/package.xml)
 if test "$ver" != "%{bz2ver}"; then
 	: Error: Upstream BZIP2 version is now ${ver}, expecting %{bz2ver}.
@@ -2235,6 +2258,7 @@ for sapi in $sapis; do
 	--with-mysql=shared,%{!?with_mysqlnd:/usr}%{?with_mysqlnd:mysqlnd} \
 	%{?with_mysqli:--with-mysqli=shared,%{!?with_mysqlnd:/usr/bin/mysql_config}%{?with_mysqlnd:mysqlnd}} \
 	%{?with_oci8:--with-oci8=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
+	%{?with_opcache:--enable-opcache=shared} \
 	%{?with_openssl:--with-openssl=shared} \
 	%{?with_kerberos5:--with-kerberos} \
 	--with-tcadb=/usr \
@@ -2318,6 +2342,9 @@ install -d conf.d
 generate_inifiles() {
 	for so in modules/*.so; do
 		mod=$(basename $so .so)
+		ext=extension
+		# opcache.so is zend extension
+		nm $so | grep -q zend_extension_entry && ext=zend_extension
 		conf="$mod.ini"
 		# xml needs to be loaded before wddx
 		[ "$mod" = "wddx" ] && conf="xml_$mod.ini"
@@ -2331,8 +2358,8 @@ generate_inifiles() {
 		[ "$mod" = "mysqlnd" ] && conf="MySQLND.ini"
 		echo "+ $conf"
 		cat > conf.d/$conf <<-EOF
-			; Enable $mod extension module
-			extension=$mod.so
+			; Enable $mod $ext module
+			$ext=$mod.so
 		EOF
 	done
 }
@@ -2638,6 +2665,7 @@ fi
 %extension_scripts mysqlnd
 %extension_scripts oci8
 %extension_scripts odbc
+%extension_scripts opcache
 %extension_scripts openssl
 %extension_scripts pcre
 %extension_scripts pdo
@@ -2974,6 +3002,14 @@ fi
 %attr(755,root,root) %{php_extensiondir}/odbc.so
 %endif
 
+%if %{with opcache}
+%files opcache
+%defattr(644,root,root,755)
+%doc ext/opcache/README
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/opcache.ini
+%attr(755,root,root) %{php_extensiondir}/opcache.so
+%endif
+
 %if %{with openssl}
 %files openssl
 %defattr(644,root,root,755)
diff --git a/dep-tests.sh b/dep-tests.sh
old mode 100644
new mode 100755
index 3ee6a4f..f28ab54
--- a/dep-tests.sh
+++ b/dep-tests.sh
@@ -34,7 +34,7 @@ conf_dir=${CONFIG_DIR:-$(php-config --sysconfdir)/conf.d $(php-config --sysconfd
 tmpini=$(mktemp)
 
 # poldek --sn ac-ready -u php-*
-for ext in $ext_dir/*.so; do
+for ext in ${1:-$ext_dir/*.so}; do
 	[ -f $ext ] || continue
 	ext=${ext##*/}; ext=${ext%.so}
 
@@ -44,7 +44,10 @@ for ext in $ext_dir/*.so; do
 
 	echo -n "$ext (deps: ${deps# })..."
 
-	grep -rlE '^extension=('$(echo "${deps# }" | tr ' ' '|')').so$' $conf_dir | LC_CTYPE=C LC_ALL= sort | xargs cat > $tmpini
+	# special: opcache is listed as "Zend Opcache"
+	[ "$ext" = "opcache" ] && ext="zend opcache"
+
+	grep -rlE '^(zend_)?extension=('$(echo "${deps# }" | tr ' ' '|')').so$' $conf_dir | LC_CTYPE=C LC_ALL= sort | xargs cat > $tmpini
 	$php -n -d extension_dir=$ext_dir -c $tmpini -r "exit(extension_loaded('${ext}') ? 0 : 1);"
 	rc=$?
 	if [ $rc = 0 ]; then
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/8328535b37e4e8c9eafe810075ce9f07d944aa01



More information about the pld-cvs-commit mailing list