diff options
author | Jeroen Roovers <jer@gentoo.org> | 2015-06-14 08:00:16 +0000 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2015-06-14 08:00:16 +0000 |
commit | ac93398be7e2de074a2efc692bac4895e8b96367 (patch) | |
tree | a7a66a8d15381ec6dddf1395e7fdf47fe64d067e /net-analyzer | |
parent | Drop old. (diff) | |
download | gentoo-2-ac93398be7e2de074a2efc692bac4895e8b96367.tar.gz gentoo-2-ac93398be7e2de074a2efc692bac4895e8b96367.tar.bz2 gentoo-2-ac93398be7e2de074a2efc692bac4895e8b96367.zip |
Add build/compatibility patches (bug #552030 by Tomasz Chilinski).
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key A792A613)
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/cacti-spine/ChangeLog | 12 | ||||
-rw-r--r-- | net-analyzer/cacti-spine/cacti-spine-0.8.8d-r1.ebuild (renamed from net-analyzer/cacti-spine/cacti-spine-0.8.8d.ebuild) | 35 | ||||
-rw-r--r-- | net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-mysql.patch | 11 | ||||
-rw-r--r-- | net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-net-snmp.patch | 30 | ||||
-rw-r--r-- | net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-ping.patch | 11 | ||||
-rw-r--r-- | net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-polling_time.patch | 220 | ||||
-rw-r--r-- | net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-snmp_spine_close.patch | 10 |
7 files changed, 309 insertions, 20 deletions
diff --git a/net-analyzer/cacti-spine/ChangeLog b/net-analyzer/cacti-spine/ChangeLog index 3ab0c67b2580..cbe66d07bcee 100644 --- a/net-analyzer/cacti-spine/ChangeLog +++ b/net-analyzer/cacti-spine/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for net-analyzer/cacti-spine # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/cacti-spine/ChangeLog,v 1.40 2015/06/12 05:47:52 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/cacti-spine/ChangeLog,v 1.41 2015/06/14 08:00:16 jer Exp $ + +*cacti-spine-0.8.8d-r1 (14 Jun 2015) + + 14 Jun 2015; Jeroen Roovers <jer@gentoo.org> -cacti-spine-0.8.8d.ebuild, + +cacti-spine-0.8.8d-r1.ebuild, +files/cacti-spine-0.8.8d-mysql.patch, + +files/cacti-spine-0.8.8d-net-snmp.patch, + +files/cacti-spine-0.8.8d-ping.patch, + +files/cacti-spine-0.8.8d-polling_time.patch, + +files/cacti-spine-0.8.8d-snmp_spine_close.patch: + Add build/compatibility patches (bug #552030 by Tomasz Chilinski). *cacti-spine-0.8.8d (12 Jun 2015) diff --git a/net-analyzer/cacti-spine/cacti-spine-0.8.8d.ebuild b/net-analyzer/cacti-spine/cacti-spine-0.8.8d-r1.ebuild index e16d95bb5411..8ed06131eb29 100644 --- a/net-analyzer/cacti-spine/cacti-spine-0.8.8d.ebuild +++ b/net-analyzer/cacti-spine/cacti-spine-0.8.8d-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/cacti-spine/cacti-spine-0.8.8d.ebuild,v 1.1 2015/06/12 05:47:52 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/cacti-spine/cacti-spine-0.8.8d-r1.ebuild,v 1.1 2015/06/14 08:00:16 jer Exp $ EAPI=5 inherit autotools eutils @@ -15,15 +15,24 @@ LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" -DEPEND="net-analyzer/net-snmp +DEPEND=" dev-libs/openssl:* - virtual/mysql" -RDEPEND="${DEPEND} - >net-analyzer/cacti-0.8.8" + net-analyzer/net-snmp + virtual/mysql +" +RDEPEND=" + ${DEPEND} + >net-analyzer/cacti-0.8.8 +" src_prepare() { - # Patch configure.ac to replace AM_CONFIG_HEADER with AC_CONFIG_HEADERS - epatch "${FILESDIR}/${PN}-0.8.8d-fix-ac-macro.patch" + epatch \ + "${FILESDIR}"/${PN}-0.8.8d-fix-ac-macro.patch \ + "${FILESDIR}"/${PN}-0.8.8d-net-snmp.patch \ + "${FILESDIR}"/${PN}-0.8.8d-mysql.patch \ + "${FILESDIR}"/${PN}-0.8.8d-ping.patch \ + "${FILESDIR}"/${PN}-0.8.8d-polling_time.patch \ + "${FILESDIR}"/${PN}-0.8.8d-snmp_spine_close.patch sed -i -e 's/^bin_PROGRAMS/sbin_PROGRAMS/' Makefile.am AT_M4DIR="config" eautoreconf @@ -36,15 +45,3 @@ src_install() { newins spine.conf{.dist,} dodoc ChangeLog README } - -pkg_postinst() { - elog "Please see the cacti's site for installation instructions:" - elog - elog "http://cacti.net/spine_install.php" - echo - ewarn "/etc/spine.conf should be readable by webserver, thus after you" - ewarn "decide on webserver do not forget to run the following command:" - ewarn - ewarn " # chown root:<wwwgroup> /etc/spine.conf" - echo -} diff --git a/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-mysql.patch b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-mysql.patch new file mode 100644 index 000000000000..d60653678a2c --- /dev/null +++ b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-mysql.patch @@ -0,0 +1,11 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -239,7 +239,7 @@ + fi + CFLAGS="-I$MYSQL_INC_DIR $CFLAGS" + +-AC_CHECK_LIB(mysqlclient_r,mysql_init, LIBS="-lmysqlclient_r", ++AC_CHECK_LIB(mysqlclient_r,mysql_init, LIBS="$LIBS -lmysqlclient_r", + AC_MSG_ERROR([MySQL libraries not found]) + ) + diff --git a/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-net-snmp.patch b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-net-snmp.patch new file mode 100644 index 000000000000..43aa4d3f95df --- /dev/null +++ b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-net-snmp.patch @@ -0,0 +1,30 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -254,14 +254,14 @@ + ) + + AC_MSG_CHECKING([if Net-SNMP needs crypto support]) +-AC_TRY_COMPILE([#include <net-snmp-config.h>], [exit(USE_OPENSSL != 1);], ++AC_TRY_COMPILE([#include <net-snmp/net-snmp-config.h>], [exit(USE_OPENSSL != 1);], + [ AC_MSG_RESULT(yes) + SNMP_SSL=yes + ], + AC_MSG_RESULT(no) + ) + +-AC_TRY_COMPILE([ #include <net-snmp-config.h> ++AC_TRY_COMPILE([ #include <net-snmp/net-snmp-config.h> + #include <net-snmp/utilities.h> + #include <net-snmp/net-snmp-includes.h> + #include <net-snmp/config_api.h> +--- a/common.h ++++ b/common.h +@@ -125,7 +125,7 @@ + # include <priv.h> + #endif + +-#ifdef USE_NET_SNMP ++#ifdef HAVE_LIBNETSNMP + #undef PACKAGE_NAME + #undef PACKAGE_VERSION + #undef PACKAGE_BUGREPORT diff --git a/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-ping.patch b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-ping.patch new file mode 100644 index 000000000000..0d94674ce5a3 --- /dev/null +++ b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-ping.patch @@ -0,0 +1,11 @@ +--- a/ping.c ++++ b/ping.c +@@ -813,7 +813,7 @@ + int rv; + + buf = malloc(len*sizeof(char)); +- memset(buf, 0, sizeof(buf)); ++ memset(buf, 0, len*sizeof(char)); + + while (1) { + rv = gethostbyname_r(hostname, &result_buf, buf, len, diff --git a/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-polling_time.patch b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-polling_time.patch new file mode 100644 index 000000000000..98fd8b68527b --- /dev/null +++ b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-polling_time.patch @@ -0,0 +1,220 @@ +--- a/poller.c ++++ b/poller.c +@@ -168,7 +168,6 @@ + MYSQL mysql; + MYSQL_RES *result; + MYSQL_ROW row; +- MYSQL_FIELD *field; + + db_connect(set.dbdb, &mysql); + +@@ -218,8 +217,7 @@ + "status, status_event_count, status_fail_date, " + "status_rec_date, status_last_error, " + "min_time, max_time, cur_time, avg_time, " +- "total_polls, failed_polls, availability, snmp_sysUptimeInstance, snmp_sysDescr, snmp_sysObjectID, " +- "snmp_sysContact, snmp_sysName, snmp_sysLocation" ++ "total_polls, failed_polls, availability " + " FROM host" + " WHERE id=%i", host_id); + +@@ -289,8 +287,7 @@ + "status, status_event_count, status_fail_date, " + "status_rec_date, status_last_error, " + "min_time, max_time, cur_time, avg_time, " +- "total_polls, failed_polls, availability, snmp_sysUptimeInstance, snmp_sysDescr, snmp_sysObjectID, " +- "snmp_sysContact, snmp_sysName, snmp_sysLocation" ++ "total_polls, failed_polls, availability " + " FROM host" + " WHERE id=%i", host_id); + +@@ -379,44 +376,38 @@ + + if (row) { + /* initialize variables first */ +- host->id = 0; // 0 +- host->hostname[0] = '\0'; // 1 +- host->snmp_session = NULL; // - +- host->snmp_community[0] = '\0'; // 2 +- host->snmp_version = 1; // 3 +- host->snmp_username[0] = '\0'; // 4 +- host->snmp_password[0] = '\0'; // 5 +- host->snmp_auth_protocol[0] = '\0'; // 6 +- host->snmp_priv_passphrase[0] = '\0'; // 7 +- host->snmp_priv_protocol[0] = '\0'; // 8 +- host->snmp_context[0] = '\0'; // 9 +- host->snmp_port = 161; // 10 +- host->snmp_timeout = 500; // 11 +- host->snmp_retries = set.snmp_retries; // - +- host->max_oids = 10; // 12 +- host->availability_method = 0; // 13 +- host->ping_method = 0; // 14 +- host->ping_port = 23; // 15 +- host->ping_timeout = 500; // 16 +- host->ping_retries = 2; // 17 +- host->status = HOST_UP; // 18 +- host->status_event_count = 0; // 19 +- host->status_fail_date[0] = '\0'; // 20 +- host->status_rec_date[0] = '\0'; // 21 +- host->status_last_error[0] = '\0'; // 22 +- host->min_time = 0; // 23 +- host->max_time = 0; // 24 +- host->cur_time = 0; // 25 +- host->avg_time = 0; // 26 +- host->total_polls = 0; // 27 +- host->failed_polls = 0; // 28 +- host->availability = 100; // 29 +- host->snmp_sysUpTimeInstance = 0; // 30 +- host->snmp_sysDescr[0] = '\0'; // 31 +- host->snmp_sysObjectID[0] = '\0'; // 32 +- host->snmp_sysContact[0] = '\0'; // 33 +- host->snmp_sysName[0] = '\0'; // 34 +- host->snmp_sysLocation[0] = '\0'; // 35 ++ host->id = 0; ++ host->hostname[0] = '\0'; ++ host->snmp_session = NULL; ++ host->snmp_community[0] = '\0'; ++ host->snmp_version = 1; ++ host->snmp_username[0] = '\0'; ++ host->snmp_password[0] = '\0'; ++ host->snmp_auth_protocol[0] = '\0'; ++ host->snmp_priv_passphrase[0] = '\0'; ++ host->snmp_priv_protocol[0] = '\0'; ++ host->snmp_context[0] = '\0'; ++ host->snmp_port = 161; ++ host->snmp_timeout = 500; ++ host->snmp_retries = set.snmp_retries; ++ host->max_oids = 10; ++ host->availability_method = 0; ++ host->ping_method = 0; ++ host->ping_port = 23; ++ host->ping_timeout = 500; ++ host->ping_retries = 2; ++ host->status = HOST_UP; ++ host->status_event_count = 0; ++ host->status_fail_date[0] = '\0'; ++ host->status_rec_date[0] = '\0'; ++ host->status_last_error[0] = '\0'; ++ host->min_time = 0; ++ host->max_time = 0; ++ host->cur_time = 0; ++ host->avg_time = 0; ++ host->total_polls = 0; ++ host->failed_polls = 0; ++ host->availability = 100; + + /* populate host structure */ + host->ignore_host = FALSE; +@@ -460,13 +451,6 @@ + if (row[28] != NULL) host->failed_polls = atoi(row[28]); + if (row[29] != NULL) host->availability = atof(row[29]); + +- if (row[30] != NULL) host->snmp_sysUpTimeInstance=atoi(row[30]); +- if (row[31] != NULL) STRNCOPY(host->snmp_sysDescr, row[31]); +- if (row[32] != NULL) STRNCOPY(host->snmp_sysObjectID, row[32]); +- if (row[33] != NULL) STRNCOPY(host->snmp_sysContact, row[33]); +- if (row[34] != NULL) STRNCOPY(host->snmp_sysName, row[34]); +- if (row[35] != NULL) STRNCOPY(host->snmp_sysLocation, row[35]); +- + /* correct max_oid bounds issues */ + if ((host->max_oids == 0) || (host->max_oids > 100)) { + SPINE_LOG(("Host[%i] TH[%i] WARNING: Max OIDS is out of range with value of '%i'. Resetting to default of 5", host_id, host_thread, host->max_oids)); +@@ -510,12 +494,6 @@ + host->ignore_host = FALSE; + if (host_thread == 1) { + update_host_status(HOST_UP, host, ping, host->availability_method); +- +- if (host->availability_method == AVAIL_SNMP) { +- get_system_information(host, &mysql); +- +- +- } + } + }else{ + host->ignore_host = TRUE; +@@ -531,9 +509,7 @@ + "SET status='%i', status_event_count='%i', status_fail_date='%s'," + " status_rec_date='%s', status_last_error='%s', min_time='%f'," + " max_time='%f', cur_time='%f', avg_time='%f', total_polls='%i'," +- " failed_polls='%i', availability='%.4f', snmp_sysDescr='%s', " +- " snmp_sysObjectID='%s', snmp_sysUpTimeInstance='%i', " +- " snmp_sysContact='%s', snmp_sysName='%s', snmp_sysLocation='%s' " ++ " failed_polls='%i', availability='%.4f' " + "WHERE id='%i'", + host->status, + host->status_event_count, +@@ -547,12 +523,6 @@ + host->total_polls, + host->failed_polls, + host->availability, +- host->snmp_sysDescr, +- host->snmp_sysObjectID, +- host->snmp_sysUpTimeInstance, +- host->snmp_sysContact, +- host->snmp_sysName, +- host->snmp_sysLocation, + host->id); + + db_insert(&mysql, update_sql); +@@ -1285,10 +1255,6 @@ + poll_time = get_time_as_double() - poll_time; + SPINE_LOG_MEDIUM(("Host[%i] TH[%i] Total Time: %5.2g Seconds", host_id, host_thread, poll_time)); + +- query1[0] = '\0'; +- snprintf(query1, BUFSIZE, "UPDATE host SET polling_time='%g' WHERE id=%i", poll_time, host_id); +- db_query(&mysql, query1); +- + mysql_close(&mysql); + + #ifndef OLD_MYSQL +@@ -1343,50 +1309,6 @@ + + } + +-void get_system_information(host_t *host, MYSQL *mysql) { +- snmp_oids_t *snmp_oids; +- +- if (set.mibs) { +- int num_oids = 6; +- +- /* create an array for snmp oids */ +- snmp_oids = (snmp_oids_t *) calloc(num_oids, sizeof(snmp_oids_t)); +- +- /* initialize all the memory to insure we don't get issues */ +- memset(snmp_oids, 0, sizeof(snmp_oids_t)*num_oids); +- +- STRNCOPY(snmp_oids[0].oid, ".1.3.6.1.2.1.1.1.0"); +- STRNCOPY(snmp_oids[1].oid, ".1.3.6.1.2.1.1.2.0"); +- STRNCOPY(snmp_oids[2].oid, ".1.3.6.1.2.1.1.3.0"); +- STRNCOPY(snmp_oids[3].oid, ".1.3.6.1.2.1.1.4.0"); +- STRNCOPY(snmp_oids[4].oid, ".1.3.6.1.2.1.1.5.0"); +- STRNCOPY(snmp_oids[5].oid, ".1.3.6.1.2.1.1.6.0"); +- snmp_get_multi(host, snmp_oids, num_oids); +- +- mysql_real_escape_string(mysql, host->snmp_sysDescr, snmp_oids[0].result, strlen(snmp_oids[0].result)); +- mysql_real_escape_string(mysql, host->snmp_sysObjectID, snmp_oids[1].result, strlen(snmp_oids[1].result)); +- host->snmp_sysUpTimeInstance = atoi(snmp_oids[2].result); +- mysql_real_escape_string(mysql, host->snmp_sysContact, snmp_oids[3].result, strlen(snmp_oids[3].result)); +- mysql_real_escape_string(mysql, host->snmp_sysName, snmp_oids[4].result, strlen(snmp_oids[4].result)); +- mysql_real_escape_string(mysql, host->snmp_sysLocation, snmp_oids[5].result, strlen(snmp_oids[5].result)); +- }else{ +- int num_oids = 1; +- +- /* create an array for snmp oids */ +- snmp_oids = (snmp_oids_t *) calloc(num_oids, sizeof(snmp_oids_t)); +- +- /* initialize all the memory to insure we don't get issues */ +- memset(snmp_oids, 0, sizeof(snmp_oids_t)*num_oids); +- +- STRNCOPY(snmp_oids[0].oid, ".1.3.6.1.2.1.1.3.0"); +- snmp_get_multi(host, snmp_oids, num_oids); +- +- host->snmp_sysUpTimeInstance = atoi(snmp_oids[2].result); +- } +- +- free(snmp_oids); +-} +- + /*! \fn int validate_result(char *result) + * \brief validates the output from the polling action is valid + * \param result the value to be checked for legality diff --git a/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-snmp_spine_close.patch b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-snmp_spine_close.patch new file mode 100644 index 000000000000..f39e8c6575e1 --- /dev/null +++ b/net-analyzer/cacti-spine/files/cacti-spine-0.8.8d-snmp_spine_close.patch @@ -0,0 +1,10 @@ +--- a/snmp.h ++++ b/snmp.h +@@ -32,6 +32,7 @@ + */ + + extern void snmp_spine_init(void); ++extern void snmp_spine_close(void); + extern void *snmp_host_init(int host_id, char *hostname, int snmp_version, char *snmp_community, char *snmp_username, char *snmp_password, char *snmp_auth_protocol, char *snmp_priv_passphrase, char *snmp_priv_protocol, char *snmp_context, int snmp_port, int snmp_timeout); + extern void snmp_host_cleanup(void *snmp_session); + extern char *snmp_get(host_t *current_host, char *snmp_oid); |