[php-pecl-rrd] - Update to 1.1.2 (stable) - install doc in pecl doc_dir - install tests in pecl test_dir - add cond

Remi Collet remi at fedoraproject.org
Tue Jan 14 17:18:02 UTC 2014


commit 1b813cb74cd421ff67f54fc90ce33bcf32e35f9a
Author: Remi Collet <remi at fedoraproject.org>
Date:   Tue Jan 14 18:18:09 2014 +0100

    - Update to 1.1.2 (stable)
    - install doc in pecl doc_dir
    - install tests in pecl test_dir
    - add conditional build of ZTS extension

 .gitignore        |    3 +-
 php-pecl-rrd.spec |  107 +++++++++++++++++++--------
 rrd-svn.patch     |  211 +++++++++++++++++++----------------------------------
 sources           |    2 +-
 4 files changed, 154 insertions(+), 169 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index c254246..9c9d125 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,8 @@
-*spec~
+clog
 package-*.xml
 /rrd-1.0.3.tgz
 /rrd-1.0.4.tgz
 /rrd-1.0.5.tgz
 /rrd-1.1.0.tgz
 /rrd-1.1.1.tgz
+/rrd-1.1.2.tgz
diff --git a/php-pecl-rrd.spec b/php-pecl-rrd.spec
index c5df083..01cbf5e 100644
--- a/php-pecl-rrd.spec
+++ b/php-pecl-rrd.spec
@@ -1,28 +1,32 @@
 # spec file for php-pecl-rrd
 #
-# Copyright (c) 2011-2013 Remi Collet
+# Copyright (c) 2011-2014 Remi Collet
 # License: CC-BY-SA
 # http://creativecommons.org/licenses/by-sa/3.0/
 #
 # Please, preserve the changelog entries
 #
-%{!?__pecl:     %{expand: %%global __pecl     %{_bindir}/pecl}}
+%{!?php_inidir:  %global php_inidir  %{_sysconfdir}/php.d}
+%{!?__pecl:      %global __pecl      %{_bindir}/pecl}
+%{!?__php:       %global __php       %{_bindir}/php}
 
+%global with_zts  0%{?__ztsphp:1}
 %global pecl_name rrd
 
 Summary:      PHP Bindings for rrdtool
 Name:         php-pecl-rrd
-Version:      1.1.1
-Release:      2%{?dist}
+Version:      1.1.2
+Release:      1%{?dist}
 License:      BSD
 Group:        Development/Languages
 URL:          http://pecl.php.net/package/rrd
 
 Source0:      http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
 
-# Fix build warning   http://svn.php.net/viewvc?view=revision&revision=331314
-# Fix test strictness http://svn.php.net/viewvc?view=revision&revision=331315
-Patch0:        %{pecl_name}-svn.patch
+# http://svn.php.net/viewvc?view=revision&revision=332619
+# http://svn.php.net/viewvc?view=revision&revision=332620
+# fix build with rrdtool < 1.4
+Patch0:       %{pecl_name}-svn.patch
 
 BuildRequires: php-devel >= 5.3.2
 BuildRequires: rrdtool
@@ -41,9 +45,11 @@ Provides:     php-%{pecl_name} = %{version}%{?pre}
 Provides:     php-%{pecl_name}%{?_isa} = %{version}%{?pre}
 
 
-# Filter private shared object
-%{?filter_provides_in: %filter_provides_in %{_dir}/.*\.so$}
+%if 0%{?fedora} < 20
+# Filter shared private
+%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
 %{?filter_setup}
+%endif
 
 
 %description
@@ -54,15 +60,10 @@ system for time series data.
 %prep 
 %setup -c -q
 
-cd %{pecl_name}-%{version}
-
-%patch0 -p3 -b .svn
+mv %{pecl_name}-%{version} NTS
 
-extver=$(sed -n '/#define PHP_RRD_VERSION/{s/.* "//;s/".*$//;p}' php_rrd.h)
-if test "x${extver}" != "x%{version}%{?pre}"; then
-   : Error: Upstream version is ${extver}, expecting %{version}.
-   exit 1
-fi
+cd NTS
+%patch0 -p0 -b .svn
 cd ..
 
 cat > %{pecl_name}.ini << 'EOF'
