diff --git a/php-pecl-rrd.spec b/php-pecl-rrd.spec index 930d475..c5df083 100644 --- a/php-pecl-rrd.spec +++ b/php-pecl-rrd.spec @@ -13,12 +13,16 @@ Summary: PHP Bindings for rrdtool Name: php-pecl-rrd Version: 1.1.1 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Group: Development/Languages URL: http://pecl.php.net/package/rrd -Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +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 BuildRequires: php-devel >= 5.3.2 BuildRequires: rrdtool @@ -50,11 +54,16 @@ system for time series data. %prep %setup -c -q -extver=$(sed -n '/#define PHP_RRD_VERSION/{s/.* "//;s/".*$//;p}' %{pecl_name}-%{version}%{?pre}/php_rrd.h) +cd %{pecl_name}-%{version} + +%patch0 -p3 -b .svn + +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 .. cat > %{pecl_name}.ini << 'EOF' ; Enable %{pecl_name} extension module @@ -98,12 +107,7 @@ if grep -q "FAILED TEST" rpmtests.log; then diff -u tests/$(basename $t .diff).exp tests/$(basename $t .diff).out || : done - # tests only succeed with some rrdtool version (> 1.4.0 but < 1.4.7) - # because of difference between image size / position - # http://pecl.php.net/bugs/22642 - - # only consider result of rrd_version test - [ -f tests/rrd_020.diff ] && exit 1 + exit 1 fi @@ -129,6 +133,10 @@ fi %changelog +* Mon Sep 09 2013 Remi Collet - 1.1.1-2 +- patch for build warning +- patch to fix test result with recent rrdtool + * Mon Sep 09 2013 Remi Collet - 1.1.1-1 - Update to 1.1.1 diff --git a/rrd-svn.patch b/rrd-svn.patch new file mode 100644 index 0000000..ef63cdc --- /dev/null +++ b/rrd-svn.patch @@ -0,0 +1,145 @@ +--- 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 + + 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; + + /* 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; + + 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 @@ + + return 1; + } +-/* }}} */ +\ 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 + } +Index: tests/rrd_018.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 +=================================================================== +--- 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"]=>