summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-01-22 08:25:01 +0100
committerRemi Collet <remi@remirepo.net>2021-01-22 08:25:01 +0100
commitc7f35cbae43a71689e7c6e90562ba2af1bb80bd5 (patch)
treea9f562cb0c903c1ac333c57e1bf03188fccd227d
parent0156868cf50cba11b2646bc50d5313801d0715c0 (diff)
update to 0.10.0
drop patch merged upstream enable apcu serializer with PHP 7+
-rw-r--r--35.patch36
-rw-r--r--PHPINFO5
-rw-r--r--REFLECTION10
-rw-r--r--php-zstd.spec62
4 files changed, 48 insertions, 65 deletions
diff --git a/35.patch b/35.patch
deleted file mode 100644
index b14fd66..0000000
--- a/35.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 729d8401bfba37a3ee558cd051a1a525b5301dbd Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Wed, 30 Sep 2020 12:22:49 +0200
-Subject: [PATCH] relax tests for 8.0.0R1C
-
----
- tests/002_b.phpt | 2 +-
- tests/005_b.phpt | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tests/002_b.phpt b/tests/002_b.phpt
-index ed0172d..8c4c329 100644
---- a/tests/002_b.phpt
-+++ b/tests/002_b.phpt
-@@ -29,7 +29,7 @@ try {
- ===Done===
- --EXPECTF--
- *** Testing zstd_compress() function with Zero arguments ***
--ArgumentCountError: zstd_compress() expects at least 1 parameter, 0 given in %s:%d
-+ArgumentCountError: zstd_compress() expects at least 1 %s, 0 given in %s:%d
- Stack trace:
- #0 %s(%d): zstd_compress()
- #1 {main}
-diff --git a/tests/005_b.phpt b/tests/005_b.phpt
-index afd9d19..dca21eb 100644
---- a/tests/005_b.phpt
-+++ b/tests/005_b.phpt
-@@ -33,7 +33,7 @@ try {
- ===DONE===
- --EXPECTF--
- *** Testing zstd_uncompress() function with Zero arguments ***
--ArgumentCountError: zstd_uncompress() expects exactly 1 parameter, 0 given in %s:%d
-+ArgumentCountError: zstd_uncompress() expects exactly 1 %s, 0 given in %s:%d
- Stack trace:
- #0 %s(%d): zstd_uncompress()
- #1 {main}
diff --git a/PHPINFO b/PHPINFO
index 34f7251..f352b41 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -2,5 +2,6 @@
zstd
Zstd support => enabled
-Extension Version => 0.9.0
-Interface Version => 1.4.5
+Extension Version => 0.10.0
+Interface Version => 1.4.7
+APCu serializer ABI => 0
diff --git a/REFLECTION b/REFLECTION
index 20038ff..90cbb71 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,11 +1,15 @@
-Extension [ <persistent> extension #104 zstd version 0.9.0 ] {
+Extension [ <persistent> extension #109 zstd version 0.10.0 ] {
+
+ - Dependencies {
+ Dependency [ apcu (Optional) ]
+ }
- Constants [5] {
Constant [ int ZSTD_COMPRESS_LEVEL_MIN ] { 1 }
Constant [ int ZSTD_COMPRESS_LEVEL_MAX ] { 22 }
Constant [ int ZSTD_COMPRESS_LEVEL_DEFAULT ] { 3 }
- Constant [ int LIBZSTD_VERSION_NUMBER ] { 10405 }
- Constant [ string LIBZSTD_VERSION_STRING ] { 1.4.5 }
+ Constant [ int LIBZSTD_VERSION_NUMBER ] { 10407 }
+ Constant [ string LIBZSTD_VERSION_STRING ] { 1.4.7 }
}
- Functions {
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 <remi@remirepo.net> - 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 <remi@remirepo.net> - 0.9.0-4
- rebuild for PHP 8.0.0RC1
- add patch from https://github.com/kjdev/php-ext-zstd/pull/35