@@ -70,33 +71,67 @@ cat > %{pecl_name}.ini << 'EOF'
 extension=%{pecl_name}.so
 EOF
 
+%if %{with_zts}
+cp -r  NTS ZTS
+%endif
+
 
 %build
-cd %{pecl_name}-%{version}
-phpize
-%configure
+cd NTS
+%{_bindir}/phpize
+%configure --with-php-config=%{_bindir}/php-config
+make %{?_smp_mflags}
 
+%if %{with_zts}
+cd ../ZTS
+%{_bindir}/zts-phpize
+%configure --with-php-config=%{_bindir}/zts-php-config
 make %{?_smp_mflags}
+%endif
 
 
 %install
-make install -C %{pecl_name}-%{version}%{?pre} INSTALL_ROOT=%{buildroot}
+make install -C NTS INSTALL_ROOT=%{buildroot}
 
 # Drop in the bit of configuration
-install -D -m 644 %{pecl_name}.ini %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini
+install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini
 
 # Install XML package description
 install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
 
+%if %{with_zts}
+make install -C ZTS INSTALL_ROOT=%{buildroot}
+install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini
+%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
+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
+
 
 %check
-cd %{pecl_name}-%{version}
-php --no-php-ini \
-    --define extension_dir=modules \
-    --define extension=%{pecl_name}.so \
+%if %{with_zts}
+%{__ztsphp} --no-php-ini \
+    --define extension=ZTS/modules/%{pecl_name}.so \
+    --modules | grep %{pecl_name}
+%endif
+
+cd NTS
+%{__php} --no-php-ini \
+    --define extension=modules/%{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
+
 make -C tests/data clean
 make -C tests/data all
 make test NO_INTERACTION=1 | tee rpmtests.log
@@ -111,28 +146,36 @@ if  grep -q "FAILED TEST" rpmtests.log; then
 fi
 
 
-%if 0%{?pecl_install:1}
 %post
 %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-%endif
 
 
-%if 0%{?pecl_uninstall:1}
 %postun
 if [ $1 -eq 0 ] ; then
     %{pecl_uninstall} %{pecl_name} >/dev/null || :
 fi
-%endif
 
 
 %files
-%doc %{pecl_name}-%{version}/CREDITS %{pecl_name}-%{version}/LICENSE
-%config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini
+%doc %{pecl_docdir}/%{pecl_name}
+%doc %{pecl_testdir}/%{pecl_name}
+%config(noreplace) %{php_inidir}/%{pecl_name}.ini
 %{php_extdir}/%{pecl_name}.so
 %{pecl_xmldir}/%{name}.xml
 
+%if %{with_zts}
+%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini
+%{php_ztsextdir}/%{pecl_name}.so
+%endif
+
 
 %changelog
+* Tue Jan 14 2014 Remi Collet <remi at fedoraproject.org> - 1.1.2-1
+- Update to 1.1.2 (stable)
+- install doc in pecl doc_dir
+- install tests in pecl test_dir
+- add conditional build of ZTS extension
+
 * Mon Sep 09 2013 Remi Collet <remi at fedoraproject.org> - 1.1.1-2
 - patch for build warning
 - patch to fix test result with recent rrdtool
diff --git a/rrd-svn.patch b/rrd-svn.patch
index ef63cdc..8e95bcf 100644
--- a/rrd-svn.patch
+++ b/rrd-svn.patch
@@ -1,145 +1,86 @@
---- pecl/rrd/trunk/rrd_create.c	2013/09/09 06:16:12	331313
-+++ pecl/rrd/trunk/rrd_create.c	2013/09/09 06:51:03	331314
-@@ -71,7 +71,9 @@
- {
- 	rrd_create_object *intern_obj;
- 	zend_object_value retval;
-+#if ZEND_MODULE_API_NO  < 20100409
- 	zval *tmp;
-+#endif
- 
- 	intern_obj = ecalloc(1, sizeof(*intern_obj));
- 	zend_object_std_init(&intern_obj->std, ce TSRMLS_CC);
---- pecl/rrd/trunk/rrd_graph.c	2013/09/09 06:16:12	331313
-+++ pecl/rrd/trunk/rrd_graph.c	2013/09/09 06:51:03	331314
-@@ -62,7 +62,9 @@
- {
- 	rrd_graph_object *intern_obj;
- 	zend_object_value retval;
-+#if ZEND_MODULE_API_NO  < 20100409
- 	zval *tmp;
-+#endif
+Index: config.m4
+===================================================================
+--- config.m4	(révision 332618)
++++ config.m4	(copie de travail)
+@@ -67,6 +67,9 @@
+   dnl rrd_lastupdate_r available in 1.4.0+
+   PHP_CHECK_FUNC(rrd_lastupdate_r, rrd)
  
- 	intern_obj = ecalloc(1, sizeof(*intern_obj));
- 	zend_object_std_init(&intern_obj->std, ce TSRMLS_CC);
-@@ -280,7 +282,7 @@
- {
- 	rrd_graph_object *intern_obj = (rrd_graph_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
- 	/* return value from rrd_graphv */
--	rrd_info_t *rrd_info_data, *data_p;
-+	rrd_info_t *rrd_info_data;
++  dnl rrd_disconnect available in 1.4.0+
++  PHP_CHECK_FUNC(rrdc_disconnect, rrd)
++
+   LDFLAGS=$old_LDFLAGS
  
- 	/* arguments for rrd_graph call */
- 	rrd_args *graph_argv;
---- pecl/rrd/trunk/rrd_info.c	2013/09/09 06:16:12	331313
-+++ pecl/rrd/trunk/rrd_info.c	2013/09/09 06:51:03	331314
-@@ -31,7 +31,7 @@
- 	 */
- 	char *argv[3];
- 	/* return value from rrd_info_r() */
--	rrd_info_t *rrd_info_data, *data_p;
-+	rrd_info_t *rrd_info_data;
+   PHP_NEW_EXTENSION(rrd, rrd.c rrd_graph.c rrd_create.c rrd_update.c rrd_info.c, $ext_shared)
+Index: rrd.c
+===================================================================
+--- rrd.c	(révision 332618)
++++ rrd.c	(copie de travail)
+@@ -481,6 +481,7 @@
+ }
+ /* }}} */
  
- 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename,
- 		&filename_length) == FAILURE) {
-@@ -82,7 +82,7 @@
- 			add_assoc_string(array, data_p->key, data_p->value.u_str, 1);
- 			break;
- 		case RD_I_BLO:
--			add_assoc_stringl(array, data_p->key, data_p->value.u_blo.ptr,
-+			add_assoc_stringl(array, data_p->key, (char *)data_p->value.u_blo.ptr,
- 				 data_p->value.u_blo.size, 1);
- 			break;
- 		}
-@@ -91,4 +91,4 @@
++#ifdef HAVE_RRDC_DISCONNECT
+ /* {{{ proto void rrdc_disconnect()
+  * Close any outstanding connection to rrd cache daemon.
+  */
+@@ -492,6 +493,7 @@
  
- 	return 1;
+ 	rrdc_disconnect();
  }
--/* }}} */
-\ No newline at end of file
-+/* }}} */
---- pecl/rrd/trunk/rrd_update.c	2013/09/09 06:16:12	331313
-+++ pecl/rrd/trunk/rrd_update.c	2013/09/09 06:51:03	331314
-@@ -56,7 +56,9 @@
- {
- 	rrd_update_object *intern_obj;
- 	zend_object_value retval;
-+#if ZEND_MODULE_API_NO  < 20100409
- 	zval *tmp;
 +#endif
  
- 	intern_obj = ecalloc(1, sizeof(*intern_obj));
- 	zend_object_std_init(&intern_obj->std, ce TSRMLS_CC);
-Index: tests/rrd_002.phpt
-===================================================================
---- pecl/rrd/trunk/tests/rrd_002.phpt	(révision 331313)
-+++ pecl/rrd/trunk/tests/rrd_002.phpt	(copie de travail)
-@@ -29,8 +29,8 @@
-   ["xsize"]=>
-   int(497)
-   ["ysize"]=>
--  int(148)
-+  int(%d)
-   ["calcpr"]=>
-   NULL
- }
--bool(true)
-\ Pas de retour chariot à la fin du fichier
-+bool(true)
-Index: tests/rrd_008.phpt
-===================================================================
---- pecl/rrd/trunk/tests/rrd_008.phpt	(révision 331313)
-+++ pecl/rrd/trunk/tests/rrd_008.phpt	(copie de travail)
-@@ -39,7 +39,7 @@
-   ["xsize"]=>
-   int(497)
-   ["ysize"]=>
--  int(148)
-+  int(%d)
-   ["calcpr"]=>
-   NULL
+ /* {{{ proto string rrd_version()
+  * Gets version of underlying librrd.
+@@ -573,7 +575,9 @@
+ 	PHP_FE(rrd_restore, arginfo_rrd_restore)
+ 	PHP_FE(rrd_tune, arginfo_rrd_tune)
+ 	PHP_FE(rrd_xport, arginfo_rrd_xport)
++#ifdef HAVE_RRDC_DISCONNECT
+ 	PHP_FE(rrdc_disconnect, NULL)
++#endif
+ 	PHP_FE(rrd_version, NULL)
+ 	{NULL, NULL, NULL}
+ };
+@@ -609,7 +613,9 @@
+ static PHP_MSHUTDOWN_FUNCTION(rrd)
+ {
+ 	/* ensure that any connection to rrd cache deamon will be closed */
++#ifdef HAVE_RRDC_DISCONNECT
+ 	rrdc_disconnect();
++#endif
+ 	return SUCCESS;
  }
-Index: tests/rrd_018.phpt
+ /* }}} */
+Index: tests/rrd_012.phpt
 ===================================================================
---- pecl/rrd/trunk/tests/rrd_018.phpt	(révision 331313)
-+++ pecl/rrd/trunk/tests/rrd_018.phpt	(copie de travail)
-@@ -29,7 +29,7 @@
-   ["graph_left"]=>
-   int(67)
-   ["graph_top"]=>
--  int(22)
-+  int(%d)
-   ["graph_width"]=>
-   int(400)
-   ["graph_height"]=>
-@@ -37,7 +37,7 @@
-   ["image_width"]=>
-   int(497)
-   ["image_height"]=>
--  int(148)
-+  int(%d)
-   ["graph_start"]=>
-   int(920804400)
-   ["graph_end"]=>
-Index: tests/rrd_019.phpt
+--- tests/rrd_012.phpt	(révision 332618)
++++ tests/rrd_012.phpt	(copie de travail)
+@@ -11,6 +11,8 @@
+ --FILE--
+ <?php
+ include('data/definition.inc');
++putenv('LANG=C');
++setlocale(LC_ALL, 'C');
+ var_dump($info = rrd_info($data_updatedDb));
+ var_dump($info["filename"] == $data_updatedDb);
+ ?>
+Index: tests/rrd_022.phpt
 ===================================================================
---- pecl/rrd/trunk/tests/rrd_019.phpt	(révision 331313)
-+++ pecl/rrd/trunk/tests/rrd_019.phpt	(copie de travail)
-@@ -34,7 +34,7 @@
-   ["graph_left"]=>
-   int(67)
-   ["graph_top"]=>
--  int(22)
-+  int(%d)
-   ["graph_width"]=>
-   int(400)
-   ["graph_height"]=>
-@@ -42,7 +42,7 @@
-   ["image_width"]=>
-   int(497)
-   ["image_height"]=>
--  int(148)
-+  int(%d)
-   ["graph_start"]=>
-   int(920804400)
-   ["graph_end"]=>
+--- tests/rrd_022.phpt	(révision 332618)
++++ tests/rrd_022.phpt	(copie de travail)
+@@ -1,7 +1,13 @@
+ --TEST--
+ rrdc_disconnect test
+ --SKIPIF--
+-<?php include('skipif.inc'); ?>
++<?php
++include('skipif.inc');
++if (!function_exists("rrdc_disconnect")) {
++	die("skip rrdc_disconnect only in rrdtool >= 1.4");
++}
++
++?>
+ --FILE--
+ <?php
+ var_dump(rrdc_disconnect());
diff --git a/sources b/sources
index 268489f..231e242 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-e596a5a68248bd9edc6d0b6a24054f04  rrd-1.1.1.tgz
+edd7873d9205d987ba4ec8bf6ad38392  rrd-1.1.2.tgz


More information about the scm-commits mailing list