summaryrefslogtreecommitdiffstats
path: root/php-pecl-ds.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-ds.spec')
-rw-r--r--php-pecl-ds.spec136
1 files changed, 36 insertions, 100 deletions
diff --git a/php-pecl-ds.spec b/php-pecl-ds.spec
index af4f4b1..7fb76e5 100644
--- a/php-pecl-ds.spec
+++ b/php-pecl-ds.spec
@@ -1,4 +1,4 @@
-# remirepo spec file for php-pecl-ds
+# remirepo spec file for php-pecl-ds2
#
# SPDX-FileCopyrightText: Copyright 2016-2026 Remi Collet
# SPDX-License-Identifier: CECILL-2.1
@@ -7,69 +7,49 @@
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%scl_package php-pecl-ds
-# No phpunit in SCL
-%bcond_with tests
-%else
+%{?scl:%scl_package php-pecl-ds2}
+
%bcond_without tests
-%endif
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name ds
%global pie_vend php-ds
%global pie_proj ext-ds
-# After json
%global ini_name 40-%{pecl_name}.ini
-%global sources %{gh_proj}-%{version}
-%global _configure ../%{sources}/configure
-
+%global _configure ../configure
# Github forge
-%global gh_vend php-ds
-%global gh_proj ext-ds
-%global forgeurl0 https://github.com/%{gh_vend}/%{gh_proj}
-%global tag0 v%{version}
+%global gh_vend %{pie_vend}
+%global gh_proj %{pie_proj}
+%global forgeurl https://github.com/%{gh_vend}/%{gh_proj}
+%global tag v%{version}
# for EL-8 to avoid TAG usage
-%global archivename0 %{gh_proj}-%{version}
-
-# For test suite, see https://github.com/php-ds/tests/tags
-%global forgeurl1 https://github.com/%{gh_vend}/tests
-%global tag1 v1.8.0
-%global archivename1 tests-1.8.0
+%global archivename %{gh_proj}-%{version}
Summary: Data Structures for PHP
-Name: %{?scl_prefix}php-pecl-%{pecl_name}
+Name: %{?scl_prefix}php-pecl-%{pecl_name}2
License: MIT
-Version: 1.8.0
+Version: 2.0.0
Release: 1%{?dist}
-%if 0%{?rhel} == 8
-URL: %{forgeurl0}
-Source0: %{forgeurl0}/archive/v%{tag0}/%{archivename0}.tar.gz
-Source1: %{forgeurl1}/archive/v%{tag1}/%{archivename1}.tar.gz
-%else
-%forgemeta -a
+%forgemeta
URL: %{forgeurl}
-Source0: %{forgesource0}
-Source1: %{forgesource1}
-%endif
+Source0: %{forgesource}
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 8.2
-BuildRequires: %{?scl_prefix}php-gmp
-BuildRequires: %{?scl_prefix}php-json
-%if %{with tests}
-BuildRequires: %{_bindir}/phpunit11
-BuildRequires: %{_bindir}/phpab
-%endif
-#BuildRequires: php-debuginfo
-#BuildRequires: gdb
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-Requires: %{?scl_prefix}php-json%{?_isa}
+
+%if 0%{?fedora} >= 45 || 0%{?rhel} >= 11 || "%{php_version}" > "8.6"
+Obsoletes: %{?scl_prefix}php-pecl-%{pecl_name} < 2
+Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
+%else
+# A single version can be installed
+Conflicts: %{?scl_prefix}php-pecl-%{pecl_name} < 2
+%endif
# Extension
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
@@ -90,22 +70,16 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
-%setup -q -c -a 1
-mv %{archivename1} tests
+%forgesetup
-cd %{sources}
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_DS_VERSION/{s/.* "//;s/".*$//;p}' php_ds.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}%{?prever:-%{prever}}.
exit 1
fi
-cd ..
mkdir NTS
-%if %{with_zts}
-mkdir ZTS
-%endif
# Create configuration file
cat << 'EOF' | tee %{ini_name}
@@ -125,18 +99,12 @@ peclbuild() {
%make_build
}
-cd %{sources}
%{__phpize}
sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global
-cd ../NTS
+cd NTS
peclbuild %{__phpconfig}
-%if %{with_zts}
-cd ../ZTS
-peclbuild %{__ztsphpconfig}
-%endif
-
%install
%{?dtsenable}
@@ -146,68 +114,36 @@ peclbuild %{__ztsphpconfig}
# install config file
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
-%if %{with_zts}
-%make_install -C ZTS
-
-install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
-%endif
-
%check
-[ -f %{php_extdir}/json.so ] && modules="-d extension=json.so"
-
: Minimal load test for NTS extension
%{__php} --no-php-ini \
- $modules \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
-%if %{with_zts}
-: Minimal load test for ZTS extension
-%{__ztsphp} --no-php-ini \
- $modules \
- --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
- --modules | grep '^%{pecl_name}$'
-%endif
-
%if %{with tests}
-# This file is not a test file
-mv tests/tests/CollectionTest.php tests/tests/Collection.php
-
-: Generate autoloader for tests
-%{_bindir}/phpab \
- --output tests/autoload.php \
- tests
-
-: Run upstream test suite
-%{_bindir}/php \
- -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- %{_bindir}/phpunit11 \
- --do-not-cache-result \
- --bootstrap tests/autoload.php \
- tests
+: Upstream test suite for NTS extension
+TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
+%{__php} -n run-tests.php -q --show-diff %{?_smp_mflags}
%endif
%files
-%license %{sources}/LICENSE
-%doc %{sources}/composer.json
-%doc %{sources}/*.md
+%license LICENSE
+%doc composer.json
+%doc *.md
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
-%if %{with_zts}
-%config(noreplace) %{php_ztsinidir}/%{ini_name}
-%{php_ztsextdir}/%{pecl_name}.so
-%endif
-
%changelog
-* Tue Apr 14 2026 Remi Collet <remi@remirepo.net> - 1.8.0-1
-- update to 1.8.0
-- raise dependency on PHP 8.2
-- switch to phpunit11
+* Tue Apr 14 2026 Remi Collet <remi@remirepo.net> - 2.0.0-1
+- update to 2.0.0
+- rename to php-pecl-ds2
+- run standard php test suite from extension sources
+ instead of separate tests using phpunit
+- drop ZTS build
* Fri Mar 13 2026 Remi Collet <remi@remirepo.net> - 1.6.0-4
- drop pear/pecl dependency