summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PHPINFO2
-rw-r--r--REFLECTION2
-rw-r--r--php-snappy.spec121
3 files changed, 51 insertions, 74 deletions
diff --git a/PHPINFO b/PHPINFO
index f914998..64a3044 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -2,6 +2,6 @@
snappy
Snappy support => enabled
-Extension Version => 0.2.1
+Extension Version => 0.2.2
Snappy Version => system library
Snappy APCu serializer ABI => 0
diff --git a/REFLECTION b/REFLECTION
index c4a8205..6be5bfd 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #102 snappy version 0.2.1 ] {
+Extension [ <persistent> extension #99 snappy version 0.2.2 ] {
- Dependencies {
Dependency [ apcu (Optional) ]
diff --git a/php-snappy.spec b/php-snappy.spec
index 10322f8..c6088a4 100644
--- a/php-snappy.spec
+++ b/php-snappy.spec
@@ -1,55 +1,41 @@
# remirepo spec file for php-snappy
#
-# Copyright (c) 2016-2021 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2016-2024 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
%scl_package php-snappy
%else
%global pkg_name %{name}
%endif
-# To build with PHP 5.x use --without apcu
%bcond_without apcu
+# To build with PHP 5.x use --without apcu
+%bcond_without tests
-%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8
%bcond_without libsnappy
-%else
-%bcond_with libsnappy
-%endif
-%global gh_commit 8b0feaf75a7e0ea05495172369a94caf7f672f73
+%global gh_commit 5572e61dea3e7facb2e7ec806543f447c99d5165
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner kjdev
%global gh_project php-ext-snappy
-#global gh_date 20160608
%global pecl_name snappy
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global ini_name 40-%{pecl_name}.ini
-
-%if ! 0%{?dtsversion}
-%if 0%{?rhel} == 7
-%global dtsenable source /opt/rh/devtoolset-7/enable
-BuildRequires: devtoolset-7-toolchain
-%endif
-%endif
+%global sources %{gh_project}-%{gh_commit}
+%global _configure ../%{sources}/configure
Summary: Snappy Extension for PHP
-Name: %{?sub_prefix}php-snappy
-Version: 0.2.1
-%if 0%{?gh_date:1}
-Release: 2%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-%else
+Name: %{?scl_prefix}php-snappy
+Version: 0.2.2
Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-%endif
%if %{with libsnappy}
-License: PHP
+License: PHP-3.01
%else
-License: PHP and BSD
+License: PHP-3.01 and BSD-3-Clauise
%endif
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{pkg_name}-%{version}-%{gh_short}.tgz
@@ -58,7 +44,7 @@ Source1: makesrc.sh
BuildRequires: make
%if %{with apcu}
-BuildRequires: %{?scl_prefix}php-devel > 7
+BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pecl-apcu-devel
%else
BuildRequires: %{?scl_prefix}php-devel
@@ -66,24 +52,11 @@ BuildRequires: %{?scl_prefix}php-devel
%if %{with libsnappy}
BuildRequires: snappy-devel
%else
-Provides: bundled(snappy) = 1.1.8
+Provides: bundled(snappy) = 1.2.1
%endif
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
-
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-%{pecl_name} <= %{version}
-%endif
-%endif
%description
@@ -94,9 +67,8 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -qc
-mv %{gh_project}-%{gh_commit} NTS
-cd NTS
+cd %{sources}
%if %{with libsnappy}
# Use the system library
rm -r snappy
@@ -107,15 +79,15 @@ cp -r snappy/COPYING COPYING.snappy
# Sanity check, really often broken
extver=$(sed -n '/#define SNAPPY_EXT_VERSION/{s/.* "//;s/".*$//;p}' php_snappy.h)
-if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
- : Error: Upstream extension version is ${extver}, expecting %{version}%{?gh_date:-dev}.
+if test "x${extver}" != "x%{version}"; then
+ : Error: Upstream extension version is ${extver}, expecting %{version}.
exit 1
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# duplicate for ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Drop in the bit of configuration
@@ -128,28 +100,33 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
+
+cd ../NTS
%configure \
- --with-php-config=%{_bindir}/php-config \
+ --with-php-config=%{__phpconfig} \
%if %{with libsnappy}
--with-snappy-includedir=/usr \
%endif
--with-libdir=%{_lib} \
--enable-snappy
-make %{?_smp_mflags}
+
+%make_build
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
- --with-php-config=%{_bindir}/zts-php-config \
+ --with-php-config=%{__ztsphpconfig} \
%if %{with libsnappy}
--with-snappy-includedir=/usr \
%endif
--with-libdir=%{_lib} \
--enable-snappy
-make %{?_smp_mflags}
+
+%make_build
%endif
@@ -157,19 +134,20 @@ make %{?_smp_mflags}
%{?dtsenable}
# Install the NTS stuff
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
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_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
%check
-cd NTS
+cd %{sources}
+
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
@@ -185,37 +163,29 @@ cd NTS
--ri apcu | grep '%{pecl_name}'
%endif
+%if %{with tests}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php --show-diff || : ignore
+%{__php} -n run-tests.php -q --show-diff || : ignore
+%endif
%if %{with_zts}
-cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
-
-: Upstream test suite for ZTS extension
-TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
-REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php --show-diff
%endif
%files
-%{!?_licensedir:%global license %%doc}
-%license NTS/LICENSE
+%license %{sources}/LICENSE
%if ! %{with libsnappy}
-%license NTS/COPYING.snappy
+%license %{sources}/COPYING.snappy
%endif
-%doc NTS/CREDITS
-%doc NTS/README.md
+%doc %{sources}/CREDITS
+%doc %{sources}/README.md
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
@@ -227,8 +197,15 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Fri Nov 8 2024 Remi Collet <remi@remirepo.net> - 0.2.2-1
+- update to 0.2.2 (no change)
+- update bundled libsnappy to 1.2.1
+
+* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 0.2.1-2
+- build out of sources tree
+
* Fri Jan 15 2021 Remi Collet <remi@remirepo.net> - 0.2.1-1
-- update to 0.2.0
+- update to 0.2.1
* Wed Sep 30 2020 Remi Collet <remi@remirepo.net> - 0.2.0-2
- rebuild for PHP 8.0.0RC1