[php-pecl-zendopcache/epel7] update to 7.0.3 + cleanups

Remi Collet remi at fedoraproject.org
Mon Jan 20 15:02:10 UTC 2014


commit 96be8a0dd8ff4b9e25783fbaacfff37c59987fb8
Author: Remi Collet <remi at fedoraproject.org>
Date:   Mon Jan 20 16:02:24 2014 +0100

    update to 7.0.3 +  cleanups

 .gitignore                |    1 +
 blacklist.inc             |    3 +
 php-pecl-zendopcache.spec |   92 +++++++++++----------------------------------
 php_cli_server.inc        |   47 +++++++++++++++++++++++
 sources                   |    2 +-
 5 files changed, 74 insertions(+), 71 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index eccc3d8..7bae11b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 *spec~
 /zendopcache-7.0.1.tgz
 /zendopcache-7.0.2.tgz
+/zendopcache-7.0.3.tgz
diff --git a/blacklist.inc b/blacklist.inc
new file mode 100644
index 0000000..a9db751
--- /dev/null
+++ b/blacklist.inc
@@ -0,0 +1,3 @@
+<?php
+	echo "ok\n";
+?>
diff --git a/php-pecl-zendopcache.spec b/php-pecl-zendopcache.spec
index 4927f6b..722bbbe 100644
--- a/php-pecl-zendopcache.spec
+++ b/php-pecl-zendopcache.spec
@@ -6,19 +6,14 @@
 #
 # Please, preserve the changelog entries
 #
-%{?scl:%scl_package php-pecl-zendopcache}
-%{!?scl:%global pkg_name %{name}}
-%{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}}
-%{!?__php:      %{expand: %%global __php      %{_bindir}/php}}
 %{!?__pecl:     %{expand: %%global __pecl     %{_bindir}/pecl}}
-%global with_zts   0%{?__ztsphp:1}
 %global proj_name  ZendOpcache
 %global pecl_name  zendopcache
 %global plug_name  opcache
 
-Name:          %{?scl_prefix}php-pecl-%{pecl_name}
-Version:       7.0.2
-Release:       3%{?dist}
+Name:          php-pecl-%{pecl_name}
+Version:       7.0.3
+Release:       1%{?dist}
 Summary:       The Zend OPcache
 
 Group:         Development/Libraries
@@ -30,18 +25,23 @@ Source0:       http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
 Source1:       %{plug_name}.ini
 Source2:       %{plug_name}-default.blacklist
 
-BuildRequires: %{?scl_prefix}php-devel >= 5.2.0
-BuildRequires: %{?scl_prefix}php-pear
+# Missing in archive
+# https://github.com/zendtech/ZendOptimizerPlus/issues/162
+Source3:       https://raw2.github.com/zendtech/ZendOptimizerPlus/e8e28cd95c8aa660c28c2166da679b50deb50faa/tests/blacklist.inc
+Source4:       https://raw2.github.com/zendtech/ZendOptimizerPlus/e8e28cd95c8aa660c28c2166da679b50deb50faa/tests/php_cli_server.inc
+
+BuildRequires: php-devel >= 5.2.0
+BuildRequires: php-pear
 
 Requires(post): %{__pecl}
 Requires(postun): %{__pecl}
-Requires:      %{?scl_prefix}php(zend-abi) = %{php_zend_api}
-Requires:      %{?scl_prefix}php(api) = %{php_core_api}
+Requires:      php(zend-abi) = %{php_zend_api}
+Requires:      php(api) = %{php_core_api}
 
-Provides:      %{?scl_prefix}php-pecl(%{plug_name}) = %{version}%{?prever}
-Provides:      %{?scl_prefix}php-pecl(%{plug_name})%{?_isa} = %{version}%{?prever}
-Provides:      %{?scl_prefix}php-%{plug_name} = %{version}-%{release}
-Provides:      %{?scl_prefix}php-%{plug_name}%{?_isa} = %{version}-%{release}
+Provides:      php-pecl(%{plug_name}) = %{version}%{?prever}
+Provides:      php-pecl(%{plug_name})%{?_isa} = %{version}%{?prever}
+Provides:      php-%{plug_name} = %{version}-%{release}
+Provides:      php-%{plug_name}%{?_isa} = %{version}-%{release}
 
 # Filter private shared
 %{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
@@ -60,20 +60,7 @@ bytecode optimization patterns that make code execution faster.
 %setup -q -c
 mv %{pecl_name}-%{version} NTS
 
-cd NTS
-
-# Sanity check, really often broken
-extver=$(sed -n '/#define ACCELERATOR_VERSION/{s/.* "//;s/".*$//;p}' ZendAccelerator.h)
-if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
-   : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever:-%{prever}}.
-   exit 1
-fi
-cd ..
-
-%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
-%endif
+cp %{SOURCE3} %{SOURCE4} NTS/tests/
 
 
 %build
@@ -84,15 +71,6 @@ cd NTS
     --with-php-config=%{_bindir}/php-config
 make %{?_smp_mflags}
 
