summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-04-27 09:18:26 +0200
committerRemi Collet <remi@php.net>2023-04-27 09:18:26 +0200
commit0c4a904e26e3caf5614a8441450027a2c9d43b51 (patch)
tree433b693047d67462329bd3c3fb0540a72dac50f7
parent063b35668aee19754a95def85ab02fc7bf78abd6 (diff)
improved patch for libhdr_histogram 0.11.7
-rw-r--r--PHPINFO4
-rw-r--r--REFLECTION2
-rw-r--r--hdr_histogram-lib0114.patch111
-rw-r--r--php-pecl-hdr-histogram.spec46
4 files changed, 132 insertions, 31 deletions
diff --git a/PHPINFO b/PHPINFO
index 0ad705f..c775738 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -1,2 +1,6 @@
hdrhistogram
+
+hdrhistogram support => enabled
+Extension version => 0.4.2
+Library version => 0.11.7
diff --git a/REFLECTION b/REFLECTION
index 871ab66..2f4224c 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #74 hdrhistogram version 0.4.2 ] {
+Extension [ <persistent> extension #75 hdrhistogram version 0.4.2 ] {
- Functions {
Function [ <internal:hdrhistogram> function hdr_init ] {
diff --git a/hdr_histogram-lib0114.patch b/hdr_histogram-lib0114.patch
index 727a011..c53ba3a 100644
--- a/hdr_histogram-lib0114.patch
+++ b/hdr_histogram-lib0114.patch
@@ -1,7 +1,7 @@
-From 857918bdb4bf1a4faf769e01aaa3c3f5bd14021a Mon Sep 17 00:00:00 2001
+From b62e02bf30b5967f6b5514dfba025c8c8ce1a431 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 1 Mar 2022 10:31:21 +0100
-Subject: [PATCH] Fix for libhdr_histogram version 0.11.4
+Subject: [PATCH 1/3] Fix for libhdr_histogram version 0.11.4
---
config.m4 | 76 ++++++++++++++++++++++++++++++--------------------
@@ -101,7 +101,7 @@ index aa4fec8..729a038 100644
PHP_SUBST(HDRHISTOGRAM_SHARED_LIBADD)
diff --git a/hdrhistogram.c b/hdrhistogram.c
-index d3595a3..cff2c18 100644
+index d3099a1..5a60a53 100644
--- a/hdrhistogram.c
+++ b/hdrhistogram.c
@@ -117,17 +117,17 @@ PHP_MINFO_FUNCTION(hdrhistogram)
@@ -216,3 +216,108 @@ index d3595a3..cff2c18 100644
if (res == 0) {
hdr_register_hdr_resource(return_value, hdr);
+
+From 82a52859195755097cf3437f957ded89834533c0 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 27 Apr 2023 09:01:20 +0200
+Subject: [PATCH 2/3] improve phpinfo with extension and library version (from
+ 0.11.7)
+
+---
+ config.m4 | 3 +++
+ hdrhistogram.c | 11 +++++++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/config.m4 b/config.m4
+index 729a038..955d15c 100644
+--- a/config.m4
++++ b/config.m4
+@@ -12,6 +12,9 @@ if test "$PHP_HDRHISTOGRAM" != "no"; then
+ LIBHDR_LIBDIR=`$PKG_CONFIG hdr_histogram --libs`
+ LIBHDR_VERSON=`$PKG_CONFIG hdr_histogram --modversion`
+ AC_MSG_RESULT(found $LIBHDR_VERSON)
++ if $PKG_CONFIG hdr_histogram --atleast-version 0.11.7; then
++ AC_DEFINE(HAVE_HDRHISTOGRAM_0_11_7,1,[ ])
++ fi
+ if $PKG_CONFIG hdr_histogram --atleast-version 0.11.4; then
+ AC_DEFINE(HAVE_HDRHISTOGRAM_0_11_4,1,[ ])
+ fi
+diff --git a/hdrhistogram.c b/hdrhistogram.c
+index 5a60a53..fff37db 100644
+--- a/hdrhistogram.c
++++ b/hdrhistogram.c
+@@ -3,8 +3,12 @@
+ #endif
+
+ #include "php.h"
++#include "ext/standard/info.h"
+ #include "hdr/hdr_histogram.h"
+ #include "hdr/hdr_histogram_log.h"
++#ifdef HAVE_HDRHISTOGRAM_0_11_7
++#include "hdr/hdr_histogram_version.h"
++#endif
+ #include "php_hdrhistogram.h"
+
+ #if PHP_VERSION_ID < 80000
+@@ -112,6 +116,13 @@ PHP_RSHUTDOWN_FUNCTION(hdrhistogram)
+
+ PHP_MINFO_FUNCTION(hdrhistogram)
+ {
++ php_info_print_table_start();
++
++ php_info_print_table_row(2, "hdrhistogram", "enabled");
++ php_info_print_table_row(2, "Extension version", HDR_VERSION);
++#ifdef HDR_HISTOGRAM_VERSION
++ php_info_print_table_row(2, "Library version", HDR_HISTOGRAM_VERSION);
++#endif
+ }
+
+ PHP_FUNCTION(hdr_init)
+
+From 21e89822c9c98ede68c0a16ece78c3323788888a Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 27 Apr 2023 09:03:59 +0200
+Subject: [PATCH 3/3] use normalized macro name
+
+---
+ hdrhistogram.c | 6 +++---
+ php_hdrhistogram.h | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/hdrhistogram.c b/hdrhistogram.c
+index fff37db..0a241be 100644
+--- a/hdrhistogram.c
++++ b/hdrhistogram.c
+@@ -67,7 +67,7 @@ zend_module_entry hdrhistogram_module_entry = {
+ PHP_RINIT(hdrhistogram), /* Request init callback */
+ PHP_RSHUTDOWN(hdrhistogram), /* Request shutdown callback */
+ PHP_MINFO(hdrhistogram), /* Module info callback */
+- HDR_VERSION,
++ PHP_HDR_HISTOGRAM_VERSION,
+ STANDARD_MODULE_PROPERTIES
+ };
+
+@@ -118,8 +118,8 @@ PHP_MINFO_FUNCTION(hdrhistogram)
+ {
+ php_info_print_table_start();
+
+- php_info_print_table_row(2, "hdrhistogram", "enabled");
+- php_info_print_table_row(2, "Extension version", HDR_VERSION);
++ php_info_print_table_row(2, "hdrhistogram support", "enabled");
++ php_info_print_table_row(2, "Extension version", PHP_HDR_HISTOGRAM_VERSION);
+ #ifdef HDR_HISTOGRAM_VERSION
+ php_info_print_table_row(2, "Library version", HDR_HISTOGRAM_VERSION);
+ #endif
+diff --git a/php_hdrhistogram.h b/php_hdrhistogram.h
+index 68fd9ae..894b224 100644
+--- a/php_hdrhistogram.h
++++ b/php_hdrhistogram.h
+@@ -5,7 +5,7 @@
+
+ extern zend_module_entry hdrhistogram_module_entry;
+ #define phpext_hdrhistogram_ptr &hdrhistogram_module_entry
+-#define HDR_VERSION "0.4.2"
++#define PHP_HDR_HISTOGRAM_VERSION "0.4.2"
+
+ PHP_MINIT_FUNCTION(hdrhistogram);
+ PHP_MSHUTDOWN_FUNCTION(hdrhistogram);
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