summaryrefslogtreecommitdiffstats
path: root/php-pecl-decimal.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-09-29 08:33:05 +0200
committerRemi Collet <remi@php.net>2025-09-29 08:33:05 +0200
commita6a14575a84d3571aa4f7ebb5fbbcda6143c69a8 (patch)
tree4300f52bfa9da01c70a7d35a3a3024858d5f03ca /php-pecl-decimal.spec
parent80e34c964095c04da3c805536bcba566e2d341b8 (diff)
fix test suite for PHP 8.5.0RC1 using patch fromv1
https://github.com/php-decimal/ext-decimal/pull/89
Diffstat (limited to 'php-pecl-decimal.spec')
-rw-r--r--php-pecl-decimal.spec70
1 files changed, 30 insertions, 40 deletions
diff --git a/php-pecl-decimal.spec b/php-pecl-decimal.spec
index a838db2..27d09da 100644
--- a/php-pecl-decimal.spec
+++ b/php-pecl-decimal.spec
@@ -1,8 +1,8 @@
# remirepo spec file for php-pecl-decimal
#
-# Copyright (c) 2018-2024 Remi Collet
-# License: CC-BY-SA-4.0
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2018-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
@@ -13,6 +13,8 @@
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name decimal
+%global pie_vend php-decimal
+%global pie_proj ext-decimal
# After 20-json.ini
%global ini_name 40-%{pecl_name}.ini
%global sources %{pecl_name}-%{version}
@@ -21,11 +23,13 @@
Summary: Arbitrary-precision floating-point decimal
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 1.5.0
-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;')}}
License: MIT
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{sources}.tgz
+Patch0: 0001-Silent-unexpected-NAN-value-was-coerced-to-string-wa.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
@@ -36,17 +40,21 @@ BuildRequires: mpdecimal-devel >= 2.4
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}
+# Extension
+Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
+Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
+# PECL
+Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+# PIE
+Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version}
+Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version}
%description
Adds support for correctly-rounded arbitrary precision decimal floating point
-arithmetic in PHP 7.
+arithmetic in PHP.
Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.
@@ -55,10 +63,12 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%setup -q -c
sed -e 's/role="test"/role="src"/' \
- %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -e '/LICENSE/s/role="doc"/role="src"/' \
-i package.xml
cd %{sources}
+%patch -P0 -p1
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_DECIMAL_VERSION/{s/.* "//;s/".*$//;p}' php_decimal.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
@@ -125,26 +135,6 @@ 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
cd %{sources}
OPT="-n"
@@ -168,19 +158,11 @@ REPORT_EXIT_STATUS=1 \
%{__ztsphp} $OPT \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
-
-%if %{with tests}
-: Upstream test suite for ZTS extension
-TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="$OPT -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
-REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php -q --show-diff
-%endif
%endif
%files
-%{?_licensedir:%license %{sources}/LICENSE}
+%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -194,6 +176,14 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Mon Sep 29 2025 Remi Collet <remi@remirepo.net> - 1.5.0-3
+- fix test suite for PHP 8.5.0RC1 using patch from
+ https://github.com/php-decimal/ext-decimal/pull/89
+
+* Fri Sep 26 2025 Remi Collet <remi@remirepo.net> - 1.5.0-2
+- re-license spec file to CECILL-2.1
+- add pie virtual provides (php-decimal/ext-decimal)
+
* Sat Jan 20 2024 Remi Collet <remi@remirepo.net> - 1.5.0-1
- update to 1.5.0
- build out of sources tree