# remirepo spec file for php-pecl-decimal # # SPDX-FileCopyrightText: Copyright 2018-2026 Remi Collet # SPDX-License-Identifier: CECILL-2.1 # http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # %{?scl:%scl_package php-pecl-decimal} %bcond_without tests %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name decimal %global pie_vend php-%{pecl_name} %global pie_proj ext-%{pecl_name} %global ini_name 40-%{pecl_name}.ini %global _configure ../configure # Github forge %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 archivename %{gh_proj}-%{version} Name: %{?scl_prefix}php-pecl-%{pecl_name} Summary: Arbitrary-precision floating-point decimal License: MIT Version: 2.0.1 Release: 1%{?dist} %forgemeta URL: %{forgeurl} Source0: %{forgesource} BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 8.2 BuildRequires: mpdecimal-devel >= 2.4 Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} # 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. Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. %prep %forgesetup # 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 : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever:-%{prever}}. exit 1 fi mkdir NTS %if %{with_zts} mkdir ZTS %endif # Create configuration file cat << 'EOF' | tee %{ini_name} ; Enable %{pecl_name} extension module extension=%{pecl_name}.so EOF %build %{?dtsenable} %{__phpize} sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global cd NTS %configure \ --with-decimal \ --with-libdir=%{_lib} \ --with-php-config=%{__phpconfig} %make_build %if %{with_zts} cd ../ZTS %configure \ --with-decimal \ --with-libdir=%{_lib} \ --with-php-config=%{__ztsphpconfig} %make_build %endif %install %{?dtsenable} %make_install -C NTS # 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 : Minimal load test for NTS extension %{__php} -n \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' %if %{with 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 %if %{with_zts} : Minimal load test for ZTS extension %{__ztsphp} -n \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' %endif %files %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 * Sun Apr 12 2026 Remi Collet - 2.0.1-1 - update to 2.0.1 - drop support for PHP < 8.2 * Sun Apr 12 2026 Remi Collet - 1.5.3-1 - update to 1.5.3 * Sat Apr 11 2026 Remi Collet - 1.5.1-1 - update to 1.5.1 - drop pear/pecl dependency - sources from github - open https://github.com/php-decimal/ext-decimal/issues/91 is not compatible with PHP 7.x * Mon Sep 29 2025 Remi Collet - 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 - 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 - 1.5.0-1 - update to 1.5.0 - build out of sources tree * Thu Sep 9 2021 Remi Collet - 1.4.0-2 - ignore 1 test for 8.1 * Thu Feb 18 2021 Remi Collet - 1.4.0-1 - update to 1.4.0 * Wed Aug 19 2020 Remi Collet - 1.3.1-2 - report Test failure with mpdecimal version 2.5 see https://github.com/php-decimal/ext-decimal/issues/48 * Tue Feb 4 2020 Remi Collet - 1.3.1-1 - update to 1.3.1 - drop patch merged upstream * Tue Sep 03 2019 Remi Collet - 1.3.0-3 - rebuild for 7.4.0RC1 * Thu Aug 22 2019 Remi Collet - 1.3.0-2 - add patch for PHP 7.4 (test suite) from https://github.com/php-decimal/ext-decimal/pull/25 * Tue Feb 12 2019 Remi Collet - 1.3.0-1 - update to 1.3.0 * Sun Feb 10 2019 Remi Collet - 1.2.0-1 - update to 1.2.0 * Fri Feb 8 2019 Remi Collet - 1.1.2-1 - update to 1.1.2 * Wed Jan 30 2019 Remi Collet - 1.1.1-1 - update to 1.1.1 * Wed Nov 21 2018 Remi Collet - 1.1.0-1 - update to 1.1.0 * Tue Oct 30 2018 Remi Collet - 1.0.1-1 - update to 1.0.1 * Thu Aug 16 2018 Remi Collet - 1.0.0-1 - initial package, version 1.0.0 (php 7, stable) - open https://github.com/php-decimal/extension/pull/1 default path - open https://github.com/php-decimal/extension/pull/2 ship tests