svn commit: r364957 - in head/net-mgmt/cacti: . files
Lars Engels
lars.engels at 0x20.net
Fri Aug 15 12:47:48 UTC 2014
On Fri, Aug 15, 2014 at 10:43:41AM +0000, Kurt Jaeger wrote:
> Author: pi
> Date: Fri Aug 15 10:43:41 2014
> New Revision: 364957
> URL: http://svnweb.freebsd.org/changeset/ports/364957
> QAT: https://qat.redports.org/buildarchive/r364957/
>
> Log:
> net-mgmt/cacti: add stage support
>
> PR: 192618
> Submitted by: Dennis Glatting <freebsd at pki2.com>
>
> Added:
> head/net-mgmt/cacti/files/patch-include__global.php (contents, props changed)
> head/net-mgmt/cacti/files/patch-include__global_settings.php (contents, props changed)
> head/net-mgmt/cacti/files/patch-install__index.php (contents, props changed)
> head/net-mgmt/cacti/files/patch-lib__rrd.php (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__diskfree.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__linux_memory.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__loadavg.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__loadavg_multi.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__ping.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__query_unix_partitions.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__unix_processes.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__unix_tcp_connections.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__unix_users.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__weatherbug.pl (contents, props changed)
> head/net-mgmt/cacti/files/patch-scripts__webhits.pl (contents, props changed)
> Deleted:
> head/net-mgmt/cacti/files/patch-lib-rrd.php
> head/net-mgmt/cacti/files/patch-scripts-diskfree.pl
> head/net-mgmt/cacti/files/patch-scripts-ping.pl
> head/net-mgmt/cacti/files/pkg-install.in
> Modified:
> head/net-mgmt/cacti/Makefile
> head/net-mgmt/cacti/distinfo
> head/net-mgmt/cacti/files/pkg-message.in
> head/net-mgmt/cacti/pkg-plist
>
> Modified: head/net-mgmt/cacti/Makefile
> ==============================================================================
> --- head/net-mgmt/cacti/Makefile Fri Aug 15 10:11:10 2014 (r364956)
> +++ head/net-mgmt/cacti/Makefile Fri Aug 15 10:43:41 2014 (r364957)
> @@ -1,18 +1,15 @@
> -# Created by: Vincent Tantardini <vinc at freebsd-fr.org>
> # $FreeBSD$
>
> PORTNAME= cacti
> PORTVERSION= 0.8.8b${PATCHLEVEL}
> -PORTREVISION= 2
> +PORTREVISION= 3
> CATEGORIES= net-mgmt www
> MASTER_SITES= http://www.cacti.net/downloads/
> -DISTNAME= ${PORTNAME}-${SITEDISTVERSION}
>
> # Vendor's patches
> PATCH_SITES= http://www.cacti.net/downloads/patches/${SITEDISTVERSION}/
> -PATCHFILES=
> +PATCHFILES= security.patch
> PATCH_DIST_STRIP= -p1
> -PATCHLEVEL=
>
> MAINTAINER= ports at FreeBSD.org
> COMMENT= Web-driven graphing interface for RRDTool
> @@ -28,35 +25,35 @@ USE_PHP= mysql pcre session sockets snmp
> WANT_PHP_WEB= yes
> NO_BUILD= yes
> PKGMESSAGE= ${WRKDIR}/pkg-message
> -PKGINSTALL= ${WRKDIR}/pkg-install
> -SUB_FILES= pkg-message pkg-install
> +SUB_FILES= pkg-message
>
> CACTIDIR?= share/cacti
> CACTIUSER?= cacti
> -CACTIGROUP?= ${CACTIUSER}
> +CACTIGROUP?= cacti
> +
> +USERS?= ${CACTIUSER}
> +GROUPS?= ${CACTIGROUP}
> +
> WRKSRC= ${WRKDIR}/${PORTNAME}-${SITEDISTVERSION}
>
> SITEDISTVERSION= ${PORTVERSION:S/${PATCHLEVEL}$//}
>
> -PLIST_SUB+= CACTIDIR=${CACTIDIR}
> +PLIST_SUB+= CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
> + CACTIGROUP=${CACTIGROUP}
> SUB_LIST+= CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
> CACTIGROUP=${CACTIGROUP}
>
> -NO_STAGE= yes
> post-patch:
> @${FIND} ${WRKSRC} -name \*.orig -delete; \
> - ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig
> -
> -pre-install:
> - @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
> + ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.sample
> + ${RM} -r ${WRKSRC}/log ${WRKSRC}/rra
>
> do-install:
> - @${MKDIR} ${PREFIX}/${CACTIDIR}; \
> - ${CP} -R ${WRKSRC}/* ${PREFIX}/${CACTIDIR}/; \
> - if [ ! -f ${PREFIX}/${CACTIDIR}/include/config.php ]; then \
> - ${CP} ${PREFIX}/${CACTIDIR}/include/config.php.orig \
> - ${PREFIX}/${CACTIDIR}/include/config.php; \
> - fi; \
> + ${MKDIR} ${STAGEDIR}/${PREFIX}/${CACTIDIR}
> + ${MKDIR} ${STAGEDIR}/var/log/cacti
> + ${MKDIR} ${STAGEDIR}/var/db/cacti/rra
> + ${MKDIR} ${STAGEDIR}/var/db/cacti/scripts
> + ${CP} -R ${WRKSRC}/* ${STAGEDIR}/${PREFIX}/${CACTIDIR}
> if [ -f ${PREFIX}/${CACTIDIR}/include/db-settings.php ]; then \
> ${ECHO_CMD} "======================================================================="; \
> ${ECHO_CMD} "WARNING! You have to move DB settings from"; \
> @@ -64,8 +61,4 @@ do-install:
> ${ECHO_CMD} "${PREFIX}/${CACTIDIR}/include/config.php and remove db-settings.php"; \
> fi
>
> -post-install:
> - @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
> - @${CAT} ${PKGMESSAGE}
> -
> .include <bsd.port.mk>
>
> Modified: head/net-mgmt/cacti/distinfo
> ==============================================================================
> --- head/net-mgmt/cacti/distinfo Fri Aug 15 10:11:10 2014 (r364956)
> +++ head/net-mgmt/cacti/distinfo Fri Aug 15 10:43:41 2014 (r364957)
> @@ -1,2 +1,4 @@
> SHA256 (cacti-0.8.8b.tar.gz) = ef0e2a813139e0b4c2e066f0fdae1f4ad086bef0aa23446055df6331cb1af98c
> SIZE (cacti-0.8.8b.tar.gz) = 2272130
> +SHA256 (security.patch) = 73758bdf3f7846875f1620c35d1d982fa27366b053d8bd87363c618e7747c163
> +SIZE (security.patch) = 6909
>
> Added: head/net-mgmt/cacti/files/patch-include__global.php
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/net-mgmt/cacti/files/patch-include__global.php Fri Aug 15 10:43:41 2014 (r364957)
> @@ -0,0 +1,11 @@
> +--- ./include/global.php.orig 2013-08-06 19:31:19.000000000 -0700
> ++++ ./include/global.php 2014-08-11 18:37:08.000000000 -0700
> +@@ -113,7 +113,7 @@
> + $config["library_path"] = preg_replace("/(.*[\/])include/", "\\1lib", dirname(__FILE__));
> + }
> + $config["include_path"] = dirname(__FILE__);
> +-$config["rra_path"] = $config["base_path"] . '/rra';
> ++$config["rra_path"] = '/var/db/cacti/rra';
> +
> + /* colors */
> + $colors["dark_outline"] = "454E53";
>
> Added: head/net-mgmt/cacti/files/patch-include__global_settings.php
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/net-mgmt/cacti/files/patch-include__global_settings.php Fri Aug 15 10:43:41 2014 (r364957)
> @@ -0,0 +1,14 @@
> +--- ./include/global_settings.php.orig 2013-08-06 19:31:19.000000000 -0700
> ++++ ./include/global_settings.php 2014-08-11 18:37:08.000000000 -0700
> +@@ -96,9 +96,9 @@
> + ),
> + "path_cactilog" => array(
> + "friendly_name" => "Cacti Log File Path",
> +- "description" => "The path to your Cacti log file (if blank, defaults to <path_cacti>/log/cacti.log)",
> ++ "description" => "The path to your Cacti log file (if blank, defaults to /var/log/cacti.log)",
> + "method" => "filepath",
> +- "default" => $config["base_path"] . "/log/cacti.log",
> ++ "default" => "/var/log/cacti/cacti.log",
> + "max_length" => "255"
> + ),
> + "pollerpaths_header" => array(
>
> Added: head/net-mgmt/cacti/files/patch-install__index.php
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/net-mgmt/cacti/files/patch-install__index.php Fri Aug 15 10:43:41 2014 (r364957)
> @@ -0,0 +1,11 @@
> +--- ./install/index.php.orig 2013-08-06 19:31:19.000000000 -0700
> ++++ ./install/index.php 2014-08-11 18:45:19.000000000 -0700
> +@@ -267,7 +267,7 @@
> + if (config_value_exists("path_cactilog")) {
> + $input["path_cactilog"]["default"] = read_config_option("path_cactilog");
> + } else {
> +- $input["path_cactilog"]["default"] = $config["base_path"] . "/log/cacti.log";
> ++ $input["path_cactilog"]["default"] = "/var/log/cacti/cacti.log";
> + }
> +
> + /* SNMP Version */
>
> Added: head/net-mgmt/cacti/files/patch-lib__rrd.php
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/net-mgmt/cacti/files/patch-lib__rrd.php Fri Aug 15 10:43:41 2014 (r364957)
> @@ -0,0 +1,35 @@
> +--- ./lib/rrd.php.orig 2014-08-11 17:34:23.000000000 -0700
> ++++ ./lib/rrd.php 2014-08-11 17:34:23.000000000 -0700
> +@@ -1343,20 +1343,20 @@
> + $need_rrd_nl = TRUE;
> +
> + if ($graph_item_types{$graph_item["graph_type_id"]} == "COMMENT") {
> ++ # perform variable substitution first (in case this will yield an empty results or brings command injection problems)
> ++ $comment_arg = rrd_substitute_host_query_data($graph_variables["text_format"][$graph_item_id], $graph, $graph_item);
> ++ # next, compute the argument of the COMMENT statement and perform injection counter measures
> ++ if (trim($comment_arg) == '') { # an empty COMMENT must be treated with care
> ++ $comment_arg = cacti_escapeshellarg(' ' . $hardreturn[$graph_item_id]);
> ++ } else {
> ++ $comment_arg = cacti_escapeshellarg($comment_arg . $hardreturn[$graph_item_id]);
> ++ }
> ++
> ++ # create rrdtool specific command line
> + if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
> +- $comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":" . str_replace(":", "\:", cacti_escapeshellarg($graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id])) . " ";
> +- if (trim($comment_string) == 'COMMENT:"\n"') {
> +- $txt_graph_items .= 'COMMENT:" \n"'; # rrdtool will skip a COMMENT that holds a NL only; so add a blank to make NL work
> +- } else if (trim($comment_string) != "COMMENT:\"\"") {
> +- $txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item);
> +- }
> ++ $txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":" . str_replace(":", "\:", $comment_arg) . " ";
> + }else {
> +- $comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":" . cacti_escapeshellarg($graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id]) . " ";
> +- if (trim($comment_string) == 'COMMENT:"\n"') {
> +- $txt_graph_items .= 'COMMENT:" \n"'; # rrdtool will skip a COMMENT that holds a NL only; so add a blank to make NL work
> +- } else if (trim($comment_string) != "COMMENT:\"\"") {
> +- $txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item);
> +- }
> ++ $txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":" . $comment_arg . " ";
> + }
> + }elseif (($graph_item_types{$graph_item["graph_type_id"]} == "GPRINT") && (!isset($graph_data_array["graph_nolegend"]))) {
> + $graph_variables["text_format"][$graph_item_id] = str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]); /* escape colons */
>
> Added: head/net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl Fri Aug 15 10:43:41 2014 (r364957)
> @@ -0,0 +1,8 @@
> +--- ./scripts/3com_cable_modem.pl.orig 2013-08-06 19:31:19.000000000 -0700
> ++++ ./scripts/3com_cable_modem.pl 2014-08-11 18:37:08.000000000 -0700
> +@@ -1,4 +1,4 @@
> +-#!/usr/bin/perl
> ++#!/usr/local/bin/perl
^^^^^^^^^^^^^^^^^^^^^^^^^^
This is better handled with USE= shebangfix
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 618 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-ports-all/attachments/20140815/1ba3eb72/attachment.sig>
More information about the svn-ports-all
mailing list