diff options
Diffstat (limited to 'net-analyzer/ndoutils')
-rw-r--r-- | net-analyzer/ndoutils/Manifest | 13 | ||||
-rw-r--r-- | net-analyzer/ndoutils/files/format-security.patch | 115 | ||||
-rw-r--r-- | net-analyzer/ndoutils/files/ndo2db.init-nagios3 | 24 | ||||
-rw-r--r-- | net-analyzer/ndoutils/files/ndoutils-2.0.0-asprintf.patch | 6 | ||||
-rw-r--r-- | net-analyzer/ndoutils/files/ndoutils-2.0.0-sleep.patch | 10 | ||||
-rw-r--r-- | net-analyzer/ndoutils/files/openrc-init.patch | 100 | ||||
-rw-r--r-- | net-analyzer/ndoutils/files/sample-config-piddir.patch | 32 | ||||
-rw-r--r-- | net-analyzer/ndoutils/metadata.xml | 5 | ||||
-rw-r--r-- | net-analyzer/ndoutils/ndoutils-2.0.0.ebuild | 67 | ||||
-rw-r--r-- | net-analyzer/ndoutils/ndoutils-2.1.3.ebuild | 89 |
10 files changed, 353 insertions, 108 deletions
diff --git a/net-analyzer/ndoutils/Manifest b/net-analyzer/ndoutils/Manifest index 9f8404f7279c..d24d14253d9e 100644 --- a/net-analyzer/ndoutils/Manifest +++ b/net-analyzer/ndoutils/Manifest @@ -1,8 +1,9 @@ -AUX ndo2db.init-nagios3 482 SHA256 7d5050da70fb61b7ee29f1ac52b7967db2b5b46e784029616607de658f7def40 SHA512 2679ecf2959c07e6b993e32789b592a3bb8a6443412c8f297303c08255d7761f5f9e47e0f68f92dc3487cbe4795403fae9d98c00f83cbf85cb095739162978a3 WHIRLPOOL 95baf3ee178a60c90784c7d1ad9984f20c1edccf1e1224b6a1b610908b57ad273041f44fed5e0a93379e651d3cf3a0f4cbb65b602dab4796f4cecd2512d85e18 -AUX ndoutils-2.0.0-asprintf.patch 172 SHA256 c7db1469e5be1aeeffb03541dcc851094a8c212d6ad2caae3a37776bdb62ee6b SHA512 f70586d71727cb3017bb1b5c10dacf33f4a4c3ece405d544d182258d96a3540a8b95220d181a65c22a0023cf1c4294c8d2061fd1ab7328c371b0254464119a9c WHIRLPOOL 0100d63a892308766ab7922a5bf92ea4e7c4238b383c0ab50eb52f176207df6e4e934b60929f9ca00367c833eebc74d1b1c84162223e78c4f35debabcb39aab5 -AUX ndoutils-2.0.0-sleep.patch 284 SHA256 b89fdf0f7ff20068e04ccec1411e24c76f7ae85350fd11ee7485bd426e4d9702 SHA512 12ecbe803edc7e4b2c80da34849a7a8e6c64453f98afa51865042282b6420f9a511f08c2f7921ff06455d81a68a35115db942ec1ee6c946969c902dff65346f7 WHIRLPOOL c2f09b6ec089fe25eb78a90dd33a2f467dc3d5c33a7a3848d50c547f2c4c47479b0262d55535d4b5cffebe564ebe4aa5291089f2719a576628dd2940c61f1486 -DIST ndoutils-2.0.0.tar.gz 2207263 SHA256 b95047c812fb61465e66a9e1a6d4a42bf00620f334f08a6faf5afe20bdd43ba1 SHA512 c899c9f9d0a14995ae7e3fc9f8566891acef9186cc53f05e4f509e9dd01a19a17d32c746a4a1c125342ebffad65946c7a3ea11da68ce0ff240bd37e85334545c WHIRLPOOL d3e41eb5e2a3ea9a5ca0d24fc8319beaa914d2bcb16c187ab6c5f5a3f133c27756ecdc2b6302a75c015294a1b2c3cc48d3c87a540ae1b9b07a21eb427b45d181 -EBUILD ndoutils-2.0.0.ebuild 1235 SHA256 d24ca70bfb5c12cf735ca050324a7866d6dc9cea87a0cd97d3ff100502f1279e SHA512 88f28cce914ddc96070c9e5fa9bd3bea6cefdccc7ee97efec302d1df9affaafdf85210e7316acf6f6ab88442d5cfa0768f895b42290ae4306f2bb5f1069d3d74 WHIRLPOOL 1e3dfdf33d0044bf63cc4b906907446695ea4323e8df9bbc3a810e7e3c1013927a5006f1ad7f2c417bcda81956fd075c34612972cd2230226cf77aaa31e4cff7 +AUX format-security.patch 3858 SHA256 055f7dec14c3ea33aa10ae4089d2d93607229c0b78b08ce5c908c7e1b88e399e SHA512 e8a5c867e310b76d7431d783faab1be802f6d04908958c07d278e5cb38462fd88f485759eeda1084caf87ce48f2e439de2d97d0efba701d21ed2a9870c74ed32 WHIRLPOOL a7dc6b498bf1dd658dcbe413f568e798c59691d67a2b3c20541d6a293d37a480f41a6832c13e3952a796b34418019101c27b1292bd68c5ede5b93f1bf30acd59 +AUX ndoutils-2.0.0-asprintf.patch 438 SHA256 17e2a503fc013a51bd217bdb6edef7a855f537d20fcca45d2123d17f8424762c SHA512 78fe5b2004bba81b3956a96ad569b6e05e2eb20e203020d2c07e780dfc78f5f68450fb20a62388ec7ccdc37544cd896f29238dd9590cd474db1f73e101dcb9e6 WHIRLPOOL 78124e9f045b8010adfeb4695430dea3a2bef7b750ead554e5ba084a24b7dc41d6bb6935b559b9441093253d23f81695f9d9514bf3245c0819f2603662261f10 +AUX openrc-init.patch 3296 SHA256 1994ab991ed0a53fa2f1ac88ad59d0aa8a02bb521ef75df4c46b19c7184caebb SHA512 4beb0e72712909554deaa93aa3fe959e80bed3465f4f0a2153f8b4e994538e6d508e303451cc14425ecb5210845308e9a113f491900a977526327a2701b00eb7 WHIRLPOOL 65367fd56295481a7587d157dd000e68896a01c016369d93e01a9e2cd44bfd613ce0bca1f335a80f3b8ff84fe2e75df6afae40e10abc1697f5d99c3eff07cd91 +AUX sample-config-piddir.patch 1098 SHA256 3fcd1e5f1e3c60da10c2e0368c745201e63db2c2d6d6f43658502f6de1071136 SHA512 bae06d6571aa55c5b9f0103d9af861f50b31668f06dc9b9a29cdf961741455384d8c762338dbfb3c75e10bacba360ac5a706b6251a6ef5cec8fa0def4c679344 WHIRLPOOL 94132809459ad6455bdfe81b0eca0b838bfcdf5440d659d389bd51460b629c0377c6b81c012841b1c65c18d3fd2babe21f507c894070904c58661847d660077d +DIST ndoutils-2.1.3.tar.gz 2182999 SHA256 2517ee737359f16d7f24b13ef2a9a41775bf7e8396a3ecaa7c45758d3ca9ce0a SHA512 727f2051876ff32cafaf9993a69b721ae4ea81031fade12262dbb4c5399c601f3c1af362d9d550e1d6d56fac8fe044d515dc10fc43e7d4d3e981bc9a89db88de WHIRLPOOL 9fb7cf6438da9baad6036b91bac62b8df1a494f0be00d3926e6603fe3783bd8722107ee63280c25f377d942f4a720d9aed04991ff24e2817b045161d142d34a7 +EBUILD ndoutils-2.1.3.ebuild 2430 SHA256 57cad9f5c0f3f15016dbb426a37895a440461d5cf1957b7bdbb8e224cadd1c05 SHA512 e89a8ce44cca00eabf5e4c7234f39531c95543f13051db9e7108deed694af912567cb0a885a287d1fa33975943e5410c2ac0c1ea9014c855ea3e8cc54411f621 WHIRLPOOL 21a5c27b2ce4b49649a22f67046dac861518efba2341e2f5e96cf590fd8879a4faa811ef6059e630fabb9f1cf830a8030d704982464d60b6a3753040f279e6aa MISC ChangeLog 4049 SHA256 e74a1694207f5c20fcc90a88e460fd64d21f961793689c204e16ef2ae1c8942f SHA512 ae3812b8b2d539d7366941fa7ac83fb297247fad97a7f1e85c1f2b6be04d1000fca18d4f6807b7094c1ffb4f80bf14dfc8075fb321c509a60c39e1476548440b WHIRLPOOL 360a188ecc18cf69b3d60779f2e9675d296f1ba6c50370807bea4a410757102c4faabc3407d977751f7711efb2bd3189f36cb6000adbba910d891619c611d990 MISC ChangeLog-2015 2775 SHA256 0043133f70c0b9dca601b54e3e277eff0bb3c948bd8eae5168c0f3eff36d8960 SHA512 3df4c0854d1db10287bea3dec354f53ee16a5be21a82cafddcc5d5abc63fe00524ceb318329f73b3d57b34eba9947e1167ffd0a5f2fe2edcd21f2661f27b2c48 WHIRLPOOL 5cfa45ed6d3d56802997821e8539f9dd4ceecc773e24bc274beaeb3e334f3481dbb4da93ebb6b3a7d91f0cbaa4a13a74b926396b5bbb8ed82c891721acf7fe5e -MISC metadata.xml 356 SHA256 e1e604c15342d0f5a3406a55e888f8795a3d1eed2f03a2114748cba9fb42b1b2 SHA512 a74005ec3d18121f5379cfd15757c97f94d6e60864406989f3e60dc065dec57fccd2f06534a94e25235f3bb8bffd26e7adbd66a3216d037b1c7f42005f50512a WHIRLPOOL 9a3b5648fbce4441e3332add12489281576682b6b0ba439bb69f1d42688b1af57ebae973da5836476973b0f079b3537b800cbdfc613575575b7b9f8c8f40deec +MISC metadata.xml 446 SHA256 f6eea1a35ad8bcd2b7d2ce6fc6d7a8bbad9afbf41ada23dba229841970c25fb8 SHA512 744e2dc2da0449a47d7acc67820a5627058f7e962f9b78beabc766936abb8a5a8c55d4bd01f239af9d63b418e36d875e30f591bf6ab694fc171c7387eb1c1c77 WHIRLPOOL bb14279665128a78da94db7735366ab92c1d9261f56d9c68e984dabfb70e3b2d84acdb012255f25be611d8387bc05a018a4def51fca2c1d1257d32a58969435b diff --git a/net-analyzer/ndoutils/files/format-security.patch b/net-analyzer/ndoutils/files/format-security.patch new file mode 100644 index 000000000000..75be7dc32103 --- /dev/null +++ b/net-analyzer/ndoutils/files/format-security.patch @@ -0,0 +1,115 @@ +From 07891e8fcf692552c57e64429fd52da9e682f6d2 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Sat, 22 Jul 2017 16:38:03 -0400 +Subject: [PATCH 1/1] src/queue.c: fix format-security warnings with explicit + "%s" format string. + +The syslog() function takes as its second argument a format string (a +la printf), but if the third parameter is a string, then the format +string can be omitted. This has led to security vulnerabilities in the +past, and compilers can now warn about it. In particular, GCC has the +-Wformat-security option, which can be made an error with +-Werror=format-security. + +A few such two-argument calls were present in src/queue.c, where +constant strings were being logged to syslog. This commit adds the +second format string parameter (simply "%s" in this case) to avoid the +compiler warnings. + +More information about format-security can be found in Fedora's FAQ: + + https://fedoraproject.org/wiki/Format-Security-FAQ +--- + src/queue.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/src/queue.c b/src/queue.c +index 8cb7445..50bb519 100644 +--- a/src/queue.c ++++ b/src/queue.c +@@ -50,7 +50,7 @@ void del_queue() { + struct msqid_ds buf; + + if (msgctl(queue_id,IPC_RMID,&buf) < 0) { +- syslog(LOG_ERR,"Error: queue remove error.\n"); ++ syslog(LOG_ERR, "%s", "Error: queue remove error.\n"); + } + } + +@@ -58,7 +58,7 @@ int get_queue_id(int id) { + key_t key = ftok(NDO_QUEUE_PATH, NDO_QUEUE_ID+id); + + if ((queue_id = msgget(key, IPC_CREAT | 0600)) < 0) { +- syslog(LOG_ERR,"Error: queue init error.\n"); ++ syslog(LOG_ERR, "%s", "Error: queue init error.\n"); + } + } + +@@ -99,7 +99,7 @@ void log_retry( void) { + if(msgctl(queue_id, IPC_STAT, &queue_stats)) { + sprintf(curstats, "Unable to determine current message queue usage: error reading IPC_STAT: %d", errno); + sprintf(logmsg, logfmt, curstats); +- syslog(LOG_ERR, logmsg); ++ syslog(LOG_ERR, "%s", logmsg); + } + else { + #if defined( __linux__) +@@ -108,24 +108,24 @@ void log_retry( void) { + if( msgmni < 0) { + sprintf(curstats, "Unable to determine current message queue usage: error reading IPC_INFO: %d", errno); + sprintf(logmsg, logfmt, curstats); +- syslog(LOG_ERR, logmsg); ++ syslog(LOG_ERR, "%s", logmsg); + } + else { + sprintf(curstats, statsfmt, queue_stats.msg_qnum, + (unsigned long)msgmni, queue_stats.__msg_cbytes, + queue_stats.msg_qbytes); + sprintf(logmsg, logfmt, curstats); +- syslog(LOG_ERR, logmsg); ++ syslog(LOG_ERR, "%s", logmsg); + } + #else + sprintf(logmsg, logfmt, ""); +- syslog(LOG_ERR, logmsg); ++ syslog(LOG_ERR, "%s", logmsg); + #endif + } + last_retry_log_time = now; + } + else { +- syslog(LOG_ERR,"Warning: queue send error, retrying...\n"); ++ syslog(LOG_ERR, "%s", "Warning: queue send error, retrying...\n"); + } + } + +@@ -155,14 +155,14 @@ void push_into_queue (char* buf) { + #endif + } + if (retrynum < MAX_RETRIES) { +- syslog(LOG_ERR,"Message sent to queue.\n"); ++ syslog(LOG_ERR, "%s", "Message sent to queue.\n"); + } + else { +- syslog(LOG_ERR,"Error: max retries exceeded sending message to queue. Kernel queue parameters may need to be tuned. See README.\n"); ++ syslog(LOG_ERR, "%s", "Error: max retries exceeded sending message to queue. Kernel queue parameters may need to be tuned. See README.\n"); + } + } + else { +- syslog(LOG_ERR,"Error: queue send error.\n"); ++ syslog(LOG_ERR, "%s", "Error: queue send error.\n"); + } + } + +@@ -175,7 +175,7 @@ char* pop_from_queue() { + zero_string(msg.text, NDO_MAX_MSG_SIZE); + + if (msgrcv(queue_id, &msg, queue_buff_size, NDO_MSG_TYPE, MSG_NOERROR) < 0) { +- syslog(LOG_ERR,"Error: queue recv error.\n"); ++ syslog(LOG_ERR, "%s", "Error: queue recv error.\n"); + } + + int size = strlen(msg.text); +-- +2.13.0 + diff --git a/net-analyzer/ndoutils/files/ndo2db.init-nagios3 b/net-analyzer/ndoutils/files/ndo2db.init-nagios3 deleted file mode 100644 index 3e1e262f6e0c..000000000000 --- a/net-analyzer/ndoutils/files/ndo2db.init-nagios3 +++ /dev/null @@ -1,24 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depends() { - before nagios - need mysql -} - -start() { - ebegin "Starting ndo2db" - if [ -S /var/nagios/ndo.sock ] ; then - rm -f /var/nagios/ndo.sock - fi - start-stop-daemon --start --quiet --exec /usr/bin/ndo2db \ - -- -c /etc/nagios/ndo2db.cfg - eend $? -} - -stop() { - ebegin "Stopping ndo2db" - start-stop-daemon --stop --quiet --exec /usr/bin/ndo2db - eend $? -} diff --git a/net-analyzer/ndoutils/files/ndoutils-2.0.0-asprintf.patch b/net-analyzer/ndoutils/files/ndoutils-2.0.0-asprintf.patch index 146132c21de3..21cf837ba36d 100644 --- a/net-analyzer/ndoutils/files/ndoutils-2.0.0-asprintf.patch +++ b/net-analyzer/ndoutils/files/ndoutils-2.0.0-asprintf.patch @@ -1,3 +1,9 @@ +This is a fix for the QA warnings that result from using asprintf() +without defining it. That happens because asprintf() is a GNU +extension, but somehow gets used before _GNU_SOURCE is defined. + +Upstream-Bug: https://github.com/NagiosEnterprises/ndoutils/issues/43 + --- a/include/config.h.in +++ b/include/config.h.in @@ -9,6 +9,7 @@ diff --git a/net-analyzer/ndoutils/files/ndoutils-2.0.0-sleep.patch b/net-analyzer/ndoutils/files/ndoutils-2.0.0-sleep.patch deleted file mode 100644 index 61694baee9e3..000000000000 --- a/net-analyzer/ndoutils/files/ndoutils-2.0.0-sleep.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/queue.c -+++ b/src/queue.c -@@ -8,6 +8,7 @@ - #include "../include/queue.h" - #include <errno.h> - #include <time.h> -+#include <unistd.h> /* sleep() */ - - #define RETRY_LOG_INTERVAL 600 /* Seconds */ - #define MAX_RETRIES 20 /* Max number of times to retry sending message */ diff --git a/net-analyzer/ndoutils/files/openrc-init.patch b/net-analyzer/ndoutils/files/openrc-init.patch new file mode 100644 index 000000000000..07fcc63b7f3d --- /dev/null +++ b/net-analyzer/ndoutils/files/openrc-init.patch @@ -0,0 +1,100 @@ +From 61c6e9295bae755713b403626f702b5ac90f2448 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Sat, 22 Jul 2017 17:25:29 -0400 +Subject: [PATCH 1/1] startup: simplify the OpenRC init scripts and conf file. + +This commit largely rewrites the OpenRC init script with the goal of +simplifying it. The end result should be functionally the same, but is +much shorter. The changes are as follows: + + 1. Replace the deprecated /sbin/runscript shebang with /sbin/openrc-run. + + 2. Replace the existing dependencies with "need mysql nagios". The + ndo2db daemon needs Nagios to create the TCP or Unix socket over + which it will communicate, and obviously it needs mysql to be + up and running in order to save any data. The dependencies + of mysql and nagios themselves will bring up whatever else is + required; nothing else needs to be listed as a dependency of + ndo2db. + + 3. Use the "command", "command_args", and "pidfile" OpenRC + variables. OpenRC is smart enough to start and stop a well-behaved + daemon on its own without a custom start/stop function. By + specifying those three variables, we are able to eliminate much of + the custom start/stop code in the init script. + +Finally, the default value of NDO2DB_CFG in the associated conf file has +been updated to use @sysconfdir@ instead of @pkgsysconfdir@, which wasn't +having any effect. +--- + startup/openrc-conf.in | 6 ++---- + startup/openrc-init.in | 42 +++++++++--------------------------------- + 2 files changed, 11 insertions(+), 37 deletions(-) + +diff --git a/startup/openrc-conf.in b/startup/openrc-conf.in +index d7b5474..69b15b5 100644 +--- a/startup/openrc-conf.in ++++ b/startup/openrc-conf.in +@@ -1,4 +1,2 @@ +-# /etc/conf.d/ndo2db : config file for /etc/init.d/ndo2db +- +-# Configuration file - default is @sysconfdir@/ndo2db.cfg +-NDO2DB_CFG="@pkgsysconfdir@/ndo2db.cfg" ++# The configuration file to use for ndo2db. ++NDO2DB_CFG="@sysconfdir@/ndo2db.cfg" +diff --git a/startup/openrc-init.in b/startup/openrc-init.in +index 119e074..7b3fb40 100644 +--- a/startup/openrc-init.in ++++ b/startup/openrc-init.in +@@ -1,39 +1,15 @@ +-#!/sbin/runscript ++#!/sbin/openrc-run + # +-# Copyright (c) 2016 Nagios(R) Core(TM) Development Team ++# Copyright (c) 2017 Nagios(R) Core(TM) Development Team + # +-# Start/stop the Nagios Data Out Daemon. +-# +-# Goes in /etc/init.d - Config is in /etc/conf.d/ndo2db + +-NDO2DB_BIN="@sbindir@/ndo2db" +-NDO2DB_PID="@piddir@/ndo2db.pid" ++command="@sbindir@/ndo2db" ++command_args="-c ${NDO2DB_CFG}" ++description="Nagios Data Out daemon" ++pidfile="@piddir@/ndo2db.pid" + + depend() { +- use logger dns net localmount netmount nfsmount +-} +- +-checkconfig() { +- # Make sure the config file exists +- if [ ! -f $NDO2DB_CFG ]; then +- eerror "You need to setup $NDO2DB_CFG. +- return 1 +- fi +- return 0 +-} +- +-start() { +- checkconfig || return 1 +- ebegin "Starting ndo2db" +- # Make sure we have a sane current directory +- cd / +- start-stop-daemon --start --exec $NDO2DB_BIN --pidfile $PID_FILE \ +- -- -c $NDO2DB_CFG -f +- eend $? +-} +- +-stop() { +- ebegin "Stopping ndo2db" +- start-stop-daemon --stop --exec $NDO2DB_BIN --pidfile $PID_FILE +- eend $? ++ # The Nagios core daemon creates the socket that ndo2db tries to ++ # connect to upon starting. ++ need mysql nagios + } +-- +2.13.0 + diff --git a/net-analyzer/ndoutils/files/sample-config-piddir.patch b/net-analyzer/ndoutils/files/sample-config-piddir.patch new file mode 100644 index 000000000000..902038204988 --- /dev/null +++ b/net-analyzer/ndoutils/files/sample-config-piddir.patch @@ -0,0 +1,32 @@ +From 560db1e2bc79bb3321c5f431e149418ec3c28a98 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Sun, 23 Jul 2017 07:13:46 -0400 +Subject: [PATCH 1/1] config/ndo2db.cfg-sample.in: use @piddir@ for the pid + file. + +The "lock_file" setting in ndo2db.cfg specifies where the daemon's pid +file should be stored. In the past, it was stored in @localstatedir@, +but @piddir@ is more appropriate. As evidence, all of the init scripts +in the "startup" directory reference @piddir@ and not @localstatedir@ +for the location of the pid file. This commit updates the sample +config to agree with the init scripts. +--- + config/ndo2db.cfg-sample.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/config/ndo2db.cfg-sample.in b/config/ndo2db.cfg-sample.in +index 75266dc..5b46fc9 100644 +--- a/config/ndo2db.cfg-sample.in ++++ b/config/ndo2db.cfg-sample.in +@@ -10,7 +10,7 @@ + # This is the lockfile that NDO2DB will use to store its PID number + # in when it is running in daemon mode. + +-lock_file=@localstatedir@/ndo2db.pid ++lock_file=@piddir@/ndo2db.pid + + + +-- +2.13.0 + diff --git a/net-analyzer/ndoutils/metadata.xml b/net-analyzer/ndoutils/metadata.xml index 325efab1c501..5c2264521203 100644 --- a/net-analyzer/ndoutils/metadata.xml +++ b/net-analyzer/ndoutils/metadata.xml @@ -5,7 +5,10 @@ <email>netmon@gentoo.org</email> <name>Gentoo network monitoring and analysis project</name> </maintainer> + <maintainer type="person"> + <email>mjo@gentoo.org</email> + </maintainer> <upstream> - <remote-id type="sourceforge">nagios</remote-id> + <remote-id type="github">NagiosEnterprises/ndoutils</remote-id> </upstream> </pkgmetadata> diff --git a/net-analyzer/ndoutils/ndoutils-2.0.0.ebuild b/net-analyzer/ndoutils/ndoutils-2.0.0.ebuild deleted file mode 100644 index b813b079881b..000000000000 --- a/net-analyzer/ndoutils/ndoutils-2.0.0.ebuild +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=5 -inherit eutils user - -MY_P=${P/_beta/b} - -DESCRIPTION="Nagios addon to store Nagios data in a MySQL database" -HOMEPAGE="http://www.nagios.org" -SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc" - -DEPEND=" - dev-perl/DBD-mysql - dev-perl/DBI - virtual/mysql -" -RDEPEND=" - ${DEPEND} - >=net-analyzer/nagios-core-3.0 -" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - enewgroup nagios - enewuser nagios -1 /bin/bash /var/nagios/home nagios -} - -src_prepare() { - epatch \ - "${FILESDIR}"/${P}-asprintf.patch \ - "${FILESDIR}"/${P}-sleep.patch -} - -src_configure() { - econf \ - --sysconfdir=/etc/nagios \ - --enable-mysql -} - -DOCS=( - 'docs/NDOUTILS DB Model.pdf' - 'docs/NDOUtils Documentation.pdf' - Changelog - README - REQUIREMENTS - TODO - UPGRADING -) - -src_install() { - default - emake DESTDIR="${D}" install-config - - newinitd "${FILESDIR}"/ndo2db.init-nagios3 ndo2db -} - -pkg_postinst() { - elog "To include NDO in your Nagios setup you'll need to activate the NDO broker module" - elog "in /etc/nagios/nagios.cfg:" - elog "\tbroker_module=/usr/bin/ndomod-3x.o config_file=/etc/nagios/ndomod.cfg" -} diff --git a/net-analyzer/ndoutils/ndoutils-2.1.3.ebuild b/net-analyzer/ndoutils/ndoutils-2.1.3.ebuild new file mode 100644 index 000000000000..1872b7849d8d --- /dev/null +++ b/net-analyzer/ndoutils/ndoutils-2.1.3.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit systemd + +DESCRIPTION="Nagios addon to store Nagios data in a MySQL database" +HOMEPAGE="http://www.nagios.org/" +SRC_URI="https://github.com/NagiosEnterprises/${PN}/archive/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" + +# We require the "nagios" user from net-analyzer/nagios-core at build +# time. +DEPEND="dev-perl/DBD-mysql + dev-perl/DBI + >=net-analyzer/nagios-core-4 + virtual/mysql" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${PN}-${P}" + +DOCS=( + Changelog + README + THANKS + TODO + UPGRADING + "docs/NDOUTILS DB Model.pdf" + "docs/NDOUtils Documentation.pdf" +) + +PATCHES=( + "${FILESDIR}/format-security.patch" + "${FILESDIR}/ndoutils-2.0.0-asprintf.patch" + "${FILESDIR}/sample-config-piddir.patch" + "${FILESDIR}/openrc-init.patch" +) + +src_configure() { + # The localstatedir is where our socket will be created by the + # nagios daemon, so we put it in /var/nagios where the "nagios" user + # will be able to write. + # + # And normally, we would use /run for the pid file, but the daemon + # drops permissions before creating it, the the piddir also needs + # to be writable by the nagios user. + econf --enable-mysql \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --with-piddir=/var/nagios +} + +src_compile() { + # Avoid "emake all" so that we don't build the stuff for nagios-2.x + # and nagios-3.x, some of which throws QA warnings. We don't use it + # anyway. + pushd src + emake file2sock log2ndo ndo2db-4x ndomod-4x.o sockdebug + popd +} + +src_install() { + default + insinto /etc/nagios + newins config/ndo2db.cfg-sample ndo2db.cfg + newins config/ndomod.cfg-sample ndomod.cfg + newinitd "startup/openrc-init" ndo2db + newconfd "startup/openrc-conf" ndo2db + systemd_newunit "startup/default-service" "${PN}.service" + + # The documentation isn't installed by the build system + dodoc -r docs/html + + # Use symlinks because the installdb/upgradedb scripts use relative + # paths to the SQL queries. + insinto "/usr/share/${PN}" + doins -r db + dosym "/usr/share/${PN}/db/installdb" /usr/bin/ndoutils-installdb + dosym "/usr/share/${PN}/db/upgradedb" /usr/bin/ndoutils-upgradedb +} + +pkg_postinst() { + elog "To include NDO in your Nagios setup, you'll need to activate" + elog "the NDO broker module in /etc/nagios/nagios.cfg:" + elog " broker_module=/usr/bin/ndomod.o config_file=/etc/nagios/ndomod.cfg" +} |