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.spec172
1 files changed, 80 insertions, 92 deletions
diff --git a/php-pecl-ds.spec b/php-pecl-ds.spec
index 4514ec4..9ff785a 100644
--- a/php-pecl-ds.spec
+++ b/php-pecl-ds.spec
@@ -1,91 +1,67 @@
# remirepo spec file for php-pecl-ds
#
-# Copyright (c) 2016-2019 Remi Collet
-# License: CC-BY-SA
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2016-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
-# we don't want -z defs linker flag
-%undefine _strict_symbol_defs_build
-
%if 0%{?scl:1}
%scl_package php-pecl-ds
-%global sub_prefix %{scl_prefix}
# No phpunit in SCL
-%global with_tests 0
+%bcond_with tests
%else
-%global with_tests 0%{!?_without_tests:1}
+%bcond_without tests
%endif
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name ds
# After json
%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
# For test suite, see https://github.com/php-ds/tests/commits/master
-%global gh_commit 31d238c463ff04b5bc8a6015b19be134175be141
+# version 1.5.1 (version 1.6.0 exist but requires phpunit12, so PHP 8.3)
+%global gh_commit 3d14aa6f8c25d38d79c90924150c51636544e4a8
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner php-ds
%global gh_project tests
Summary: Data Structures for PHP
-Name: %{?sub_prefix}php-pecl-%{pecl_name}
-Version: 1.2.9
+Name: %{?scl_prefix}php-pecl-%{pecl_name}
+Version: 1.6.0
Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: MIT
-URL: http://pecl.php.net/package/%{pecl_name}
-Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+URL: https://pecl.php.net/package/%{pecl_name}
+Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
# Only use for tests during the build, no value to be packaged separately
-# in composer.json: "require-dev": { "php-ds/tests": "dev-master" }
+# in composer.json: "require-dev": { "php-ds/tests": "^1.5.0" }
Source1: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{gh_short}.tar.gz
+BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel >= 7
+BuildRequires: %{?scl_prefix}php-devel >= 7.4
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-gmp
BuildRequires: %{?scl_prefix}php-json
-%if %{with_tests}
-BuildRequires: %{_bindir}/phpunit6
+%if %{with tests}
+BuildRequires: %{_bindir}/phpunit9
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}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
-
-%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-%if "%{php_version}" > "7.1"
-Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.2"
-Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.3"
-Obsoletes: php73u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php73w-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
@@ -97,14 +73,12 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c -a 1
-mv %{pecl_name}-%{version} NTS
mv %{gh_project}-%{gh_commit} tests
# Don't install/register tests, install examples as doc
-%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml}
-
-cd NTS
+sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml
+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
@@ -113,9 +87,9 @@ if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -133,25 +107,26 @@ peclbuild() {
--enable-ds \
--with-php-config=$1
-make %{?_smp_mflags}
+%make_build
}
-cd NTS
-%{_bindir}/phpize
-peclbuild %{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global
+
+cd ../NTS
+peclbuild %{__phpconfig}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-peclbuild %{_bindir}/zts-php-config
+peclbuild %{__ztsphpconfig}
%endif
%install
%{?dtsenable}
-make -C NTS \
- install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# install config file
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -160,59 +135,35 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
-make -C ZTS \
- install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%if 0%{?fedora} < 24 && 0%{?rhel} < 8
-# when pear installed alone, after us
-%triggerin -- %{?scl_prefix}php-pear
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-# posttrans as pear can be installed after us
-%posttrans
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-%postun
-if [ $1 -eq 0 -a -x %{__pecl} ] ; then
- %{pecl_uninstall} %{pecl_name} >/dev/null || :
-fi
-%endif
-
-
%check
-modules="-d extension=json.so"
+[ -f %{php_extdir}/json.so ] && modules="-d extension=json.so"
-cd NTS
: Minimal load test for NTS extension
%{__php} --no-php-ini \
$modules \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%if %{with_zts}
-cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
$modules \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%endif
-cd ..
-%if %{with_tests}
+%if %{with tests}
: Generate autoloader for tests
%{_bindir}/phpab \
--output tests/autoload.php \
@@ -221,15 +172,15 @@ cd ..
: Run upstream test suite
%{_bindir}/php \
-d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- %{_bindir}/phpunit6 \
+ %{_bindir}/phpunit9 \
+ --do-not-cache-result \
--bootstrap tests/autoload.php \
- tests
+ --verbose tests
%endif
%files
-%{?_licensedir:%license NTS/LICENSE}
-%{!?_licensedir:%doc %{pecl_docdir}/%{pecl_name}}
+%license %{sources}/LICENSE
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -242,6 +193,43 @@ cd ..
%changelog
+* Sat May 3 2025 Remi Collet <remi@remirepo.net> - 1.6.0-1
+- update to 1.6.0
+- re-license spec file to CECILL-2.1
+
+* Wed Dec 20 2023 Remi Collet <remi@remirepo.net> - 1.5.0-1
+- update to 1.5.0
+
+* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 1.4.0-3
+- rebuild for PHP 8.3.0RC1
+
+* Wed Jul 12 2023 Remi Collet <remi@remirepo.net> - 1.4.0-2
+- build out of sources tree
+- add upstream patch for PHP 8.3
+
+* Tue Dec 14 2021 Remi Collet <remi@remirepo.net> - 1.4.0-1
+- update to 1.4.0
+- raise dependency on PHP 7.3
+- drop all patches merged upstream
+- switch to phpunit8
+
+* Wed Nov 3 2021 Remi Collet <remi@remirepo.net> - 1.3.0-6
+- add patches for PHP 8.1 from upstream and from
+ https://github.com/php-ds/ext-ds/pull/187
+
+* Fri Mar 26 2021 Remi Collet <remi@remirepo.net> - 1.3.0-4
+- switch to phpunit7
+
+* Tue Nov 3 2020 Remi Collet <remi@remirepo.net> - 1.3.0-2
+- fix segfault using patch from
+ https://github.com/php-ds/ext-ds/pull/165
+
+* Wed Oct 14 2020 Remi Collet <remi@remirepo.net> - 1.3.0-1
+- update to 1.3.0
+
+* Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 1.2.9-2
+- rebuild for 7.4.0RC1
+
* Mon May 13 2019 Remi Collet <remi@remirepo.net> - 1.2.9-1
- update to 1.2.9