From c7f35cbae43a71689e7c6e90562ba2af1bb80bd5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 22 Jan 2021 08:25:01 +0100 Subject: update to 0.10.0 drop patch merged upstream enable apcu serializer with PHP 7+ --- php-zstd.spec | 62 ++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 24 deletions(-) (limited to 'php-zstd.spec') diff --git a/php-zstd.spec b/php-zstd.spec index b770ef2..71e9420 100644 --- a/php-zstd.spec +++ b/php-zstd.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-zstd # -# Copyright (c) 2018-2020 Remi Collet +# Copyright (c) 2018-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -17,12 +17,15 @@ %global pkg_name %{name} %endif -%if 0%{?fedora} >= 31 -%global with_libzstd 1 +# To build with PHP 5.x use --without apcu +%bcond_without apcu + +%if 0%{?fedora} >= 31 || 0%{?rhel} >= 7 +%bcond_without libzstd %else -%global with_libzstd 0 +%bcond_with libzstd %endif -%global zstdver 1.4.5 +%global zstdver 1.4.8 %global pecl_name zstd %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} @@ -31,9 +34,9 @@ Summary: Zstandard extension Name: %{?sub_prefix}php-%{pecl_name} -Version: 0.9.0 -Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -%if %{?with_libzstd} +Version: 0.10.0 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +%if %{with libzstd} License: MIT %else # bundled library is BSD @@ -42,13 +45,16 @@ License: MIT and BSD URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz -Patch0: https://patch-diff.githubusercontent.com/raw/kjdev/php-ext-zstd/pull/35.patch - BuildRequires: %{?dtsprefix}gcc +%if %{with apcu} +BuildRequires: %{?scl_prefix}php-devel > 7 +BuildRequires: %{?scl_prefix}php-pecl-apcu-devel +%else BuildRequires: %{?scl_prefix}php-devel +%endif BuildRequires: %{?scl_prefix}php-pear -%if %{?with_libzstd} -BuildRequires: libzstd-devel >= %{zstdver} +%if %{with libzstd} +BuildRequires: libzstd-devel >= 1.4 Requires: libzstd%{?_isa} >= %{buildver} %else Provides: bundled(libzstd) = %{zstdver} @@ -78,12 +84,6 @@ Obsoletes: php80-pecl-%{pecl_name} <= %{version} %endif %endif -%if 0%{?fedora} < 20 && 0%{?rhel} < 7 -# Filter shared private -%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} -%{?filter_setup} -%endif - %description PHP extension for compression and decompression with Zstandard library. @@ -109,11 +109,10 @@ mv %{pecl_name}-%{version} NTS %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} cd NTS -%patch0 -p1 -b .pr cp zstd/LICENSE LICENSE-libzstd -%if %{?with_libzstd} +%if %{with libzstd} # Use the system library rm -r zstd sed -e '\:"zstd/:d' -i ../package.xml @@ -146,7 +145,7 @@ cd NTS %{_bindir}/phpize %configure \ --with-php-config=%{_bindir}/php-config \ -%if %{?with_libzstd} +%if %{with libzstd} --with-libzstd \ %endif --with-libdir=%{_lib} \ @@ -158,7 +157,7 @@ cd ../ZTS %{_bindir}/zts-phpize %configure \ --with-php-config=%{_bindir}/zts-php-config \ -%if %{?with_libzstd} +%if %{with libzstd} --with-libzstd \ %endif --with-libdir=%{_lib} \ @@ -195,7 +194,7 @@ done %check export REPORT_EXIT_STATUS=1 -%if %{?with_libzstd} +%if %{with libzstd} ver=$(pkg-config libzstd --modversion) if [ "$ver" != "%{zstdver}" ] ; then export REPORT_EXIT_STATUS=0 @@ -208,6 +207,16 @@ cd NTS --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' +%if "%{php_version}" > "7.0" +: Check that apcu is aware of zstd serializer +%{__php} --no-php-ini \ + --define extension=apcu.so \ + --define apc.enabled=1 \ + --define apc.enable_cli=1 \ + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ + --ri apcu | grep '%{pecl_name}' +%endif + : Upstream test suite for NTS extension TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ @@ -231,7 +240,7 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %{?_licensedir:%license NTS/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml -%if ! %{?with_libzstd} +%if ! %{with libzstd} %{?_licensedir:%license NTS/LICENSE-libzstd} %endif @@ -254,6 +263,11 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %changelog +* Fri Jan 22 2021 Remi Collet - 0.10.0-1 +- update to 0.10.0 +- drop patch merged upstream +- enable apcu serializer with PHP 7+ + * Wed Sep 30 2020 Remi Collet - 0.9.0-4 - rebuild for PHP 8.0.0RC1 - add patch from https://github.com/kjdev/php-ext-zstd/pull/35 -- cgit