From a6786d424a3bc6063a03e56f7a4e343f9c1a795e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 16 Mar 2014 10:58:46 +0100 Subject: php-pecl-vld: cleanups and apply upstream patch for PHP 5.6 --- LICENSE | 23 +++++++++++++++++++++++ php-pecl-vld.spec | 50 ++++++++++++++++++++++++++++++++++++++++++++------ vld-git.patch | 26 ++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 LICENSE create mode 100644 vld-git.patch diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..14dbb68 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2002-2013, Derick Rethans + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS 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 COPYRIGHT HOLDER OR 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. diff --git a/php-pecl-vld.spec b/php-pecl-vld.spec index 50190bb..bd4d81d 100644 --- a/php-pecl-vld.spec +++ b/php-pecl-vld.spec @@ -6,22 +6,28 @@ # # Please, preserve the changelog entries # -%{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}} -%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} +%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d} +%{!?__pecl: %global __pecl %{_bindir}/pecl} +%{!?__php: %global __php %{_bindir}/php} -%global with_zts 0%{?__ztsphp:1} %global pecl_name vld +%global with_zts 0%{?__ztsphp:1} Summary: Dump the internal representation of PHP scripts Name: php-pecl-%{pecl_name} Version: 0.12.0 -Release: 1%{?dist}.1 +Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz # https://bugs.php.net/57944 ask license file +Source1: https://raw.github.com/derickr/vld/master/LICENSE + +# https://github.com/derickr/vld/commit/28c5d156fe21dd9e3ddcd318b0bf7dd3b387a28a +# Adding missing PHP 5.6 opcodes. +Patch0: %{pecl_name}-git.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: php-devel @@ -37,9 +43,25 @@ Provides: php-%{pecl_name}%{?_isa} = %{version} Provides: php-pecl(%{pecl_name}) = %{version} Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} -# Filter shared private +%if "%{?vendor}" == "Remi Collet" +# Other third party repo stuff +Obsoletes: php53-pecl-%{pecl_name} +Obsoletes: php53u-pecl-%{pecl_name} +Obsoletes: php54-pecl-%{pecl_name} +%if "%{php_version}" > "5.5" +Obsoletes: php55u-pecl-%{pecl_name} +%endif +%if "%{php_version}" > "5.6" +Obsoletes: php56u-pecl-%{pecl_name} +%endif +%endif + +%if 0%{?fedora} < 20 +# Filter private shared %{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} %{?filter_setup} +%endif + %description The Vulcan Logic Disassembler hooks into the Zend Engine and @@ -50,6 +72,11 @@ dumps all the opcodes (execution units) of a script. %setup -q -c mv %{pecl_name}-%{version} NTS +cd NTS +%patch0 -p1 -b .fromgit +cp %{SOURCE1} LICENSE +cd .. + %if %{with_zts} # Duplicate source tree for NTS / ZTS build cp -pr NTS ZTS @@ -106,6 +133,12 @@ make -C ZTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini %endif +# Test & Documentation +cd NTS +for i in LICENSE $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +done + %post %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : @@ -137,7 +170,7 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc NTS/CREDITS +%doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{pecl_name}.ini %{php_extdir}/%{pecl_name}.so @@ -149,5 +182,10 @@ rm -rf %{buildroot} %changelog +* Sun Mar 16 2014 Remi Collet - 0.12.0-2 +- install doc in pecl_docdir +- add missing License file (from github repo) +- apply upstream patch for PHP 5.6 + * Wed Sep 25 2013 Remi Collet - 0.12.0-1 - initial package diff --git a/vld-git.patch b/vld-git.patch new file mode 100644 index 0000000..abb3c54 --- /dev/null +++ b/vld-git.patch @@ -0,0 +1,26 @@ +From 28c5d156fe21dd9e3ddcd318b0bf7dd3b387a28a Mon Sep 17 00:00:00 2001 +From: Derick Rethans +Date: Sat, 8 Mar 2014 20:43:18 +0000 +Subject: [PATCH] Adding missing PHP 5.6 opcodes. + +--- + srm_oparray.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/srm_oparray.c b/srm_oparray.c +index 81a872c..28b868b 100644 +--- a/srm_oparray.c ++++ b/srm_oparray.c +@@ -232,6 +232,9 @@ + /* 161 */ { "GENERATOR_RETURN", NONE_USED }, + /* 162 */ { "FAST_CALL", OP1_USED }, + /* 163 */ { "FAST_RET", NONE_USED }, ++ /* 164 */ { "ZEND_RECV_VARIADIC", ALL_USED }, ++ /* 165 */ { "POW", ALL_USED }, ++ /* 166 */ { "POW_ASSIGN", ALL_USED | EXT_VAL }, + #endif + }; + +-- +1.8.5.5 + -- cgit