From fcb9259ce4b7f2b7d5bc3ecd32edd18dcd09afc4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 14 Apr 2017 09:41:39 +0200 Subject: switch the specs --- php-pecl-memcached.spec | 155 ++++++++++++++++++++++++++++-------------------- 1 file changed, 91 insertions(+), 64 deletions(-) (limited to 'php-pecl-memcached.spec') diff --git a/php-pecl-memcached.spec b/php-pecl-memcached.spec index d36f1e8..7c235bc 100644 --- a/php-pecl-memcached.spec +++ b/php-pecl-memcached.spec @@ -10,49 +10,36 @@ # Please, preserve the changelog entries # %if 0%{?scl:1} -%if "%{scl}" == "rh-php56" -%global sub_prefix more-php56- -%else %global sub_prefix %{scl_prefix} -%endif %scl_package php-pecl-memcached %else %global _root_prefix %{_prefix} %endif %global with_fastlz 1 -%global with_zts 0%{?__ztsphp:1} -%global with_tests %{?_with_tests:1}%{!?_with_tests:0} +%global with_igbin 1 +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global with_tests 0%{!?_without_tests:1} %global pecl_name memcached -#global prever RC1 -#global intver rc1 -%if "%{php_version}" < "5.6" -# After igbinary, json, msgpack -%global ini_name z-%{pecl_name}.ini -%else # After 40-igbinary, 40-json, 40-msgpack -%global ini_name 50-%{pecl_name}.ini -%endif +%global ini_name 50-%{pecl_name}.ini Summary: Extension to work with the Memcached caching daemon Name: %{?sub_prefix}php-pecl-memcached -Version: 2.2.0 -Release: 9%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 3.0.3 +Release: 1%{?dist}%{!?scl:%{!?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}%{?prever}.tgz - -# https://github.com/php-memcached-dev/php-memcached/pull/151 -Patch0: %{pecl_name}-fastlz.patch +Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -# 5.2.10 required to HAVE_JSON enabled -BuildRequires: %{?scl_prefix}php-devel >= 5.2.10 +BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json +%if %{with_igbin} BuildRequires: %{?sub_prefix}php-pecl-igbinary-devel +%endif %ifnarch ppc64 BuildRequires: %{?sub_prefix}php-pecl-msgpack-devel %endif @@ -65,32 +52,16 @@ BuildRequires: fastlz-devel BuildRequires: memcached %endif -%if 0%{?scl:1} && 0%{?fedora} < 15 && 0%{?rhel} < 7 && "%{?scl_vendor}" != "remi" -# Filter in the SCL collection -%{?filter_requires_in: %filter_requires_in %{_libdir}/.*\.so} -# libvent from SCL as not available in system -BuildRequires: %{?sub_prefix}libevent-devel > 2 -Requires: %{?sub_prefix}libevent%{_isa} > 2 -BuildRequires: %{?sub_prefix}libmemcached-devel > 1 -Requires: %{?sub_prefix}libmemcached-libs%{_isa} > 1 -%if %{with_fastlz} -Requires: fastlz%{_isa} -%endif -Requires: cyrus-sasl-lib%{_isa} -%else BuildRequires: libevent-devel >= 2.0.2 -%if 0%{?rhel} == 5 -BuildRequires: libmemcached-devel > 1 -%else # To ensure use of libmemcached-last for --enable-memcached-protocol BuildRequires: libmemcached-devel >= 1.0.16 -%endif -%endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-json%{?_isa} +%if %{with_igbin} Requires: %{?sub_prefix}php-pecl-igbinary%{?_isa} +%endif %ifnarch ppc64 Requires: %{?sub_prefix}php-pecl-msgpack%{?_isa} %endif @@ -123,6 +94,10 @@ Obsoletes: php56w-pecl-%{pecl_name} <= %{version} Obsoletes: php70u-pecl-%{pecl_name} <= %{version} Obsoletes: php70w-pecl-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "7.1" +Obsoletes: php71u-pecl-%{pecl_name} <= %{version} +Obsoletes: php71w-pecl-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -147,8 +122,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -c -q - -mv %{pecl_name}-%{version}%{?prever} NTS +mv %{pecl_name}-%{version} NTS # Don't install/register tests sed -e 's/role="test"/role="src"/' \ @@ -156,17 +130,16 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .fastlz %if %{with_fastlz} rm -r fastlz -sed -e '/name="fastlz/d' -i ../package.xml +sed -e '/name=.fastlz/d' -i ../package.xml %endif # Check version as upstream often forget to update this extver=$(sed -n '/#define PHP_MEMCACHED_VERSION/{s/.* "//;s/".*$//;p}' php_memcached.h) -if test "x${extver}" != "x%{version}%{?intver}"; then - : Error: Upstream HTTP version is now ${extver}, expecting %{version}%{?prever}. +if test "x${extver}" != "x%{version}%{?gh_date:-dev}%{?intver}"; then + : Error: Upstream HTTP version is now ${extver}, expecting %{version}%{?prever}%{?gh_date:-dev}. : Update the pdover macro and rebuild. exit 1 fi @@ -201,17 +174,22 @@ cp -r NTS ZTS %build +%{?dtsenable} + # only needed for SCL export PKG_CONFIG_PATH=%{_libdir}/pkgconfig peclconf() { -%configure --enable-memcached-igbinary \ +%configure \ +%if %{with_igbin} + --enable-memcached-igbinary \ +%endif --enable-memcached-json \ --enable-memcached-sasl \ %ifnarch ppc64 --enable-memcached-msgpack \ %endif -%if 0%{?rhel} == 5 +%if 0 --disable-memcached-protocol \ %else --enable-memcached-protocol \ @@ -235,6 +213,8 @@ make %{?_smp_mflags} %install +%{?dtsenable} + # Install the NTS extension make install -C NTS INSTALL_ROOT=%{buildroot} @@ -258,10 +238,6 @@ do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done -%clean -rm -rf %{buildroot} - - %if 0%{?fedora} < 24 # when pear installed alone, after us %triggerin -- %{?scl_prefix}php-pear @@ -301,10 +277,15 @@ OPT="-n" %endif %if %{with_tests} +# XFAIL and very slow so no value +rm ?TS/tests/expire.phpt + ret=0 : Launch the Memcached service -memcached -p 11211 -U 11211 -d -P $PWD/memcached.pid +port=$(%{__php} -r 'echo 10000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE;') +memcached -p $port -U $port -d -P $PWD/memcached.pid +sed -e "s/11211/$port/" -i ?TS/tests/* : Run the upstream test Suite for NTS extension pushd NTS @@ -313,7 +294,7 @@ TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__php} -n run-tests.php || ret=1 +%{__php} -n run-tests.php --show-diff || ret=1 popd %if %{with_zts} @@ -324,7 +305,7 @@ TEST_PHP_EXECUTABLE=%{__ztsphp} \ TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php || ret=1 +%{__ztsphp} -n run-tests.php --show-diff || ret=1 popd %endif @@ -338,7 +319,6 @@ exit $ret %files -%defattr(-,root,root,-) %{?_licensedir:%license NTS/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -353,15 +333,62 @@ exit $ret %changelog -* Tue Apr 12 2016 Remi Collet - 2.2.0-9 -- fix dependencies for more-php5* +* Mon Feb 20 2017 Remi Collet - 3.0.3-1 +- update to 3.0.3 (php 7, stable) +- build with --enable-memcached-protocol option + +* Mon Feb 13 2017 Remi Collet - 3.0.2-1 +- update to 3.0.2 (php 7, stable) + +* Thu Feb 9 2017 Remi Collet - 3.0.1-3 +- test build for https://github.com/php-memcached-dev/php-memcached/pull/320 + +* Thu Feb 9 2017 Remi Collet - 3.0.1-2 +- switch to pecl sources +- enable test suite +- open https://github.com/php-memcached-dev/php-memcached/pull/319 + fix test suite for 32bits build + +* Tue Feb 7 2017 Remi Collet - 3.0.1-1 +- update to 3.0.1 (php 7, stable) + +* Fri Dec 9 2016 Remi Collet - 3.0.0-0.4.20161207gite65be32 +- refresh to more recent snapshot + +* Thu Dec 1 2016 Remi Collet - 3.0.0-0.3.20160217git6ace07d +- rebuild with PHP 7.1.0 GA + +* Wed Sep 14 2016 Remi Collet - 3.0.0-0.2.20160217git6ace07d +- rebuild for PHP 7.1 new API version + +* Thu Mar 3 2016 Remi Collet - 3.0.0-0.1.20160217git6ace07d +- update to 3.0.0-dev +- switch back to php-memcached-dev sources + +* Wed Mar 2 2016 Remi Collet - 2.2.1-0.2.20150628git3c79a97 +- add patch for igbinary, see + https://github.com/rlerdorf/php-memcached/pull/3 + +* Sun Jan 10 2016 Remi Collet - 2.2.1-0.1.20150628git3c79a97 +- bump version to 2.2.1-dev, stability=devel + +* Tue Oct 13 2015 Remi Collet - 2.2.0-11.20150628git3c79a97 +- rebuild for PHP 7.0.0RC5 new API version + +* Fri Sep 18 2015 Remi Collet - 2.2.0-10.20150628git3c79a97 +- F23 rebuild with rh_layout + +* Wed Jul 22 2015 Remi Collet - 2.2.0-9.20150628git3c79a97 +- rebuild against php 7.0.0beta2 -* Wed Mar 9 2016 Remi Collet - 2.2.0-8 -- adapt for F24 +* Wed Jul 8 2015 Remi Collet - 2.2.0-8.20150628git3c79a97 +- new snapshot -* Wed Aug 12 2015 Remi Collet - 2.2.0-7 -- add explicit dependency on fastlz for SCL on - https://www.softwarecollections.org/ +* Sat Jun 27 2015 Remi Collet - 2.2.0-7.20150423git4187e22 +- switch sources from pecl to github +- temporarily use rlerdorf fork (php7 compatibility) +- disable igbinary +- open https://github.com/rlerdorf/php-memcached/pull/2 - msgpack * Tue Jun 23 2015 Remi Collet - 2.2.0-6 - allow build against rh-php56 (as more-php56) -- cgit