summaryrefslogtreecommitdiffstats
path: root/php-pecl-hdr-histogram.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-hdr-histogram.spec')
-rw-r--r--php-pecl-hdr-histogram.spec46
1 files changed, 19 insertions, 27 deletions
diff --git a/php-pecl-hdr-histogram.spec b/php-pecl-hdr-histogram.spec
index c630384..b1730d2 100644
--- a/php-pecl-hdr-histogram.spec
+++ b/php-pecl-hdr-histogram.spec
@@ -1,25 +1,26 @@
# remirepo spec file for php-pecl-hdr-histogram
#
-# Copyright (c) 2016-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2016-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
%scl_package php-pecl-hdr-histogram
%endif
+%bcond_without tests
+
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global proj_name hdr_histogram
%global pecl_name hdrhistogram
%global ini_name 40-%{pecl_name}.ini
Summary: PHP extension wrapper for the C hdrhistogram API
-Name: %{?sub_prefix}php-pecl-hdr-histogram
+Name: %{?scl_prefix}php-pecl-hdr-histogram
Version: 0.4.2
-Release: 2%{?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
Group: Development/Languages
URL: https://pecl.php.net/package/%{proj_name}
@@ -35,7 +36,7 @@ BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-json
# use our specific package
-BuildRequires: HdrHistogram_c6php-devel >= 0.11.4
+BuildRequires: HdrHistogram_c6php-devel >= 0.11.7
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
@@ -46,19 +47,6 @@ Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{proj_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{proj_name})%{?_isa} = %{version}
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-hdr-histogram <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-hdr-histogram <= %{version}
-%endif
-%if "%{php_version}" > "8.1"
-Obsoletes: php81-pecl-hdr-histogram <= %{version}
-%endif
-%endif
-
%description
HdrHistogram: A High Dynamic Range Histogram.
@@ -83,11 +71,11 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
-%patch0 -p1 -b .pr13
-%patch1 -p1 -b .pr15
+%patch -P0 -p1 -b .pr13
+%patch -P1 -p1 -b .pr15
# Check upstream version (often broken)
-extver=$(sed -n '/#define HDR_VERSION/{s/.* "//;s/".*$//;p}' php_hdrhistogram.h)
+extver=$(sed -n '/#define PHP_HDR_HISTOGRAM_VERSION/{s/.* "//;s/".*$//;p}' php_hdrhistogram.h)
if test "x${extver}" != "x%{version}"; then
: Error: Upstream version is ${extver}, expecting %{version}.
exit 1
@@ -155,12 +143,13 @@ OPT="-n"
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="$OPT -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php --show-diff
+%{__php} -n run-tests.php -q --show-diff
+%endif
%if %{with_zts}
cd ../ZTS
@@ -169,13 +158,13 @@ cd ../ZTS
--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" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php --show-diff
-
+%{__ztsphp} -n run-tests.php -q --show-diff
+%endif
%endif
@@ -214,6 +203,9 @@ fi
%changelog
+* Thu Apr 27 2023 Remi Collet <remi@remirepo.net> - 0.4.2-3
+- improved patch for libhdr_histogram 0.11.7
+
* Tue Mar 1 2022 Remi Collet <remi@remirepo.net> - 0.4.2-2
- add patch for libhdr_histogram 0.11.4