summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-06-17 08:32:16 +0200
committerRemi Collet <fedora@famillecollet.com>2015-06-17 08:32:16 +0200
commit622dc66db1721c86f4cf086b71571cc1dc12402b (patch)
tree0f4e1175e44b08f49689ad7264531532f1e89dcc
parentfde7c2db6c08d5ad7b99138cdee732070bd45e34 (diff)
php-pecl-rrd: 2.0.0beta2 (WIP)
-rw-r--r--php-pecl-rrd-dev.spec112
1 files changed, 70 insertions, 42 deletions
diff --git a/php-pecl-rrd-dev.spec b/php-pecl-rrd-dev.spec
index c359822..53caacb 100644
--- a/php-pecl-rrd-dev.spec
+++ b/php-pecl-rrd-dev.spec
@@ -21,26 +21,24 @@
%else
%global ini_name 40-%{pecl_name}.ini
%endif
-
+%global prever beta2
Summary: PHP Bindings for rrdtool
Name: %{?scl_prefix}php-pecl-rrd
-Version: 1.1.3
-Release: 3%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1
+Version: 2.0.0
+Release: 0.1.%{prever}%{?dist}%{!?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: %{?scl_prefix}php-pear
-Requires(post): %{__pecl}
-Requires(postun): %{__pecl}
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
@@ -53,17 +51,21 @@ Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}%{?pre}
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1}
# Other third party repo stuff
-Obsoletes: php53-pecl-%{pecl_name}
-Obsoletes: php53u-pecl-%{pecl_name}
-Obsoletes: php54-pecl-%{pecl_name}
-Obsoletes: php54w-pecl-%{pecl_name}
+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}
-Obsoletes: php55w-pecl-%{pecl_name}
+Obsoletes: php55u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "5.6"
-Obsoletes: php56u-pecl-%{pecl_name}
-Obsoletes: php56w-pecl-%{pecl_name}
+Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
+%endif
+%if "%{php_version}" > "7.0"
+Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
%endif
%endif
@@ -82,7 +84,17 @@ system for time series data.
%prep
%setup -c -q
-mv %{pecl_name}-%{version} NTS
+mv %{pecl_name}-%{version}%{?prever} NTS
+
+# Don't install/register tests
+sed -e 's/role="test"/role="src"/' -i package.xml
+
+# Sanity check, really often broken
+extver=$(sed -n '/#define PHP_RRD_VERSION/{s/.* "//;s/".*$//;p}' NTS/php_rrd.h)
+if test "x${extver}" != "x%{version}%{?prever}"; then
+ : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever}.
+ exit 1
+fi
cat > %{ini_name} << 'EOF'
; Enable %{pecl_name} extension module
@@ -123,10 +135,7 @@ make install -C ZTS INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
-# Test & Documentation
-for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
-done
+# 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
done
@@ -135,45 +144,57 @@ 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}
-%if 0%{?fedora} < 14 && 0%{?rhel} < 7
- # skip tests which only succeed with rrdtool > 1.4.0
- rm tests/rrd_012.phpt \
- tests/rrd_017.phpt
-%endif
+cd NTS
+if pkg-config librrd --atleast-version=1.5.0
+then
+ : ignore test failed with rrdtool > 1.5
+ rm tests/rrd_{016,017}.phpt
+fi
+if ! pkg-config librrd --atleast-version=1.4.0
+then
+ : ignore test failed with rrdtool < 1.4
+ rm tests/rrd_{012,017}.phpt
+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
+: 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
%clean
rm -rf %{buildroot}
-%post
-%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+# when pear installed alone, after us
+%triggerin -- %{?scl_prefix}php-pear
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
+# posttrans as pear can be installed after us
+%posttrans
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
%postun
-if [ $1 -eq 0 ] ; then
+if [ $1 -eq 0 -a -x %{__pecl} ] ; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
@@ -181,10 +202,11 @@ fi
%files
%defattr(-, root, root, -)
%doc %{pecl_docdir}/%{pecl_name}
-%doc %{pecl_testdir}/%{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}
@@ -193,7 +215,13 @@ fi
%changelog
-* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 0.8.0-1.1
+* Tue Jun 16 2015 Remi Collet <remi@fedoraproject.org> - 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
+
+* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 1.1.3-3.1
- Fedora 21 SCL mass rebuild
* Mon Aug 25 2014 Remi Collet <rcollet@redhat.com> - 1.1.3-3