diff --git a/.gitignore b/.gitignore index 036567e..c7cd2a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rrd-2.0.1.tgz +rrd-2.0.3.tgz diff --git a/.php-pecl-rrd.metadata b/.php-pecl-rrd.metadata deleted file mode 100644 index a626066..0000000 --- a/.php-pecl-rrd.metadata +++ /dev/null @@ -1 +0,0 @@ -a92e680087182558bd1dab54176e362536f3ef43 SOURCES/rrd-2.0.1.tgz diff --git a/SPECS/php-pecl-rrd.spec b/php-pecl-rrd.spec similarity index 65% rename from SPECS/php-pecl-rrd.spec rename to php-pecl-rrd.spec index c0ca599..f350771 100644 --- a/SPECS/php-pecl-rrd.spec +++ b/php-pecl-rrd.spec @@ -1,9 +1,7 @@ -# RHEL spec file for php-pecl-rrd, from -# # remirepo/fedora spec file for php-pecl-rrd # -# Copyright (c) 2011-2019 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2011-2024 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries @@ -12,20 +10,26 @@ # we don't want -z defs linker flag %undefine _strict_symbol_defs_build -%global with_zts 0%{?__ztsphp:1} -%global pecl_name rrd -%global ini_name 40-%{pecl_name}.ini +%global with_zts 0%{?__ztsphp:1} +%global pecl_name rrd +%global ini_name 40-%{pecl_name}.ini +%global sources %{pecl_name}-%{version} +%global _configure ../%{sources}/configure Summary: PHP Bindings for rrdtool Name: php-pecl-rrd -Version: 2.0.1 -Release: 1%{?dist} -License: BSD -URL: http://pecl.php.net/package/rrd +Version: 2.0.3 +Release: 15%{?dist} +License: BSD-2-Clause +URL: https://pecl.php.net/package/rrd -Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz -BuildRequires: php-devel > 7 +Patch0: %{pecl_name}-build.patch + +BuildRequires: make +BuildRequires: gcc +BuildRequires: php-devel >= 7.0 BuildRequires: rrdtool BuildRequires: pkgconfig(librrd) >= 1.3.0 BuildRequires: php-pear @@ -48,33 +52,48 @@ system for time series data. %prep %setup -c -q -mv %{pecl_name}-%{version} NTS - # Don't install/register tests sed -e 's/role="test"/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_RRD_VERSION/{s/.* "//;s/".*$//;p}' php_rrd.h) +if test "x${extver}" != "x%{version}%{?prever}"; then + : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever}. + exit 1 +fi +cd .. + cat > %{ini_name} << 'EOF' ; Enable %{pecl_name} extension module extension=%{pecl_name}.so EOF +mkdir NTS %if %{with_zts} -cp -r NTS ZTS +mkdir ZTS %endif %build -cd NTS -%{_bindir}/phpize -%configure --with-php-config=%{_bindir}/php-config +# See https://bugzilla.redhat.com/2264827 +# only "const" issues +export CFLAGS="%{optflags} -Wno-incompatible-pointer-types" + +cd %{sources} +%{__phpize} + +cd ../NTS +%configure --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize -%configure --with-php-config=%{_bindir}/zts-php-config +%configure --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -95,24 +114,25 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} # Test & Documentation for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done %check %if %{with_zts} %{__ztsphp} --no-php-ini \ - --define extension=ZTS/modules/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ + --modules | grep '^%{pecl_name}$' %endif -cd NTS %{__php} --no-php-ini \ - --define extension=modules/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ + --modules | grep '^%{pecl_name}$' # See https://bugzilla.redhat.com/1224530 - segfault on ARM -%ifnarch %{arm} +%ifnarch %{arm} s390x +cd %{sources} + if pkg-config librrd --atleast-version=1.5.0 then : ignore test failed with rrdtool > 1.5 @@ -124,19 +144,20 @@ then rm tests/rrd_{012,017}.phpt fi +cp ../NTS/tests/data/Makefile tests/data +cp ../NTS/tests/rrdtool-bin.inc tests make -C tests/data clean make -C tests/data all -TEST_PHP_EXECUTABLE=%{_bindir}/php \ -TEST_PHP_ARGS="-n -d extension_dir= -d extension=$PWD/modules/%{pecl_name}.so" \ -NO_INTERACTION=1 \ +TEST_PHP_EXECUTABLE=%{__php} \ +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ -%{_bindir}/php -n run-tests.php --show-diff +%{__php} -n run-tests.php -q --show-diff %endif %files -%license NTS/LICENSE +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -150,8 +171,72 @@ REPORT_EXIT_STATUS=1 \ %changelog -* Mon Nov 25 2019 Remi Collet - 2.0.1-1 -- build for RHEL 8 +* Tue Oct 29 2024 Troy Dawson - 2.0.3-15 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Mon Jun 24 2024 Troy Dawson - 2.0.3-14 +- Bump release for June 2024 mass rebuild + +* Mon Feb 19 2024 Remi Collet - 2.0.3-13 +- ignore incompatible-pointer-types see #2264827 + +* Mon Jan 29 2024 Remi Collet - 2.0.3-12 +- fix incompatible pointer types using patch from + https://github.com/php/pecl-processing-rrd/pull/4 +- build out of sources tree + +* Thu Jan 25 2024 Fedora Release Engineering - 2.0.3-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 2.0.3-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Oct 03 2023 Remi Collet - 2.0.3-10 +- rebuild for https://fedoraproject.org/wiki/Changes/php83 + +* Fri Jul 21 2023 Fedora Release Engineering - 2.0.3-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Apr 20 2023 Remi Collet - 2.0.3-8 +- use SPDX license ID + +* Fri Jan 20 2023 Fedora Release Engineering - 2.0.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Wed Oct 05 2022 Remi Collet - 2.0.3-6 +- rebuild for https://fedoraproject.org/wiki/Changes/php82 + +* Fri Jul 22 2022 Fedora Release Engineering - 2.0.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jan 21 2022 Fedora Release Engineering - 2.0.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Oct 28 2021 Remi Collet - 2.0.3-3 +- rebuild for https://fedoraproject.org/wiki/Changes/php81 + +* Fri Jul 23 2021 Fedora Release Engineering - 2.0.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Apr 28 2021 Remi Collet - 2.0.3-1 +- update to 2.0.3 + +* Mon Apr 19 2021 Remi Collet - 2.0.2-1 +- update to 2.0.2 + +* Fri Mar 5 2021 Remi Collet - 2.0.1-17 +- rebuild for https://fedoraproject.org/wiki/Changes/php80 +- add upstream patch for PHP 8 + +* Wed Jan 27 2021 Fedora Release Engineering - 2.0.1-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 2.0.1-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jan 30 2020 Fedora Release Engineering - 2.0.1-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Thu Oct 03 2019 Remi Collet - 2.0.1-13 - rebuild for https://fedoraproject.org/wiki/Changes/php74 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 +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; diff --git a/sources b/sources new file mode 100644 index 0000000..5ade231 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (rrd-2.0.3.tgz) = 28679ccead54806d1e92accc6f5ebab582a41db802f95797ddb43e3e15690889be3437f22e2a14939d217422ac2700ef90ae0a9b36244ddead3856343b3e09b4