From c0e24453c8cf8dfdfdcf6dda082eb67652cf0f0c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 4 Oct 2014 18:44:57 +0200 Subject: php-pecl-redis: fix segfault with igbinary serializer --- php-pecl-redis.spec | 53 +++++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 24 deletions(-) (limited to 'php-pecl-redis.spec') diff --git a/php-pecl-redis.spec b/php-pecl-redis.spec index 974a673..124c7ea 100644 --- a/php-pecl-redis.spec +++ b/php-pecl-redis.spec @@ -25,7 +25,7 @@ Summary: Extension for communicating with the Redis key-value store Name: %{?scl_prefix}php-pecl-redis Version: 2.2.5 -Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1 +Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/redis @@ -50,6 +50,8 @@ Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} # php-pecl-igbinary missing php-pecl(igbinary)%{?_isa} Requires: %{?scl_prefix}php-pecl-igbinary%{?_isa} +%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} + Obsoletes: %{?scl_prefix}php-redis < %{version} Provides: %{?scl_prefix}php-redis = %{version}-%{release} Provides: %{?scl_prefix}php-redis%{?_isa} = %{version}-%{release} @@ -58,17 +60,17 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} # Other third party repo stuff -Obsoletes: php53-pecl-%{pecl_name} -Obsoletes: php53u-pecl-%{pecl_name} -Obsoletes: php54-pecl-%{pecl_name} -Obsoletes: php54w-pecl-%{pecl_name} +Obsoletes: php53-pecl-%{pecl_name} <= %{version} +Obsoletes: php53u-pecl-%{pecl_name} <= %{version} +Obsoletes: php54-pecl-%{pecl_name} <= %{version} +Obsoletes: php54w-pecl-%{pecl_name} <= %{version} %if "%{php_version}" > "5.5" -Obsoletes: php55u-pecl-%{pecl_name} -Obsoletes: php55w-pecl-%{pecl_name} +Obsoletes: php55u-pecl-%{pecl_name} <= %{version} +Obsoletes: php55w-pecl-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "5.6" -Obsoletes: php56u-pecl-%{pecl_name} -Obsoletes: php56w-pecl-%{pecl_name} +Obsoletes: php56u-pecl-%{pecl_name} <= %{version} +Obsoletes: php56w-pecl-%{pecl_name} <= %{version} %endif %endif @@ -87,16 +89,18 @@ This Redis client implements most of the latest Redis API. As method only only works when also implemented on the server side, some doesn't work with an old redis server version. +Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection}. + %prep %setup -q -c -a 1 # rename source folder -mv %{pecl_name}-%{version} nts +mv %{pecl_name}-%{version} NTS # tests folder from github archive -mv phpredis-%{version}/tests nts/tests +mv phpredis-%{version}/tests NTS/tests -cd nts +cd NTS %patch0 -p1 -b .php56 %patch1 -p1 -b .igbinary @@ -110,7 +114,7 @@ cd .. %if %{with_zts} # duplicate for ZTS build -cp -pr nts zts +cp -pr NTS ZTS %endif # Drop in the bit of configuration @@ -131,7 +135,7 @@ EOF %build -cd nts +cd NTS %{_bindir}/phpize %configure \ --enable-redis \ @@ -141,7 +145,7 @@ cd nts make %{?_smp_mflags} %if %{with_zts} -cd ../zts +cd ../ZTS %{_bindir}/zts-phpize %configure \ --enable-redis \ @@ -156,20 +160,20 @@ make %{?_smp_mflags} rm -rf %{buildroot} # Install the NTS stuff -make -C nts install INSTALL_ROOT=%{buildroot} +make -C NTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} %if %{with_zts} # Install the ZTS stuff -make -C zts install INSTALL_ROOT=%{buildroot} +make -C ZTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif # Install the package XML file install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml -# Test & Documentation -cd nts +# Documentation +cd NTS for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done @@ -190,7 +194,7 @@ done %endif %if %{with_tests} -cd nts/tests +cd NTS/tests # this test requires redis >= 2.6.9 # https://github.com/nicolasff/phpredis/pull/333 @@ -216,7 +220,7 @@ port=6382 %endif sed -e "s/6379/$port/" -i redis.conf sed -e "s/6379/$port/" -i TestRedis.php -%{_sbindir}/redis-server ./redis.conf +%{_bindir}/redis-server ./redis.conf # Run the test Suite ret=0 @@ -227,7 +231,7 @@ ret=0 # Cleanup if [ -f run/redis.pid ]; then - kill $(cat run/redis.pid) + %{_bindir}/redis-cli -p $port shutdown fi exit $ret @@ -253,6 +257,7 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) +%{?_licensedir:%license NTS/COPYING} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -266,8 +271,8 @@ rm -rf %{buildroot} %changelog -* Fri Oct 3 2014 Remi Collet - 2.2.5-4.1 -- test build for segfault with igbinary +* Fri Oct 3 2014 Remi Collet - 2.2.5-5 +- fix segfault with igbinary serializer https://github.com/nicolasff/phpredis/issues/341 * Mon Aug 25 2014 Remi Collet - 2.2.5-4 -- cgit