From 72e059c96b6370e61c75da410942c5f25ca1cdb9 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 17 Feb 2018 10:42:46 +0100 Subject: cleanup --- php-pecl-rrd.spec | 137 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 93 insertions(+), 44 deletions(-) (limited to 'php-pecl-rrd.spec') diff --git a/php-pecl-rrd.spec b/php-pecl-rrd.spec index 01dc657..bd47bda 100644 --- a/php-pecl-rrd.spec +++ b/php-pecl-rrd.spec @@ -9,31 +9,29 @@ # # Please, preserve the changelog entries # + +# we don't want -z defs linker flag +%undefine _strict_symbol_defs_build + %{?scl: %scl_package php-pecl-rrd} -%global with_zts 0%{?__ztsphp:1} +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name rrd -%if "%{php_version}" < "5.6" -%global ini_name %{pecl_name}.ini -%else %global ini_name 40-%{pecl_name}.ini -%endif - +#global prever beta3 Summary: PHP Bindings for rrdtool Name: %{?scl_prefix}php-pecl-rrd -Version: 1.1.3 -Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Version: 2.0.1 +Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD -Group: Development/Languages URL: http://pecl.php.net/package/rrd -Source: http://pecl.php.net/get/%{pecl_name}-%{version}%{?pre}.tgz +Source: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: %{?scl_prefix}php-devel >= 5.3.2 +BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: rrdtool -BuildRequires: rrdtool-devel >= 1.3.0 +BuildRequires: pkgconfig(librrd) >= 1.3.0 BuildRequires: %{?scl_prefix}php-pear Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} @@ -56,13 +54,19 @@ Obsoletes: php53-pecl-%{pecl_name} <= %{version} Obsoletes: php53u-pecl-%{pecl_name} <= %{version} Obsoletes: php54-pecl-%{pecl_name} <= %{version} Obsoletes: php54w-pecl-%{pecl_name} <= %{version} -%if "%{php_version}" > "5.5" Obsoletes: php55u-pecl-%{pecl_name} <= %{version} Obsoletes: php55w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "5.6" Obsoletes: php56u-pecl-%{pecl_name} <= %{version} Obsoletes: php56w-pecl-%{pecl_name} <= %{version} +Obsoletes: php70u-pecl-%{pecl_name} <= %{version} +Obsoletes: php70w-pecl-%{pecl_name} <= %{version} +%if "%{php_version}" > "7.1" +Obsoletes: php71u-pecl-%{pecl_name} <= %{version} +Obsoletes: php71w-pecl-%{pecl_name} <= %{version} +%endif +%if "%{php_version}" > "7.2" +Obsoletes: php72u-pecl-%{pecl_name} <= %{version} +Obsoletes: php72w-pecl-%{pecl_name} <= %{version} %endif %endif @@ -77,16 +81,28 @@ Obsoletes: php56w-pecl-%{pecl_name} <= %{version} Procedural and simple OO wrapper for rrdtool - data logging and graphing system for time series data. +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 %setup -c -q +mv %{pecl_name}-%{version}%{?prever} NTS + # Don't install/register tests sed -e 's/role="test"/role="src"/' \ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ -i package.xml -mv %{pecl_name}-%{version} NTS +cd NTS + +# 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 @@ -99,6 +115,8 @@ cp -r NTS ZTS %build +%{?dtsenable} + cd NTS %{_bindir}/phpize %configure --with-php-config=%{_bindir}/php-config @@ -113,7 +131,8 @@ make %{?_smp_mflags} %install -rm -rf %{buildroot} +%{?dtsenable} + make install -C NTS INSTALL_ROOT=%{buildroot} # Drop in the bit of configuration @@ -136,16 +155,16 @@ done %check %if %{with_zts} %{__ztsphp} --no-php-ini \ - --define extension=ZTS/modules/%{pecl_name}.so \ + --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 \ + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} +cd NTS if pkg-config librrd --atleast-version=1.5.0 then : ignore test failed with rrdtool gt 1.5 @@ -159,22 +178,17 @@ fi make -C tests/data clean make -C tests/data all -if ! make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1 -then - for t in tests/*diff; do - echo "*** FAILED: $(basename $t .diff)" - diff -u tests/$(basename $t .diff).exp tests/$(basename $t .diff).out || : - done - - exit 1 -fi - -%clean -rm -rf %{buildroot} +: upstream test suite for NTS extension +TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ +REPORT_EXIT_STATUS=1 \ +NO_INTERACTION=1 \ +TEST_PHP_EXECUTABLE=%{_bindir}/php \ +%{_bindir}/php -n \ + run-tests.php --show-diff -%if 0%{?fedora} < 24 +%if 0%{?fedora} < 24 && 0%{?rhel} < 8 # when pear installed alone, after us %triggerin -- %{?scl_prefix}php-pear if [ -x %{__pecl} ] ; then @@ -195,12 +209,12 @@ fi %files -%defattr(-, root, root, -) -%{?_licensedir:%license NTS/LICENSE} %doc %{pecl_docdir}/%{pecl_name} +%{?_licensedir:%license NTS/LICENSE} +%{pecl_xmldir}/%{name}.xml + %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so -%{pecl_xmldir}/%{name}.xml %if %{with_zts} %config(noreplace) %{php_ztsinidir}/%{ini_name} @@ -209,16 +223,51 @@ fi %changelog -* Wed Mar 9 2016 Remi Collet - 1.1.3-5 +* Tue Jul 18 2017 Remi Collet - 2.0.1-4 +- rebuild for PHP 7.2.0beta1 new API + +* Thu Dec 1 2016 Remi Collet - 2.0.1-3 +- rebuild with PHP 7.1.0 GA + +* Wed Sep 14 2016 Remi Collet - 2.0.1-2 +- rebuild for PHP 7.1 new API version + +* Wed May 11 2016 Remi Collet - 2.0.1-1 +- update to 2.0.1 (no change) + +* Sun Mar 6 2016 Remi Collet - 2.0.0-2 - adapt for F24 -- drop runtime dependency on pear, new scriptlets -- fix license management -- don't install/register tests -* Mon Aug 31 2015 Remi Collet - 1.1.3-4 -- F23 build +* Mon Dec 28 2015 Remi Collet - 2.0.0-1 +- update to 2.0.0 + +* Tue Oct 13 2015 Remi Collet - 2.0.0-0.7.beta3 +- rebuild for PHP 7.0.0RC5 new API version + +* Fri Sep 18 2015 Remi Collet - 2.0.0-0.6.beta3 +- F23 rebuild with rh_layout + +* Wed Jul 22 2015 Remi Collet - 2.0.0-0.5.beta3 +- rebuild against php 7.0.0beta2 + +* Wed Jul 8 2015 Remi Collet - 2.0.0-0.4.beta3 +- rebuild against php 7.0.0beta1 + +* Sat Jun 27 2015 Remi Collet - 2.0.0-0.3.beta3 +- update to 2.0.0beta3 +- drop upstream patches + +* Wed Jun 24 2015 Remi Collet - 2.0.0-0.2.beta2 +- rebuild for "rh_layout" (php70) + +* Tue Jun 16 2015 Remi Collet - 2.0.0-0.1.beta2 +- update to 2.0.0beta2 +- raise dependency on php >= 7 +- drop runtime dependency on pear, new scriptlets +- don't install test suite +- add some upstream patches, post-beta2 -* Wed Dec 24 2014 Remi Collet - 1.1.3-3 +* Wed Dec 24 2014 Remi Collet - 1.1.3-3.1 - Fedora 21 SCL mass rebuild * Mon Aug 25 2014 Remi Collet - 1.1.3-3 -- cgit