-%if %{with_zts}
-cd ../ZTS
-%{_bindir}/zts-phpize
-%configure \
-    --enable-optimizer-plus \
-    --with-php-config=%{_bindir}/zts-php-config
-make %{?_smp_mflags}
-%endif
-
 
 %install
 make -C NTS install INSTALL_ROOT=%{buildroot}
@@ -106,17 +84,6 @@ sed -e 's:@EXTPATH@:%{php_extdir}:' \
 # The default Zend OPcache blacklist file
 install -D -p -m 644 %{SOURCE2} %{buildroot}%{php_inidir}/%{plug_name}-default.blacklist
 
-%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
-
-install -D -p -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/%{plug_name}.ini
-sed -e 's:@EXTPATH@:%{php_ztsextdir}:' \
-    -e 's:@INIPATH@:%{php_ztsinidir}:' \
-    -i %{buildroot}%{php_ztsinidir}/%{plug_name}.ini
-
-install -D -p -m 644 %{SOURCE2} %{buildroot}%{php_ztsinidir}/%{plug_name}-default.blacklist
-%endif
-
 # Install XML package description
 install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
 
@@ -133,19 +100,6 @@ NO_INTERACTION=1 \
 REPORT_EXIT_STATUS=1 \
 %{__php} -n run-tests.php
 
-%if %{with_zts}
-cd ../ZTS
-%{__ztsphp} \
-    -n -d zend_extension=%{buildroot}%{php_ztsextdir}/%{plug_name}.so \
-    -m | grep "Zend OPcache"
-
-TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d zend_extension=%{buildroot}%{php_ztsextdir}/%{plug_name}.so" \
-NO_INTERACTION=1 \
-REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php
-%endif
-
 
 %post
 %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
@@ -162,17 +116,15 @@ fi
 %config(noreplace) %{php_inidir}/%{plug_name}-default.blacklist
 %config(noreplace) %{php_inidir}/%{plug_name}.ini
 %{php_extdir}/%{plug_name}.so
-
-%if %{with_zts}
-%config(noreplace) %{php_ztsinidir}/%{plug_name}-default.blacklist
-%config(noreplace) %{php_ztsinidir}/%{plug_name}.ini
-%{php_ztsextdir}/%{plug_name}.so
-%endif
-
 %{pecl_xmldir}/%{name}.xml
 
 
 %changelog
+* Mon Jan 20 2014 Remi Collet <rcollet at redhat.com> - 7.0.3-1
+- Update to 7.0.3
+- open https://github.com/zendtech/ZendOptimizerPlus/issues/162
+- cleanup the zts and scl stuff
+
 * Tue Jan 14 2014 Remi Collet <rcollet at redhat.com> - 7.0.2-3
 - drop conflicts with other opcode cache
 
diff --git a/php_cli_server.inc b/php_cli_server.inc
new file mode 100644
index 0000000..0878bfa
--- /dev/null
+++ b/php_cli_server.inc
@@ -0,0 +1,47 @@
+<?php
+define ("PHP_CLI_SERVER_HOSTNAME", "localhost");
+define ("PHP_CLI_SERVER_PORT", 8964);
+define ("PHP_CLI_SERVER_ADDRESS", PHP_CLI_SERVER_HOSTNAME.":".PHP_CLI_SERVER_PORT);
+
+function php_cli_server_start($ini = "") {
+	$php_executable = getenv('TEST_PHP_EXECUTABLE');
+	$doc_root = __DIR__;
+
+	$descriptorspec = array(
+		0 => STDIN,
+		1 => STDOUT,
+		2 => STDERR,
+	);
+
+	if (substr(PHP_OS, 0, 3) == 'WIN') {
+		$cmd = "{$php_executable} -t {$doc_root} $ini -S " . PHP_CLI_SERVER_ADDRESS;
+		$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true,  "suppress_errors" => true));
+	} else {
+		$cmd = "exec {$php_executable} -t {$doc_root} $ini -S " . PHP_CLI_SERVER_ADDRESS . " 2>/dev/null";
+		$handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root);
+	}
+	
+	// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
+	//       it might not be listening yet...need to wait until fsockopen() call returns
+    $i = 0;
+    while (($i++ < 30) && !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) {
+        usleep(10000);
+    }
+
+    if ($fp) {
+        fclose($fp);
+    }
+
+	register_shutdown_function(
+		function($handle) {
+			proc_terminate($handle);
+		},
+			$handle
+		);
+	// don't bother sleeping, server is already up
+	// server can take a variable amount of time to be up, so just sleeping a guessed amount of time
+	// does not work. this is why tests sometimes pass and sometimes fail. to get a reliable pass
+	// sleeping doesn't work.
+}
+?>
+
diff --git a/sources b/sources
index 42fb163..9184a23 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-a175166ac32544051bd3277cc00a7b5d  zendopcache-7.0.2.tgz
+a25679504ae75bf0813acafc99991a95  zendopcache-7.0.3.tgz


More information about the scm-commits mailing list