summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apcu-php83.patch15
-rw-r--r--apcu-tests.patch49
-rw-r--r--php-pecl-apcu.spec84
3 files changed, 106 insertions, 42 deletions
diff --git a/apcu-php83.patch b/apcu-php83.patch
new file mode 100644
index 0000000..b085b91
--- /dev/null
+++ b/apcu-php83.patch
@@ -0,0 +1,15 @@
+diff --git a/tests/typed_prop.phpt b/tests/typed_prop.phpt
+index 80f0d3c..04e87c9 100644
+--- a/tests/typed_prop.phpt
++++ b/tests/typed_prop.phpt
+@@ -28,8 +28,8 @@ try {
+ var_dump($test->array);
+
+ ?>
+---EXPECT--
++--EXPECTF--
+ bool(true)
+-Cannot assign bool to reference held by property Test::$array of type array
++Cannot assign %s to reference held by property Test::$array of type array
+ array(0) {
+ }
diff --git a/apcu-tests.patch b/apcu-tests.patch
new file mode 100644
index 0000000..692dbad
--- /dev/null
+++ b/apcu-tests.patch
@@ -0,0 +1,49 @@
+From 22a39fe4cb2db46aaf660ef2f724b4cd813d2481 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 6 Jun 2023 11:08:10 +0200
+Subject: [PATCH] use TEST_PHP_ARGS if set
+
+---
+ tests/server_test.inc | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/tests/server_test.inc b/tests/server_test.inc
+index 88c7045..5e60f47 100644
+--- a/tests/server_test.inc
++++ b/tests/server_test.inc
+@@ -16,6 +16,7 @@ function server_start_one($host, $port, $code = 'echo "Hello world";', $php_opts
+ global $doc_root, $router, $handles, $ports;
+
+ $php_executable = getenv('TEST_PHP_EXECUTABLE');
++ $php_args = getenv('TEST_PHP_ARGS');
+
+ $descriptorspec = array(
+ 0 => STDIN,
+@@ -23,16 +24,18 @@ function server_start_one($host, $port, $code = 'echo "Hello world";', $php_opts
+ 2 => STDERR,
+ );
+
+- $ext = (substr(PHP_OS, 0, 3) == 'WIN') ? 'php_apcu.dll' : 'apcu.so';
+- if (substr(PHP_OS, 0, 3) == 'WIN') {
+- $part0 = 8 == PHP_INT_SIZE ? "x64" : "";
+- $part1 = ZEND_DEBUG_BUILD ? "Debug" : "Release";
+- $part1 = PHP_ZTS ? ($part1 . "_TS") : $part1;
+- $php_args = "-d extension_dir=$doc_root/../$part0/$part1";
+- } else {
+- $php_args = "-d extension_dir=$doc_root/../modules";
++ if (!$php_args) {
++ $ext = (substr(PHP_OS, 0, 3) == 'WIN') ? 'php_apcu.dll' : 'apcu.so';
++ if (substr(PHP_OS, 0, 3) == 'WIN') {
++ $part0 = 8 == PHP_INT_SIZE ? "x64" : "";
++ $part1 = ZEND_DEBUG_BUILD ? "Debug" : "Release";
++ $part1 = PHP_ZTS ? ($part1 . "_TS") : $part1;
++ $php_args = "-d extension_dir=$doc_root/../$part0/$part1";
++ } else {
++ $php_args = "-d extension_dir=$doc_root/../modules";
++ }
++ $php_args = "$php_args -d extension=$ext";
+ }
+- $php_args = "$php_args -d extension=$ext";
+
+ if ($php_opts) {
+ $php_args = "$php_args -d " . implode(' -d ', $php_opts);;
diff --git a/php-pecl-apcu.spec b/php-pecl-apcu.spec
index 2564130..4a0b799 100644
--- a/php-pecl-apcu.spec
+++ b/php-pecl-apcu.spec
@@ -3,8 +3,8 @@
#
# Fedora spec file for php-pecl-apcu
#
-# Copyright (c) 2013-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2013-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
@@ -13,9 +13,7 @@
# we don't want -z defs linker flag
%undefine _strict_symbol_defs_build
-%if 0%{?scl:1}
-%scl_package php-pecl-apcu
-%endif
+%{?scl:%scl_package php-pecl-apcu}
%bcond_without tests
@@ -23,27 +21,26 @@
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner krakjoe
%global gh_project apcu
-#global gh_date 20161018
%global pecl_name apcu
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Name: %{?scl_prefix}php-pecl-apcu
Summary: APC User Cache
Version: 5.1.22
-License: PHP
+License: PHP-3.01
URL: https://pecl.php.net/package/APCu
-%if 0%{?gh_date:1}
-Release: 0.9.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
-%else
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
-%endif
Source1: %{pecl_name}-5.1.19.ini
Source2: %{pecl_name}-panel.conf
Source3: %{pecl_name}.conf.php
+Patch0: %{pecl_name}-php83.patch
+Patch1: %{pecl_name}-tests.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
@@ -51,7 +48,6 @@ BuildRequires: %{?scl_prefix}php-pear
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Obsoletes: %{?scl_prefix}php-apcu < 4.0.0-1
Provides: %{?scl_prefix}php-apcu = %{version}
@@ -134,33 +130,29 @@ configuration, available on http://localhost/apcu-panel/
%prep
%setup -qc
-%if 0%{?gh_date:1}
-mv %{gh_project}-%{gh_commit} NTS
-mv NTS/package.xml .
-%else
-mv %{pecl_name}-%{version} NTS
-%endif
-
%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml}
-cd NTS
+cd %{sources}
+%patch -P0 -p1 -b.php83
+%patch -P1 -p1 -b.pr490
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_APCU_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h)
-if test "x${extver}" != "x%{version}%{?prever}%{?gh_date:-dev}"; then
- : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever}%{?gh_date:-dev}.
+if test "x${extver}" != "x%{version}%{?prever}"; then
+ : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever}.
exit 1
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# duplicate for ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
%if 0%{!?scl:1}
# Fix path to configuration file
sed -e s:apc.conf.php:%{_sysconfdir}/apcu-panel/conf.php:g \
- -i NTS/apc.php
+ -i %{sources}/apc.php
%else
# Provide the control panel as doc
sed -e '/"apc.php"/s/role="src"/role="doc"/' -i package.xml
@@ -169,19 +161,20 @@ sed -e '/"apc.php"/s/role="src"/role="doc"/' -i package.xml
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--enable-apcu \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--enable-apcu \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -205,7 +198,7 @@ install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if 0%{!?scl:1}
# Install the Control Panel
# Pages
-install -D -m 644 -p NTS/apc.php \
+install -D -m 644 -p %{sources}/apc.php \
%{buildroot}%{_datadir}/apcu-panel/index.php
# Apache config
install -D -m 644 -p %{SOURCE2} \
@@ -217,7 +210,7 @@ install -D -m 644 -p %{SOURCE3} \
# Test & Documentation
-cd NTS
+cd %{sources}
for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do [ -f $i ] && install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
[ -f tests/$i ] && install -Dpm 644 tests/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/tests/$i
@@ -228,22 +221,21 @@ done
%check
-cd NTS
+cd %{sources}
+
%{_bindir}/php -n \
-d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
-m | grep 'apcu'
%if %{with tests}
# Upstream test suite for NTS extension
-TEST_PHP_EXECUTABLE=%{_bindir}/php \
+TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{_bindir}/php -n run-tests.php --show-diff
+%{__php} -n run-tests.php -q --show-diff
%endif
%if %{with_zts}
-cd ../ZTS
%{__ztsphp} -n \
-d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
-m | grep 'apcu'
@@ -252,9 +244,8 @@ cd ../ZTS
# 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
+%{__ztsphp} -n run-tests.php -q --show-diff
%endif
%endif
@@ -280,7 +271,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -313,6 +304,15 @@ fi
%changelog
+* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 5.1.22-3
+- rebuild for PHP 8.3.0RC1
+
+* Tue Jun 6 2023 Remi Collet <remi@remirepo.net> - 5.1.22-2
+- build out of sources tree
+- add upstream patch for 8.3
+- add patch for tests when build out of sources tree from
+ https://github.com/krakjoe/apcu/pull/490
+
* Mon Sep 19 2022 Remi Collet <remi@remirepo.net> - 5.1.22-1
- update to 5.1.22