aboutsummaryrefslogtreecommitdiff
path: root/databases/pecl-rrd
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2016-01-12 18:22:26 +0000
committerRenato Botelho <garga@FreeBSD.org>2016-01-12 18:22:26 +0000
commit679b5ef334a776d84c2a093ac14f9f665cc93612 (patch)
treeb04be2bc000dca9e1a6adf701f8164c725fd5c29 /databases/pecl-rrd
parentf545367a0676627f5290cb19a7bb72e8a5a036a5 (diff)
Notes
Diffstat (limited to 'databases/pecl-rrd')
-rw-r--r--databases/pecl-rrd/Makefile2
-rw-r--r--databases/pecl-rrd/files/patch-config.m424
-rw-r--r--databases/pecl-rrd/files/patch-rrd.c81
3 files changed, 106 insertions, 1 deletions
diff --git a/databases/pecl-rrd/Makefile b/databases/pecl-rrd/Makefile
index 050e4247418c..dadff2cc5d36 100644
--- a/databases/pecl-rrd/Makefile
+++ b/databases/pecl-rrd/Makefile
@@ -2,7 +2,7 @@
PORTNAME= rrd
DISTVERSION= 1.1.3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= databases pear
MASTER_SITES= http://pecl.php.net/get/
PKGNAMEPREFIX= pecl-
diff --git a/databases/pecl-rrd/files/patch-config.m4 b/databases/pecl-rrd/files/patch-config.m4
new file mode 100644
index 000000000000..919d9a8b87b1
--- /dev/null
+++ b/databases/pecl-rrd/files/patch-config.m4
@@ -0,0 +1,24 @@
+--- config.m4.orig 2016-01-12 12:40:08 UTC
++++ config.m4
+@@ -59,9 +59,11 @@ if test "$PHP_RRD" != "no"; then
+ LDFLAGS="$LDFLAGS -L$RRDTOOL_LIBDIR"
+
+ dnl rrd_graph_v is available in 1.3.0+
++ rrd_graph_c=""
+ PHP_CHECK_FUNC(rrd_graph_v, rrd)
+- if test "$ac_cv_func_rrd_graph_v" != yes; then
+- AC_MSG_ERROR([rrd lib version seems older than 1.3.0, update to 1.3.0+])
++ if test "$ac_cv_func_rrd_graph_v" == yes; then
++ AC_DEFINE(HAVE_RRD_GRAPH, 1, [ ])
++ rrd_graph_c="rrd_graph.c"
+ fi
+
+ dnl rrd_lastupdate_r available in 1.4.0+
+@@ -72,6 +74,6 @@ if test "$PHP_RRD" != "no"; then
+
+ LDFLAGS=$old_LDFLAGS
+
+- PHP_NEW_EXTENSION(rrd, rrd.c rrd_graph.c rrd_create.c rrd_update.c rrd_info.c, $ext_shared)
++ PHP_NEW_EXTENSION(rrd, rrd.c $rrd_graph_c rrd_create.c rrd_update.c rrd_info.c, $ext_shared)
+ PHP_SUBST(RRD_SHARED_LIBADD)
+ fi
diff --git a/databases/pecl-rrd/files/patch-rrd.c b/databases/pecl-rrd/files/patch-rrd.c
new file mode 100644
index 000000000000..2140a8be3c92
--- /dev/null
+++ b/databases/pecl-rrd/files/patch-rrd.c
@@ -0,0 +1,81 @@
+--- rrd.c.orig 2016-01-12 12:42:39 UTC
++++ rrd.c
+@@ -19,7 +19,9 @@
+ #include <rrd.h>
+
+ #include "php_rrd.h"
++#ifdef HAVE_RRD_GRAPH
+ #include "rrd_graph.h"
++#endif
+ #include "rrd_create.h"
+ #include "rrd_update.h"
+ #include "rrd_info.h"
+@@ -387,6 +389,7 @@ PHP_FUNCTION(rrd_tune)
+ }
+ /* }}} */
+
++#ifdef HAVE_RRD_GRAPH
+ /* {{{ proto array rrd_xport(array options)
+ * Creates a graph based on options passed via an array
+ */
+@@ -480,6 +483,7 @@ PHP_FUNCTION(rrd_xport)
+ free(data);
+ }
+ /* }}} */
++#endif
+
+ #ifdef HAVE_RRDC_DISCONNECT
+ /* {{{ proto void rrdc_disconnect()
+@@ -537,18 +541,22 @@ ZEND_BEGIN_ARG_INFO(arginfo_rrd_tune, 0)
+ ZEND_ARG_INFO(0, options)
+ ZEND_END_ARG_INFO()
+
++#ifdef HAVE_RRD_GRAPH
+ ZEND_BEGIN_ARG_INFO(arginfo_rrd_xport, 0)
+ ZEND_ARG_INFO(0, options)
+ ZEND_END_ARG_INFO()
++#endif
+
+ ZEND_BEGIN_ARG_INFO(arginfo_rrd_info, 0)
+ ZEND_ARG_INFO(0, file)
+ ZEND_END_ARG_INFO()
+
++#ifdef HAVE_RRD_GRAPH
+ ZEND_BEGIN_ARG_INFO(arginfo_rrd_graph, 0)
+ ZEND_ARG_INFO(0, file)
+ ZEND_ARG_INFO(0, options)
+ ZEND_END_ARG_INFO()
++#endif
+
+ ZEND_BEGIN_ARG_INFO(arginfo_rrd_create, 0)
+ ZEND_ARG_INFO(0, filename)
+@@ -565,7 +573,9 @@ ZEND_END_ARG_INFO()
+ static zend_function_entry rrd_functions[] = {
+ PHP_FE(rrd_update, arginfo_rrd_update)
+ PHP_FE(rrd_create, arginfo_rrd_create)
++#ifdef HAVE_RRD_GRAPH
+ PHP_FE(rrd_graph, arginfo_rrd_graph)
++#endif
+ PHP_FE(rrd_error, NULL)
+ PHP_FE(rrd_fetch, arginfo_rrd_fetch)
+ PHP_FE(rrd_first, arginfo_rrd_first)
+@@ -574,7 +584,9 @@ static zend_function_entry rrd_functions
+ PHP_FE(rrd_lastupdate, arginfo_rrd_lastupdate)
+ PHP_FE(rrd_restore, arginfo_rrd_restore)
+ PHP_FE(rrd_tune, arginfo_rrd_tune)
++#ifdef HAVE_RRD_GRAPH
+ PHP_FE(rrd_xport, arginfo_rrd_xport)
++#endif
+ #ifdef HAVE_RRDC_DISCONNECT
+ PHP_FE(rrdc_disconnect, NULL)
+ #endif
+@@ -590,7 +602,9 @@ static zend_function_entry rrd_functions
+ /* {{{ PHP_MINIT_FUNCTION */
+ static PHP_MINIT_FUNCTION(rrd)
+ {
++#ifdef HAVE_RRD_GRAPH
+ rrd_graph_minit(TSRMLS_C);
++#endif
+ rrd_create_minit(TSRMLS_C);
+ rrd_update_minit(TSRMLS_C);
+ return SUCCESS;