summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--php-pecl-rrd.spec16
-rw-r--r--rrd-build.patch31
3 files changed, 45 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 1ab5c4f..01f0400 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
+clog
package-*.xml
*.tgz
+*.tar.bz2
*.tar.gz
*.tar.xz
*.tar.xz.asc
diff --git a/php-pecl-rrd.spec b/php-pecl-rrd.spec
index ce3207b..b208560 100644
--- a/php-pecl-rrd.spec
+++ b/php-pecl-rrd.spec
@@ -3,7 +3,7 @@
#
# Fedora spec file for php-pecl-rrd
#
-# Copyright (c) 2011-2023 Remi Collet
+# Copyright (c) 2011-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -24,12 +24,14 @@
Summary: PHP Bindings for rrdtool
Name: %{?scl_prefix}php-pecl-rrd
Version: 2.0.3
-Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 12%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: BSD-2-Clause
URL: https://pecl.php.net/package/rrd
Source: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
+Patch0: %{pecl_name}-build.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
@@ -68,6 +70,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd %{sources}
+%patch -P0 -p1
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_RRD_VERSION/{s/.* "//;s/".*$//;p}' php_rrd.h)
if test "x${extver}" != "x%{version}%{?prever}"; then
@@ -130,12 +134,12 @@ done
%if %{with_zts}
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%endif
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%if %{with tests}
cd %{sources}
@@ -198,6 +202,10 @@ fi
%changelog
+* Mon Jan 29 2024 Remi Collet <remi@remirepo.net> - 2.0.3-12
+- fix incompatible pointer types using patch from
+ https://github.com/php/pecl-processing-rrd/pull/4
+
* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 2.0.3-4
- rebuild for PHP 8.3.0RC1
diff --git a/rrd-build.patch b/rrd-build.patch
new file mode 100644
index 0000000..d19d96f
--- /dev/null
+++ b/rrd-build.patch
@@ -0,0 +1,31 @@
+From 7d36350f6398a2c4504c87db7128ef3ce47145d3 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 29 Jan 2024 14:12:23 +0100
+Subject: [PATCH] Fix incompatible pointer types
+
+---
+ rrd.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/rrd.c b/rrd.c
+index 526f094..ab19b41 100644
+--- a/rrd.c
++++ b/rrd.c
+@@ -55,7 +55,7 @@ PHP_FUNCTION(rrd_fetch)
+ rrd_args *argv;
+ /* returned values if rrd_fetch doesn't fail */
+ time_t start, end;
+- zend_ulong step,
++ unsigned long step,
+ ds_cnt; /* count of data sources */
+ char **ds_namv; /* list of data source names */
+ rrd_value_t *ds_data; /* all data from all sources */
+@@ -396,7 +396,7 @@ PHP_FUNCTION(rrd_xport)
+ /* return values from rrd_xport */
+ int xxsize;
+ time_t start, end, time_index;
+- zend_ulong step, outvar_count;
++ unsigned long step, outvar_count;
+ char **legend_v;
+ rrd_value_t *data, *data_ptr;
+ zval zv_data;