summaryrefslogtreecommitdiff
path: root/net-analyzer/munin
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/munin')
-rw-r--r--net-analyzer/munin/Manifest25
-rw-r--r--net-analyzer/munin/files/logrotate.d-munin.230
-rw-r--r--net-analyzer/munin/files/logrotate.d-munin.331
-rw-r--r--net-analyzer/munin/files/munin-1.3.2-plugins.conf80
-rw-r--r--net-analyzer/munin/files/munin-2.0.33-perl526.patch26
-rw-r--r--net-analyzer/munin/files/munin-async.service10
-rw-r--r--net-analyzer/munin/files/munin-asyncd.init.219
-rw-r--r--net-analyzer/munin/files/munin-graph.service11
-rw-r--r--net-analyzer/munin/files/munin-graph.socket8
-rw-r--r--net-analyzer/munin/files/munin-html.service11
-rw-r--r--net-analyzer/munin/files/munin-html.socket8
-rw-r--r--net-analyzer/munin/files/munin-node.service11
-rw-r--r--net-analyzer/munin/files/munin-node_conf.d_1.4.6-r27
-rw-r--r--net-analyzer/munin/files/munin-node_init.d_2.0.1926
-rw-r--r--net-analyzer/munin/files/munin-node_init.d_2.0.736
-rw-r--r--net-analyzer/munin/files/munin.apache.include31
-rw-r--r--net-analyzer/munin/files/munin.apache.include-2.428
-rw-r--r--net-analyzer/munin/metadata.xml100
-rw-r--r--net-analyzer/munin/munin-2.0.33-r1.ebuild414
-rw-r--r--net-analyzer/munin/munin-2.0.33.ebuild412
-rw-r--r--net-analyzer/munin/munin-2.1.9999.ebuild381
21 files changed, 1705 insertions, 0 deletions
diff --git a/net-analyzer/munin/Manifest b/net-analyzer/munin/Manifest
new file mode 100644
index 000000000000..3fa6b4ecc510
--- /dev/null
+++ b/net-analyzer/munin/Manifest
@@ -0,0 +1,25 @@
+AUX logrotate.d-munin.2 532 SHA256 3b2597a52a2dc6b49099be6ab9c685be2ea09ed136666c2c1d56af1883fe4378 SHA512 25cd3017c9edcf07ac8e54b75a7b881255a4043cbe6c5f99320aa87cea00118be03010d9b76e5c214eeac82ebc4e4d3807474c5d112bff23d83238e7650d6563 WHIRLPOOL bc956e4454887cc1f102eb4ac0a563b5317acf9cd83a76b1bf379b2cd06e5518878aded99be04e7c03d79bcda02265864d3b83e65afef76a19da81464154937f
+AUX logrotate.d-munin.3 647 SHA256 07059049fd24b261142203e78c217bd037d6ba4d666bcf29c58fcdd3f49de953 SHA512 14ec0363b561695ae58db95e8d6fc68d7161805cfa0002001ec60566d0b22cc6103ae949de12715dc646131d692e023735895007c04807940c6d1a22de342302 WHIRLPOOL 49b8b65f89c208ae6ef7ed4f7750a9d74d9b5e5d76d1489859e72fdcba66380d7cd34abb0f9d21ded4a991f132aa449bbdb13b60a255e4e2b15e361472f3fffc
+AUX munin-1.3.2-plugins.conf 1760 SHA256 50d99bb4612ce0a7be79991c064ab16a833b3312afd8bafc6b9ab13a1ba79e75 SHA512 c3498c4364cedd27016562568f918995be92dd6b3c2735ddd008190de0a729f8ea59e61f8517f6f48beaad14edb349af7476a39f55d246ab06d6cbe91679565f WHIRLPOOL 2accb14a5a72ba89c9559358d3889c1f8c6980c348b8394c0df7faf13bfeeb550b664e8746f8b3fbfdc64ade5d0cb0cdf7b083aeda629b2c93e34e36e78d7efd
+AUX munin-2.0.33-perl526.patch 849 SHA256 baafc45d3b7f5397af02c44b5dc81cc19566d3183c716c194b5f852e96001431 SHA512 b20e6b7de057ea88cfe5420fe79520d1fbb23cfdf961096c355c6bd48384b6d78a74b7545e8ded47374eeb5b884f54b39556abf950577e025d8221f69ef43789 WHIRLPOOL 0564927117e44b33c559645ea2759301f46afd69f2fad4434809e73fca248d6c07e3c530f06740306a42a09d971f0cc7def321c7c39cc19bdc452368a46edbe6
+AUX munin-async.service 201 SHA256 e2638eb1d78316dbd8e00b5c5aa233ed9b6b3e80fba97d96531b11f96600d67c SHA512 55a99866cb9ff50723a223b8a45b418f13ed754b6ca919260af8312a323aad432aca047724a5e32f6aee2f8f541ae829bf6bfdf19d22e7543ef2e5a7b9cd9d6a WHIRLPOOL ac9f5b9a74d7b10851f0c2b2020201960472c239f66fa4b4f34a2718d99f52103ae2508f3ea18592365c9c1d3ce16e2e9c4dc16475c0f66226b0019170da56e2
+AUX munin-asyncd.init.2 452 SHA256 1c2206850827aadcd1441e80e73269db31c3d0d1c38ff9c86568cc71be379252 SHA512 5d2ca928ea953e5fec8451dca218165f2c058c6d57519fea65e94148c0dff5ca0a06a2a22b09f416e375e825463d4d2a7c1a424c60051fdb4fa0d79af9463c26 WHIRLPOOL bc9e09b2a25060d1a7a13328cb3a714f76a6e6221308a0fed1b609bb1d31b74f7b2626ec539e2dedb79e7e1dd8441274ea72b2b63f0ddbd302ce11c51e7092dd
+AUX munin-graph.service 208 SHA256 5ab905477bc531661a32fa6eff7f1ccc629451b2f4dd8b194246c4f7aa1cbdf3 SHA512 3c0ea1cbcaacca02d2e36dbe0dbf02a553ce899db253510a17cbdd1a21275556101117f5d2701bd5519a8813c9ae022465c7fe89fa6000c857ca09c6aed6989c WHIRLPOOL 5a0e928cfb169a1d8a4bad3de9b001ee4dddc0d3e85416a074b9786713752586fcb5ae01b53d218428a06df51416d9f4409d9c8e58f663fdb6e94e8c6ba2593d
+AUX munin-graph.socket 131 SHA256 6fc45060633d243212a9be6cedfd31cc8cbd4001398006650e6754af235ab373 SHA512 b63bc777330b5beafedcaf759d6de1809b0daaea2a811b2138a7bbd0afec7f3f03204674be00d0aae845f30cb09b5d0fb72c46a77be0f6746d6f7dcea061c3ef WHIRLPOOL 904448bc360fe5a2aa0e8a1e90863e2141138957132bf8b1d44e5ddc4b1b328ea4c7dd2777b165d81c51bb92d1682d7518a3cd7a81c42f2cfe9ba5e7aa0e2ad0
+AUX munin-html.service 205 SHA256 73b2f164ccfcd6ff5dba21b33c5ddf3224749c8a511f0a19bc1bb2a6ce2104a7 SHA512 dde77279c0804d7cb83333dafbb2afe5c5231c25fc6c3ce31d0a6711325643ee6a9fc44b1a62accd9cec8bc12077e562adfcf2efbe2667b25ff72145fe1cc472 WHIRLPOOL 0520dec6f7dfae287efc5bb9d5f2c44bc69d7570c9cccd524eebe96bb3449aff545a5a86888249cf3896844c8f92c770ddd822463e9b02289f0c48f78f80a2b2
+AUX munin-html.socket 129 SHA256 42f6f59b449805aec47f151e47125298aee575dcaf2caf56008220d1c22c9ce1 SHA512 d970f77be6a45b8dfc8c22fd80442d90620663bb36b0368bc5f0b36af3300b15b36f08b824eb7550d047bcc31599346f9ed45950fe98ca70ddd7982c4ecd0e9a WHIRLPOOL 809c4dbbe149e0a02cb5344a0cdef139e4c303830767889443668c778e9bc4c607d0f1a73cbce7e948a6256bbd52a96646b42dbbe8ca043e4111c160f8f66428
+AUX munin-node.service 194 SHA256 497f3e4990908f56e3834961c08161675029a945936a96d2d411b971f4bce7b3 SHA512 e7586afed85e67de04494353dbc9a3008e6246a158ddb66634c799c64bd8ea991a153b45c050934edde18cd7ac0828d1961acd3a1ddc9dc6b088cb95f0ea7a1b WHIRLPOOL c827a54da2691e5c61c87117934e6926d9eedb10c256e9514dce90f17d67c1a6f0785a536e03f983919590b17b9867b09c5634f66e0fd40c62cbf444dbda3a48
+AUX munin-node_conf.d_1.4.6-r2 188 SHA256 4188fed9f8f72687f7b625caddac35fac19f2b3bb461e032effc70040b9973cb SHA512 f6b4b198a219ab4706aea3820ac36932bdb807abb7f42447cc36afe140e15a04e65d5daa44843aaedf1ecfa2f040a373687ddea4f94a55d104492e640c313152 WHIRLPOOL 69b1d95b70844a87347502b0de9d2b33cf7ef3b5d3769d0f978c934caa5ae1a49030b300a62e39880fc406355fb68421f4acd7ebb54f5d9df62b4408e1a9eaa1
+AUX munin-node_init.d_2.0.19 598 SHA256 989d65a5b617c8a02e66e57c9ab1e07f235cfe0dac659893dc0b0e53572b2de9 SHA512 c2429156972e6db9c75160dcb3419ea67a59801a70e4a13a07899ebea84db079d1efcbeb653e2abea3212fa7cfb96a35ff020daf4918d8fe2839b670ea63b31b WHIRLPOOL 0f9b048dd27ae54f6414b65f5d6d8adde7be5b8df8322f9f3c1bab973eb1c32ad6b0bc92f7eb282de7e047d4225fb14076d9f0891912511e93d667085bee7a79
+AUX munin-node_init.d_2.0.7 745 SHA256 c115a783591cb997c7b9bd99aaf4b5f16a11c2ece6a1296c6b0da38d0a0512b7 SHA512 e6652707c539afef01e7cd777acec2c639edf66fb9bf1f126711d19f166eb3ef69d5ed8e895e77e4fb0b7f5a4c8788eb6532f4e09d13693d164e6edbde55e5d0 WHIRLPOOL f1a2786f1eb67cbae9996117d2397b0e545626fc4c5b49f1efa7afcf4144272b394beb54102aa15f133b0f0c3d6112aad9abdd49ba2e76b897a047afa4a1f7e5
+AUX munin.apache.include 604 SHA256 5051ff79220e5ef578e6e5fa66ef8b0a71b72cca6fde93264cf371585f56cb52 SHA512 de4797ccac5c9299dd55140300276f746febf3ac5bfebfc48901ca71fa0e035017917eba054b251cc2383c65f1e209e244906b34eebad237f43a7bd7171f6087 WHIRLPOOL 5adfbcc61a3e5f7b6bec7396ca72bf24fd59406ee2a49ac47dc81dfff2eef98e688b6fa6699a9095f34943dd7df2ee1f392e1f7a9c1572dc0505d2439a836c5c
+AUX munin.apache.include-2.4 577 SHA256 21245e9eb7b759d2d2e65c2d1424da6d8c6fd8f49ec2f30cf72696cfc4227694 SHA512 b07791a4d5b822b5d0ad84ddbea3444cc1475cee8ee20f62dbb5f3a1792b71dba995e412433d30b3c295e40ad5346528d25e04438ec2dfa535983aae9198cea4 WHIRLPOOL 90a166f400e8336792fabcbcb786169dc5ed6b5fe9151ac5aef40f85c8d3f2724a6fffe17e41d90f31948a9462fc619fe45747caf8f62d55f6d494d48a7a2bb1
+DIST munin-2.0.33-gentoo-1.tar.xz 11024 SHA256 f956d9051e0da05231bb8777c0ca3342ca5bb86e48c44a68289c41c42c440e46 SHA512 c1f49f01fd641e157145d9710a091696c09380887a374ee845e516d40384ee6bc576019f3510ac322436b1f10ee1b675ae512b9f677a6a0fa2ef022cbb7269b8 WHIRLPOOL 3c0fbccc4c8ee9a2dacf8ce1845d149198c8d53ed17cd62fd17bae60986ca6616e12213d4f520fd06e8329accec559a7f9529559f21dc62de3aa0b66680d7ab7
+DIST munin-2.0.33-gentoo-2.tar.xz 11288 SHA256 a7cc6b060cc1344c9b40278a960ab8fa6848e5db53f8665a952fb602ab0c0c55 SHA512 4d185529199377e85fb3e7d0a8c38de2ae500d2f992292e6ae016d11e81642833725987ac006b5f535963593c7698c676d28091805691e8b46c016fc2580917d WHIRLPOOL 98d2916c10adf554ab1672c602271673cb6dea7ae72fb7849b1bdf16d6f63c6f330def1f4a3cb62fd1fab4e888b2dede2807cde9a7907058f37a0f87a8b67a6b
+DIST munin-2.0.33.tar.gz 1349546 SHA256 99dbc1e5f4f0fed4e28f295245333544193f9a26c597f2a78571ae20b4d450b6 SHA512 33c56fcb347396f29662f304aa50f0e3dfc909b067ea49809762bbbb4dd2cd7e95789c318adcef64923e6d0248dcf9ea6fe933c49d920b6b7856d85511d40d67 WHIRLPOOL 2429b605d19bbf4caa460e9f2b46de8e2462bf606bd1143bcdcbb4f2e079b2acf5f87def86affa6152ed8b26cf14bc83d62274bb58424818deb2b5f2024de7f0
+EBUILD munin-2.0.33-r1.ebuild 12272 SHA256 57b1b0aaaa6cad6f0ee7f54f25e9ea05661c52fb00fd107ceb9ad07f2c3187cc SHA512 b87e00d40132c1c20dec93a674e2b9c0f8adfadb4d1747b5348fd65e7db875a299551a8db684d88126ec926efd0e11de74c18de50ae0525cefb778df4f1822be WHIRLPOOL bdc218b465108378d7059d4f04580569fc06e83d2842d62500863e3b9f6b81761a8c39dba6d134ae1037cbc436118cb6e2cdd4f7526c792d10cfc8bb09421cff
+EBUILD munin-2.0.33.ebuild 12184 SHA256 241922f8f69f56dd3732191e102386392c84dd2ce83ff4161f95f37362d4e227 SHA512 389ac592f1860a021feba2c6beff4d6b55ec5997adbb356b4130ef88e69cb8797e166315af4429956223ae4c6b58b39687dbd1db3578a5f56bff5a8f4d8ccbbb WHIRLPOOL d1bf9b0cf6da0e2a2b7442cf3b02d277ce943881d8245007b5f4c637b570f62091f007ed86eb14dc22eaff1e2946a1d39eedcd269bfd996ec3ccb4451a0921e8
+EBUILD munin-2.1.9999.ebuild 11520 SHA256 5af629f8ff08f1c76a3e1d8d4eae5db42c2b371dcfb050ba89b90b7f88c52971 SHA512 6069e6d31b9385885e98e815d4bf33227689fa8e74c48f4aa7b6af673be76d25ef26e777ef819563a8978a3cd73bc518b0ad3e5807c58a5b0e575aeb712f5ce5 WHIRLPOOL 6fb6950643ea7fd601be1b877ffcaae1322b8816b17a29e84cc0844ee914ff242e460369218e4adb32d78b4eea1fcbdc244d3fdfada0d43cb77b846c956aac25
+MISC ChangeLog 5446 SHA256 cd90509cc51c905cf6b36f78ff98e3def854593831b4bf9264fb6b0745da36d4 SHA512 ff33e1515f24f42dfb968b44055b931ca2f0312a8e92e04da267298fe64b27c3fc7a8e84584dcf6483d38c92c3cfe54255c5bad5fe9f303f5b3029b995ffb0ff WHIRLPOOL 745f937aee96f15345153b9f9f540baefcd2a549c58086c007d463279a329e67a5339a1a1aad129bca0973391f547f8c7b1d2a721c29bc7a07164a62158ffbbd
+MISC ChangeLog-2015 35218 SHA256 9d7cc15eb23b6e6511947c3bb9c8a38f71febe9be2411fd138dc97bb6b8ff83b SHA512 cd6ea50386d5ad031b82c8b865f3577acdaea375eaf6bcdbc0b22ea7b4de0f4742fb0e2a672d54f0b2a2d8a13e7be083a2884f6f98c3c97fa6d1d3d664ea0540 WHIRLPOOL 9bfcef1920d4470a413bb602261ec2b78499852ff07ccd11e038944ed81092878a8f3746540d5e61776fc080ad41c974d18dc5bc38d13522b1078f7f4b9a559c
+MISC metadata.xml 4116 SHA256 72b14bd255f57e4ee773bd60971577928e9135c1e4e176d24a347c4763bc3bfd SHA512 ecfa257040277d815c05693724e9ff454b5ddefc1134b6afb38d66783a5e415aae78bdb35aeb0e80882a7b8ff19499f2b3b3646cc2a139e7797a0a718c2389f3 WHIRLPOOL 6e6146e65fffc5210e4efcd55e923cca8958e2b9b60d31daa12237386402b9df3a505deea71d69f3a68b4f2f7124dabb753767f39dbf96f028cda1c01ccf1b12
diff --git a/net-analyzer/munin/files/logrotate.d-munin.2 b/net-analyzer/munin/files/logrotate.d-munin.2
new file mode 100644
index 000000000000..96a163accbd6
--- /dev/null
+++ b/net-analyzer/munin/files/logrotate.d-munin.2
@@ -0,0 +1,30 @@
+/var/log/munin/munin-node.log {
+ daily
+ missingok
+ rotate 7
+ compress
+ copytruncate
+ notifempty
+ create 640 root root
+ postrotate
+ /etc/init.d/munin-node restart 1>/dev/null || true
+ endscript
+}
+
+/var/log/munin/munin-update.log /var/log/munin/munin-graph.log /var/log/munin/munin-html.log /var/log/munin/munin-limits.log {
+ daily
+ missingok
+ rotate 7
+ compress
+ notifempty
+ nocreate
+}
+
+/var/log/munin/munin-cgi-graph.log /var/log/munin/munin-cgi-html.log {
+ daily
+ missingok
+ rotate 7
+ compress
+ notifempty
+ create 640 @CGIUSER@
+}
diff --git a/net-analyzer/munin/files/logrotate.d-munin.3 b/net-analyzer/munin/files/logrotate.d-munin.3
new file mode 100644
index 000000000000..e7e1dda3fc65
--- /dev/null
+++ b/net-analyzer/munin/files/logrotate.d-munin.3
@@ -0,0 +1,31 @@
+/var/log/munin/munin-node.log {
+ daily
+ missingok
+ rotate 7
+ compress
+ copytruncate
+ notifempty
+ create 640 root root
+ postrotate
+ test -e /run/openrc/softlevel && /etc/init.d/munin-node restart 1>/dev/null || true
+ test -e /run/systemd/system && systemctl restart munin-node 1>/dev/null || true
+ endscript
+}
+
+/var/log/munin/munin-update.log /var/log/munin/munin-graph.log /var/log/munin/munin-html.log /var/log/munin/munin-limits.log {
+ daily
+ missingok
+ rotate 7
+ compress
+ notifempty
+ nocreate
+}
+
+/var/log/munin/munin-cgi-graph.log /var/log/munin/munin-cgi-html.log {
+ daily
+ missingok
+ rotate 7
+ compress
+ notifempty
+ create 640 @CGIUSER@
+}
diff --git a/net-analyzer/munin/files/munin-1.3.2-plugins.conf b/net-analyzer/munin/files/munin-1.3.2-plugins.conf
new file mode 100644
index 000000000000..e85666b77013
--- /dev/null
+++ b/net-analyzer/munin/files/munin-1.3.2-plugins.conf
@@ -0,0 +1,80 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+# This file contains configuration options for the plugins. Three
+# options are understood by munin-node itself:
+#
+# user <user> # Set the user to run the plugin as
+# group <group> # Set the group to run the plugin as
+# command <command> # Run <command> instead of the plugin. %c
+# expands to what would normally be run.
+# env.<variable> # Sets <variable> in the plugin's environment, see the
+# individual plugins to find out which variables they
+# care about.
+#
+#
+
+[smart_*]
+user root
+group disk
+
+# ipmitool and freeipmi need access to the IPMI device nodes, which
+# are only readable by root
+[ipmi_*]
+user root
+
+[freeipmi_*]
+user root
+
+# Example for a 3ware 8000-series card, with 2 disks
+# use /dev/twe0 as the actual device
+# and replicate this entry for each drive, increasing the number in -d
+#[smart_3ware-0_twe0]
+#user root
+#group root
+#env.smartargs -H -i -c -l error -l selftest -l selective -a -d 3ware,0
+#[smart_3ware-1_twe0]
+#user root
+#group root
+#env.smartargs -H -i -c -l error -l selftest -l selective -a -d 3ware,1
+
+[bind9*]
+user root
+
+[iostat*]
+user munin
+group munin
+
+[iostat_ios]
+user root
+group disk
+
+[vlan*]
+user root
+
+[postfix*]
+user root
+env.logfile maillog
+
+[sendmail*]
+env.mspqueue /var/spool/clientmqueue
+
+[mysql*]
+#env.mysqlopts -u someuser
+
+[exim*]
+group mail
+
+[cps*]
+user root
+
+[mailman]
+env.logfile /var/lib/mailman/logs/post
+env.libdir /var/lib/mailman
+env.lister /usr/lib/mailman/bin/list_members
+
+# More 3ware examples
+#[hddtemp_smartctl]
+#env.drives twe0_0 twe0_1 hda
+#env.type_twe0_0 3ware,0
+#env.type_twe0_1 3ware,1
diff --git a/net-analyzer/munin/files/munin-2.0.33-perl526.patch b/net-analyzer/munin/files/munin-2.0.33-perl526.patch
new file mode 100644
index 000000000000..d3cabb9906c3
--- /dev/null
+++ b/net-analyzer/munin/files/munin-2.0.33-perl526.patch
@@ -0,0 +1,26 @@
+
+
+diff -ruN munin-2.0.33.orig/master/Build.PL munin-2.0.33/master/Build.PL
+--- munin-2.0.33.orig/master/Build.PL 2017-03-03 00:02:39.000000000 -0000
++++ munin-2.0.33/master/Build.PL 2017-08-05 15:06:55.799816839 -0000
+@@ -1,3 +1,4 @@
++use lib q[.];
+ use MasterBuilder;
+
+ use warnings;
+diff -ruN munin-2.0.33.orig/node/Build.PL munin-2.0.33/node/Build.PL
+--- munin-2.0.33.orig/node/Build.PL 2017-03-03 00:02:39.000000000 -0000
++++ munin-2.0.33/node/Build.PL 2017-08-05 15:11:07.689824612 -0000
+@@ -1,3 +1,4 @@
++use lib q[.];
+ use NodeBuilder;
+
+ use warnings;
+diff -ruN munin-2.0.33.orig/plugins/Build.PL munin-2.0.33/plugins/Build.PL
+--- munin-2.0.33.orig/plugins/Build.PL 2017-03-03 00:02:39.000000000 -0000
++++ munin-2.0.33/plugins/Build.PL 2017-08-05 15:13:57.056168401 -0000
+@@ -1,3 +1,4 @@
++use lib q[.];
+ use PluginsBuilder;
+
+ use warnings;
diff --git a/net-analyzer/munin/files/munin-async.service b/net-analyzer/munin/files/munin-async.service
new file mode 100644
index 000000000000..add6d238f456
--- /dev/null
+++ b/net-analyzer/munin/files/munin-async.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Munin Async Service
+After=syslog.target network.target
+
+[Service]
+PIDFile=/run/munin/munin-asyncd.pid
+ExecStart=/usr/libexec/munin/munin-asyncd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-analyzer/munin/files/munin-asyncd.init.2 b/net-analyzer/munin/files/munin-asyncd.init.2
new file mode 100644
index 000000000000..59ef4c6b0280
--- /dev/null
+++ b/net-analyzer/munin/files/munin-asyncd.init.2
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/libexec/munin/munin-asyncd
+command_args="--fork"
+pidfile="/run/munin-asyncd.pid"
+start_stop_daemon_args="--background --make-pidfile --user munin-async"
+
+depend() {
+ need munin-node
+ before cron
+}
+
+start_pre() {
+ checkpath -d -o munin-async:munin -m 0750 /var/spool/munin-async
+}
+
+# vim: filetype=gentoo-init-d:
diff --git a/net-analyzer/munin/files/munin-graph.service b/net-analyzer/munin/files/munin-graph.service
new file mode 100644
index 000000000000..9aea1da64e95
--- /dev/null
+++ b/net-analyzer/munin/files/munin-graph.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Munin FastCGI Graph
+Requires=munin-graph.socket
+
+[Service]
+User=munin
+Group=munin
+ExecStart=/usr/libexec/munin/munin-graph
+StandardInput=socket
+StandardOutput=inherit
+StandardError=journal
diff --git a/net-analyzer/munin/files/munin-graph.socket b/net-analyzer/munin/files/munin-graph.socket
new file mode 100644
index 000000000000..533c709c50ec
--- /dev/null
+++ b/net-analyzer/munin/files/munin-graph.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=Munin FastCGI Graph Socket
+
+[Socket]
+ListenStream=/run/munin/fcgi-graph.sock
+
+[Install]
+WantedBy=sockets.target
diff --git a/net-analyzer/munin/files/munin-html.service b/net-analyzer/munin/files/munin-html.service
new file mode 100644
index 000000000000..09fdf162722b
--- /dev/null
+++ b/net-analyzer/munin/files/munin-html.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Munin FastCGI HTML
+Requires=munin-html.socket
+
+[Service]
+User=munin
+Group=munin
+ExecStart=/usr/libexec/munin/munin-html
+StandardInput=socket
+StandardOutput=inherit
+StandardError=journal
diff --git a/net-analyzer/munin/files/munin-html.socket b/net-analyzer/munin/files/munin-html.socket
new file mode 100644
index 000000000000..52fc3c354d33
--- /dev/null
+++ b/net-analyzer/munin/files/munin-html.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=Munin FastCGI HTML Socket
+
+[Socket]
+ListenStream=/run/munin/fcgi-html.sock
+
+[Install]
+WantedBy=sockets.target
diff --git a/net-analyzer/munin/files/munin-node.service b/net-analyzer/munin/files/munin-node.service
new file mode 100644
index 000000000000..92c314b6ec33
--- /dev/null
+++ b/net-analyzer/munin/files/munin-node.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Munin Node Service
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/run/munin-node.pid
+ExecStart=/usr/sbin/munin-node
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-analyzer/munin/files/munin-node_conf.d_1.4.6-r2 b/net-analyzer/munin/files/munin-node_conf.d_1.4.6-r2
new file mode 100644
index 000000000000..79b0e14ef7fd
--- /dev/null
+++ b/net-analyzer/munin/files/munin-node_conf.d_1.4.6-r2
@@ -0,0 +1,7 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Set to the nice level for daemon
+NICE_LEVEL=1
+
+# vim: filetype=gentoo-conf-d:
diff --git a/net-analyzer/munin/files/munin-node_init.d_2.0.19 b/net-analyzer/munin/files/munin-node_init.d_2.0.19
new file mode 100644
index 000000000000..fca7880692cf
--- /dev/null
+++ b/net-analyzer/munin/files/munin-node_init.d_2.0.19
@@ -0,0 +1,26 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+get_munin_config() {
+ awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE"
+}
+
+: ${CFGFILE:=/etc/munin/munin-node.conf}
+
+command=/usr/sbin/munin-node
+command_args="--config ${CFGFILE}"
+pidfile=$(get_munin_config pid_file)
+start_stop_daemon_args="--nicelevel ${NICE_LEVEL:-0} --wait 1500"
+extra_started_commands="reload"
+
+depend() {
+ config "$CFGFILE"
+
+ before cron
+
+ [ "$(get_munin_config log_file)" = "Sys::Syslog" ] && \
+ use logger
+}
+
+# vim: filetype=gentoo-init-d:
diff --git a/net-analyzer/munin/files/munin-node_init.d_2.0.7 b/net-analyzer/munin/files/munin-node_init.d_2.0.7
new file mode 100644
index 000000000000..7932e356f2e8
--- /dev/null
+++ b/net-analyzer/munin/files/munin-node_init.d_2.0.7
@@ -0,0 +1,36 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+get_munin_config() {
+ awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE"
+}
+
+: ${CFGFILE:=/etc/munin/munin-node.conf}
+
+command=/usr/sbin/munin-node
+command_args="--config ${CFGFILE}"
+pidfile=$(get_munin_config pid_file)
+start_stop_daemon_args="--nicelevel ${NICE_LEVEL:-0} --wait 1500"
+extra_started_commands="reload"
+
+depend() {
+ config "$CFGFILE"
+
+ before cron
+
+ [ "$(get_munin_config log_file)" = "Sys::Syslog" ] && \
+ use logger
+}
+
+start_pre() {
+ checkpath -d $(dirname ${pidfile})
+}
+
+reload() {
+ ebegin "Reloading ${SERVICE}"
+ kill -HUP `cat ${pidfile}`
+ eend $?
+}
+
+# vim: filetype=gentoo-init-d:
diff --git a/net-analyzer/munin/files/munin.apache.include b/net-analyzer/munin/files/munin.apache.include
new file mode 100644
index 000000000000..f8b2df5daa66
--- /dev/null
+++ b/net-analyzer/munin/files/munin.apache.include
@@ -0,0 +1,31 @@
+# -*- apache -*-
+
+ScriptAlias /munin-cgi/ /usr/libexec/munin/cgi/
+Alias /munin/static /etc/munin/static
+
+<IfDefine MUNIN_HTML_CGI>
+RewriteEngine on
+
+RewriteCond %{REQUEST_URI} (/|\.html)$
+RewriteCond %{REQUEST_URI} !/static
+RewriteRule ^/munin/(.*) /munin-cgi/munin-cgi-html/$1 [PT,L]
+</IfDefine>
+
+<Directory /usr/libexec/munin/cgi/>
+ Options +ExecCGI
+
+ Order allow,deny
+ Allow from all
+
+ <IfModule mod_fcgid.c>
+ SetHandler fcgid-script
+ </IfModule>
+ <IfModule !mod_fcgid.c>
+ SetHandler cgi-script
+ </IfModule>
+</Directory>
+
+<Directory /etc/munin/static>
+ Order allow,deny
+ Allow from all
+</Directory>
diff --git a/net-analyzer/munin/files/munin.apache.include-2.4 b/net-analyzer/munin/files/munin.apache.include-2.4
new file mode 100644
index 000000000000..ec69cbb07b91
--- /dev/null
+++ b/net-analyzer/munin/files/munin.apache.include-2.4
@@ -0,0 +1,28 @@
+# -*- apache -*-
+
+ScriptAlias /munin-cgi/ /usr/libexec/munin/cgi/
+Alias /munin/static /etc/munin/static
+
+<IfDefine MUNIN_HTML_CGI>
+RewriteEngine on
+
+RewriteCond %{REQUEST_URI} (/|\.html)$
+RewriteCond %{REQUEST_URI} !/static
+RewriteRule ^/munin/(.*) /munin-cgi/munin-cgi-html/$1 [PT,L]
+</IfDefine>
+
+<Directory /usr/libexec/munin/cgi/>
+ Options +ExecCGI
+ Require all granted
+
+ <IfModule mod_fcgid.c>
+ SetHandler fcgid-script
+ </IfModule>
+ <IfModule !mod_fcgid.c>
+ SetHandler cgi-script
+ </IfModule>
+</Directory>
+
+<Directory /etc/munin/static>
+ Require all granted
+</Directory>
diff --git a/net-analyzer/munin/metadata.xml b/net-analyzer/munin/metadata.xml
new file mode 100644
index 000000000000..df14a4c78fe6
--- /dev/null
+++ b/net-analyzer/munin/metadata.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sysadmin@gentoo.org</email>
+ <name>Gentoo Sysadmin Project</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>graaff@gentoo.org</email>
+ <name>Hans de Graaff</name>
+ </maintainer>
+ <longdescription lang="en">
+ Munin the tool surveys all your computers and remembers what it saw. It
+ presents all the information in in graphs through a web interface. Its
+ emphasis is on plug and play capabilities. After completing a installation a
+ high number of monitoring plugins will be playing with no more effort. Using
+ Munin you can easily monitor the performance of your computers, networks,
+ SANs, and quite possibly applications as well. It makes it easy to determine
+ "what's different today" when a performance problem crops up. It makes it
+ easy to see how you're doing capacity wise on all limited resources.
+ </longdescription>
+ <use>
+ <flag name="mysql">
+ Install the packages required for monitoring MySQL. Disabling
+ the flag does not remove any plugin files.
+ </flag>
+ <flag name="postgres">
+ Install the packages required for monitoring
+ PostgreSQL. Disabling the flag does not remove any plugin files.
+ </flag>
+ <flag name="asterisk">
+ Install the packages required for monitoring Asterisk. Disabling
+ the flag does not remove any plugin files.
+ </flag>
+ <flag name="irc">
+ Install the packages required for monitoring IRC. Disabling the
+ flag does not remove any plugin files.
+ </flag>
+ <flag name="memcached">
+ Install the packages required for memcached
+ monitoring. Disabling the flag does not remove any plugin files.
+ </flag>
+ <flag name="ipmi">
+ Install <pkg>sys-apps/ipmitool</pkg> required for monitoring
+ IPMI sensors. Disabling the flag does not remove any plugin
+ file.
+ </flag>
+ <flag name="http">
+ Install <pkg>dev-perl/libwww-perl</pkg> required for monitoring
+ HTTP-based services such as Apache and nginx. Disabling the flag
+ does not remove any plugin file.
+ </flag>
+ <flag name="dhcpd">
+ Install <pkg>dev-perl/Net-IP</pkg>,
+ <pkg>dev-perl/HTTP-Date</pkg> and <pkg>net-misc/dhcp</pkg> to
+ monitor DHCP lease usage. This only works if the server is on
+ the same system as the node, so the server is also brought
+ in. Disabling the flag does not remove any plugin file.
+ </flag>
+ <flag name="java">
+ Build the Java-based plugins to monitor JMX-compatible
+ applications. Disabling the flag removes the jmx monitoring
+ plugins.
+ </flag>
+ <flag name="minimal">
+ Only install munin-node and its plugins. This excludes the
+ scripts to generate the web pages and the graphs.
+ </flag>
+ <flag name="cgi">
+ Install the CGI-compatible scripts for on-the-fly generation of
+ web pages and graphs. This is only meaningful if the minimal USE
+ flag is disabled.
+ </flag>
+ <flag name="apache">
+ Set up the configuration of the CGI generation of HTML and
+ graphs to work with Apache. This also install an include-able
+ configuration file.
+ </flag>
+ <flag name="ipv6">
+ Add support for IPv6 in munin-node. IPv6 support for the master
+ is always enabled, but the node requires a newer version of
+ <pkg>dev-perl/Net-Server</pkg>, capable of listening to IPv6
+ sockets.
+ </flag>
+ <flag name="syslog">
+ Configure the node by default to log on syslog. This requires
+ the presence of <pkg>virtual/perl-Sys-Syslog</pkg>. As of
+ version 2.0.2, the master scripts only log to file, and not to
+ syslog.
+ </flag>
+ <flag name="doc">
+ Build and install a local copy of the HTML documentation for the
+ whole software. This requires <pkg>dev-python/sphinx</pkg> to
+ process the documentation sources.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">munin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-analyzer/munin/munin-2.0.33-r1.ebuild b/net-analyzer/munin/munin-2.0.33-r1.ebuild
new file mode 100644
index 000000000000..3c604180b37e
--- /dev/null
+++ b/net-analyzer/munin/munin-2.0.33-r1.ebuild
@@ -0,0 +1,414 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PATCHSET=2
+
+inherit eutils user java-pkg-opt-2 systemd
+
+MY_P=${P/_/-}
+
+DESCRIPTION="Munin Server Monitoring Tool"
+HOMEPAGE="http://munin-monitoring.org/"
+SRC_URI="
+ https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2"
+REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )"
+
+# Upstream's listing of required modules is NOT correct!
+# Some of the postgres plugins use DBD::Pg, while others call psql directly.
+# Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
+# We replace the original ipmi plugins with the freeipmi_ plugin which at least works.
+DEPEND_COM="
+ dev-lang/perl:=[berkdb]
+ dev-perl/DBI
+ dev-perl/Date-Manip
+ dev-perl/File-Copy-Recursive
+ dev-perl/List-MoreUtils
+ dev-perl/Log-Log4perl
+ dev-perl/Net-CIDR
+ dev-perl/Net-DNS
+ dev-perl/Net-Netmask
+ dev-perl/Net-SNMP
+ dev-perl/Net-Server[ipv6(-)?]
+ virtual/perl-Digest-MD5
+ virtual/perl-Getopt-Long
+ virtual/perl-MIME-Base64
+ virtual/perl-Storable
+ virtual/perl-Text-Balanced
+ virtual/perl-Time-HiRes
+ apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] )
+ asterisk? ( dev-perl/Net-Telnet )
+ cgi? (
+ dev-perl/FCGI
+ dev-perl/CGI-Fast
+ )
+ dhcpd? (
+ >=net-misc/dhcp-3[server]
+ dev-perl/Net-IP
+ dev-perl/HTTP-Date
+ )
+ doc? ( dev-python/sphinx )
+ http? ( dev-perl/libwww-perl )
+ irc? ( dev-perl/Net-IRC )
+ ldap? ( dev-perl/perl-ldap )
+ kernel_linux? ( sys-process/procps )
+ memcached? ( dev-perl/Cache-Memcached )
+ mysql? (
+ virtual/mysql
+ dev-perl/Cache-Cache
+ dev-perl/DBD-mysql
+ )
+ postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* )
+ ssl? ( dev-perl/Net-SSLeay )
+ syslog? ( virtual/perl-Sys-Syslog )
+ !minimal? (
+ dev-perl/HTML-Template
+ dev-perl/IO-Socket-INET6
+ dev-perl/URI
+ >=net-analyzer/rrdtool-1.3[graph,perl]
+ virtual/ssh
+ )
+ "
+
+# Keep this seperate, as previous versions have had other deps here
+DEPEND="${DEPEND_COM}
+ dev-perl/Module-Build
+ java? ( >=virtual/jdk-1.5 )
+ test? (
+ dev-perl/Test-Deep
+ dev-perl/Test-LongString
+ dev-perl/Test-Differences
+ dev-perl/Test-MockModule
+ dev-perl/Test-MockObject
+ dev-perl/File-Slurp
+ dev-perl/IO-stringy
+ dev-perl/IO-Socket-INET6
+ )"
+RDEPEND="${DEPEND_COM}
+ virtual/awk
+ ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 )
+ java? (
+ >=virtual/jre-1.5
+ || ( net-analyzer/netcat6 net-analyzer/netcat )
+ )
+ !minimal? (
+ virtual/cron
+ media-fonts/dejavu
+ )
+ selinux? ( sec-policy/selinux-munin )
+ !<sys-apps/openrc-0.11.8"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup munin
+ enewuser munin 177 -1 /var/lib/munin munin
+ enewuser munin-async -1 /bin/sh /var/spool/munin-async
+ esethome munin-async /var/spool/munin-async
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ epatch "${WORKDIR}"/patches/*.patch
+ eapply "${FILESDIR}/${P}"-perl526.patch
+
+ eapply_user
+
+ java-pkg-opt-2_src_prepare
+}
+
+src_configure() {
+ local cgidir='$(DESTDIR)/usr/libexec/munin/cgi'
+ use cgi || cgidir="${T}/useless/cgi-bin"
+
+ local cgiuser=$(usex apache2 apache munin)
+
+ cat >> "${S}"/Makefile.config <<- EOF
+ PREFIX=\$(DESTDIR)/usr
+ CONFDIR=\$(DESTDIR)/etc/munin
+ DOCDIR=${T}/useless/doc
+ MANDIR=\$(PREFIX)/share/man
+ LIBDIR=\$(PREFIX)/libexec/munin
+ HTMLDIR=\$(DESTDIR)/var/www/localhost/htdocs/munin
+ CGIDIR=${cgidir}
+ CGITMPDIR=\$(DESTDIR)/var/cache/munin-cgi
+ CGIUSER=${cgiuser}
+ DBDIR=\$(DESTDIR)/var/lib/munin
+ DBDIRNODE=\$(DESTDIR)/var/lib/munin-node
+ SPOOLDIR=\$(DESTDIR)/var/spool/munin-async
+ LOGDIR=\$(DESTDIR)/var/log/munin
+ PERLSITELIB=$(perl -V:vendorlib | cut -d"'" -f2)
+ JCVALID=$(usex java yes no)
+ STATEDIR=\$(DESTDIR)/run/munin
+ EOF
+}
+
+# parallel make and install need to be fixed before, and I haven't
+# gotten around to do so yet.
+src_compile() {
+ emake -j1
+ use doc && emake -C doc html
+}
+
+src_test() {
+ if [[ ${EUID} == 0 ]]; then
+ eerror "You cannot run tests as root."
+ eerror "Please enable FEATURES=userpriv before proceeding."
+ return 1
+ fi
+
+ local testtargets="test-common test-node test-plugins"
+ use minimal || testtargets+=" test-master"
+
+ LC_ALL=C emake -j1 ${testtargets}
+}
+
+src_install() {
+ local dirs="
+ /var/log/munin
+ /var/lib/munin/plugin-state
+ /etc/munin/plugin-conf.d
+ /etc/munin/plugins"
+ use minimal || dirs+=" /etc/munin/munin-conf.d/"
+
+ keepdir ${dirs}
+ fowners munin:munin ${dirs}
+
+ # parallel install doesn't work and it's also pointless to have this
+ # run in parallel for now (because it uses internal loops).
+ emake -j1 DESTDIR="${D}" $(usex minimal "install-minimal install-man" install)
+
+ # we remove /run from the install, as it's not the package's to deal
+ # with.
+ rm -rf "${D}"/run || die
+
+ # remove the plugins for non-Gentoo package managers; use -f so that
+ # it doesn't fail when installing on non-Linux platforms.
+ rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die
+
+ insinto /etc/munin/plugin-conf.d/
+ newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node
+
+ newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node
+ newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
+
+ newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd
+
+ dodir /usr/lib/tmpfiles.d
+ cat > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<- EOF
+ d /run/munin 0700 munin munin - -
+ EOF
+
+ systemd_dounit "${FILESDIR}"/munin-async.service
+ systemd_dounit "${FILESDIR}"/munin-graph.{service,socket}
+ systemd_dounit "${FILESDIR}"/munin-html.{service,socket}
+ systemd_dounit "${FILESDIR}"/munin-node.service
+
+ cat >> "${T}"/munin.env <<- EOF
+ CONFIG_PROTECT=/var/spool/munin-async/.ssh
+ EOF
+ newenvd "${T}"/munin.env 50munin
+
+ dodoc README ChangeLog INSTALL
+ if use doc; then
+ cd "${S}"/doc/_build/html || die
+ docinto html
+ dodoc -r *
+ cd "${S}" || die
+ fi
+
+ dodir /etc/logrotate.d/
+ sed -e "s:@CGIUSER@:$(usex apache2 apache munin):g" \
+ "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin
+
+ dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_
+
+ if use syslog; then
+ sed -i -e '/log_file/s| .*| Sys::Syslog|' \
+ "${D}"/etc/munin/munin-node.conf || die
+ fi
+
+ # Use a simpler pid file to avoid trouble with /run in tmpfs. The
+ # munin-node service is ran as user root, and only later drops
+ # privileges.
+ sed -i -e 's:/run/munin/munin-node.pid:/run/munin-node.pid:' \
+ "${D}"/etc/munin/munin-node.conf || die
+
+ keepdir /var/spool/munin-async/.ssh
+ touch "${D}"/var/spool/munin-async/.ssh/authorized_keys
+ fowners munin-async:munin /var/spool/munin-async{,/.ssh/{,authorized_keys}}
+ fperms 0750 /var/spool/munin-async{,/.ssh}
+ fperms 0600 /var/spool/munin-async/.ssh/authorized_keys
+
+ if use minimal; then
+ # This requires the presence of munin-update, which is part of
+ # the non-minimal install...
+ rm "${D}"/usr/libexec/munin/plugins/munin_stats
+ else
+ # remove font files so that we don't have to keep them around
+ rm "${D}"/usr/libexec/${PN}/*.ttf || die
+
+ if use cgi; then
+ sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die
+
+ keepdir /var/cache/munin-cgi
+ touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log
+ fowners $(usex apache2 apache munin) \
+ /var/cache/munin-cgi \
+ /var/log/munin/munin-cgi-{graph,html}.log
+
+ if use apache2; then
+ insinto /etc/apache2/vhosts.d
+ newins "${FILESDIR}"/munin.apache.include munin.include
+ newins "${FILESDIR}"/munin.apache.include-2.4 munin-2.4.include
+ fi
+ else
+ sed \
+ -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \
+ -i "${D}"/etc/munin/munin.conf || die
+ fi
+
+ keepdir /var/lib/munin/.ssh
+ cat >> "${D}"/var/lib/munin/.ssh/config <<- EOF
+ IdentityFile /var/lib/munin/.ssh/id_ecdsa
+ IdentityFile /var/lib/munin/.ssh/id_rsa
+ EOF
+
+ fowners munin:munin /var/lib/munin/.ssh/{,config}
+ fperms go-rwx /var/lib/munin/.ssh/{,config}
+
+ dodir /usr/share/${PN}
+ cat >> "${D}"/usr/share/${PN}/crontab <<- EOF
+ # Force the shell to bash
+ SHELL=/bin/bash
+ # Mail reports to root@, not munin@
+ MAILTO=root
+
+ # This runs the munin task every 5 minutes.
+ */5 * * * * /usr/bin/munin-cron
+
+ # Alternatively, this route works differently
+ # Update once a minute (for busy sites)
+ #*/1 * * * * /usr/libexec/munin/munin-update
+ ## Check for limit excess every 2 minutes
+ #*/2 * * * * /usr/libexec/munin/munin-limits
+ ## Update graphs every 5 minutes
+ #*/5 * * * * nice /usr/libexec/munin/munin-graph
+ ## Update HTML pages every 15 minutes
+ #*/15 * * * * nice /usr/libexec/munin/munin-html
+ EOF
+
+ cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF
+ # Mail reports to root@, not munin@, only execute one at a time
+ !mailto(root),serial(true)
+
+ # This runs the munin task every 5 minutes.
+ @ 5 /usr/bin/munin-cron
+
+ # Alternatively, this route works differently
+ # Update once a minute (for busy sites)
+ #@ 1 /usr/libexec/munin/munin-update
+ ## Check for limit excess every 2 minutes
+ #@ 2 /usr/libexec/munin/munin-limits
+ ## Update graphs every 5 minutes
+ #@ 5 nice /usr/libexec/munin/munin-graph
+ ## Update HTML pages every 15 minutes
+ #@ 15 nice /usr/libexec/munin/munin-html
+ EOF
+
+ # remove .htaccess file
+ find "${D}" -name .htaccess -delete || die
+ fi
+}
+
+pkg_config() {
+ if use minimal; then
+ einfo "Nothing to do."
+ return 0
+ fi
+
+ einfo "Press enter to install the default crontab for the munin master"
+ einfo "installation from /usr/share/${PN}/f?crontab"
+ einfo "If you have a large site, you may wish to customize it."
+ read
+
+ ebegin "Setting up cron ..."
+ if has_version sys-process/fcron; then
+ fcrontab - -u munin < /usr/share/${PN}/fcrontab
+ else
+ # dcron is very fussy about syntax
+ # the following is the only form that works in BOTH dcron and vixie-cron
+ crontab - -u munin < /usr/share/${PN}/crontab
+ fi
+ eend $?
+
+ einfo "Press enter to set up the SSH keys used for SSH transport"
+ read
+
+ # generate one rsa (for legacy) and one ecdsa (for new systems)
+ ssh-keygen -t rsa \
+ -f /var/lib/munin/.ssh/id_rsa -N '' \
+ -C "created by portage for ${CATEGORY}/${PN}" || die
+ ssh-keygen -t ecdsa \
+ -f /var/lib/munin/.ssh/id_ecdsa -N '' \
+ -C "created by portage for ${CATEGORY}/${PN}" || die
+ chown -R munin:munin /var/lib/munin/.ssh || die
+ chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die
+
+ einfo "Your public keys are available in "
+ einfo " /var/lib/munin/.ssh/id_rsa.pub"
+ einfo " /var/lib/munin/.ssh/id_ecdsa.pub"
+ einfo "and follows for convenience"
+ echo
+ cat /var/lib/munin/.ssh/id_*.pub
+}
+
+pkg_postinst() {
+ elog "Please follow the munin documentation to set up the plugins you"
+ elog "need, afterwards start munin-node."
+ elog ""
+ elog "To make use of munin-async, make sure to set up the corresponding"
+ elog "SSH key in /var/lib/munin-async/.ssh/authorized_keys"
+ elog ""
+ if ! use minimal; then
+ elog "Please run"
+ elog " emerge --config net-analyzer/munin"
+ elog "to automatically configure munin's cronjobs as well as generate"
+ elog "passwordless SSH keys to be used with munin-async."
+ fi
+ elog ""
+ elog "Further information about setting up Munin in Gentoo can be found"
+ elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin"
+
+ if use cgi; then
+ chown $(usex apache2 apache munin) \
+ "${ROOT}"/var/cache/munin-cgi \
+ "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log
+
+ if use apache2; then
+ elog "To use Munin with CGI you should include /etc/apache2/vhosts.d/munin.include"
+ elog "or /etc/apache2/vhosts.d/munin-2.4.include (for Apache 2.4) from the virtual"
+ elog "host you want it to be served."
+ elog "If you want to enable CGI-based HTML as well, you have to add to"
+ elog "/etc/conf.d/apache2 the option -D MUNIN_HTML_CGI."
+ else
+ elog "Effective CGI support has just been added in 2.0.7-r6."
+ elog "Documentation on how to use it is still sparse."
+ fi
+ fi
+
+ # we create this here as we don't want Portage to check /run
+ # symlinks but we still need this to be present before the reboot.
+ if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then
+ mkdir "${ROOT}"/run/munin
+ chown munin:munin "${ROOT}"/run/munin
+ chmod 0700 "${ROOT}"/run/munin
+ fi
+}
diff --git a/net-analyzer/munin/munin-2.0.33.ebuild b/net-analyzer/munin/munin-2.0.33.ebuild
new file mode 100644
index 000000000000..463f33791fcc
--- /dev/null
+++ b/net-analyzer/munin/munin-2.0.33.ebuild
@@ -0,0 +1,412 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PATCHSET=1
+
+inherit eutils user java-pkg-opt-2 systemd
+
+MY_P=${P/_/-}
+
+DESCRIPTION="Munin Server Monitoring Tool"
+HOMEPAGE="http://munin-monitoring.org/"
+SRC_URI="
+ https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~mips ppc x86"
+IUSE="asterisk irc java memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache"
+REQUIRED_USE="cgi? ( !minimal ) apache? ( cgi )"
+
+# Upstream's listing of required modules is NOT correct!
+# Some of the postgres plugins use DBD::Pg, while others call psql directly.
+# Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
+# We replace the original ipmi plugins with the freeipmi_ plugin which at least works.
+DEPEND_COM="
+ dev-lang/perl:=[berkdb]
+ dev-perl/DBI
+ dev-perl/Date-Manip
+ dev-perl/File-Copy-Recursive
+ dev-perl/List-MoreUtils
+ dev-perl/Log-Log4perl
+ dev-perl/Net-CIDR
+ dev-perl/Net-DNS
+ dev-perl/Net-Netmask
+ dev-perl/Net-SNMP
+ dev-perl/Net-Server[ipv6(-)?]
+ virtual/perl-Digest-MD5
+ virtual/perl-Getopt-Long
+ virtual/perl-MIME-Base64
+ virtual/perl-Storable
+ virtual/perl-Text-Balanced
+ virtual/perl-Time-HiRes
+ apache? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] )
+ asterisk? ( dev-perl/Net-Telnet )
+ cgi? (
+ dev-perl/FCGI
+ dev-perl/CGI-Fast
+ )
+ dhcpd? (
+ >=net-misc/dhcp-3[server]
+ dev-perl/Net-IP
+ dev-perl/HTTP-Date
+ )
+ doc? ( dev-python/sphinx )
+ http? ( dev-perl/libwww-perl )
+ irc? ( dev-perl/Net-IRC )
+ kernel_linux? ( sys-process/procps )
+ memcached? ( dev-perl/Cache-Memcached )
+ mysql? (
+ virtual/mysql
+ dev-perl/Cache-Cache
+ dev-perl/DBD-mysql
+ )
+ postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* )
+ ssl? ( dev-perl/Net-SSLeay )
+ syslog? ( virtual/perl-Sys-Syslog )
+ !minimal? (
+ dev-perl/HTML-Template
+ dev-perl/IO-Socket-INET6
+ dev-perl/URI
+ >=net-analyzer/rrdtool-1.3[graph,perl]
+ virtual/ssh
+ )
+ "
+
+# Keep this seperate, as previous versions have had other deps here
+DEPEND="${DEPEND_COM}
+ dev-perl/Module-Build
+ java? ( >=virtual/jdk-1.5 )
+ test? (
+ dev-perl/Test-Deep
+ dev-perl/Test-LongString
+ dev-perl/Test-Differences
+ dev-perl/Test-MockModule
+ dev-perl/Test-MockObject
+ dev-perl/File-Slurp
+ dev-perl/IO-stringy
+ dev-perl/IO-Socket-INET6
+ )"
+RDEPEND="${DEPEND_COM}
+ virtual/awk
+ ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 )
+ java? (
+ >=virtual/jre-1.5
+ || ( net-analyzer/netcat6 net-analyzer/netcat )
+ )
+ !minimal? (
+ virtual/cron
+ media-fonts/dejavu
+ )
+ selinux? ( sec-policy/selinux-munin )
+ !<sys-apps/openrc-0.11.8"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup munin
+ enewuser munin 177 -1 /var/lib/munin munin
+ enewuser munin-async -1 /bin/sh /var/spool/munin-async
+ esethome munin-async /var/spool/munin-async
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ epatch "${WORKDIR}"/patches/*.patch
+
+ eapply_user
+
+ java-pkg-opt-2_src_prepare
+}
+
+src_configure() {
+ local cgidir='$(DESTDIR)/usr/libexec/munin/cgi'
+ use cgi || cgidir="${T}/useless/cgi-bin"
+
+ local cgiuser=$(usex apache apache munin)
+
+ cat >> "${S}"/Makefile.config <<- EOF
+ PREFIX=\$(DESTDIR)/usr
+ CONFDIR=\$(DESTDIR)/etc/munin
+ DOCDIR=${T}/useless/doc
+ MANDIR=\$(PREFIX)/share/man
+ LIBDIR=\$(PREFIX)/libexec/munin
+ HTMLDIR=\$(DESTDIR)/var/www/localhost/htdocs/munin
+ CGIDIR=${cgidir}
+ CGITMPDIR=\$(DESTDIR)/var/cache/munin-cgi
+ CGIUSER=${cgiuser}
+ DBDIR=\$(DESTDIR)/var/lib/munin
+ DBDIRNODE=\$(DESTDIR)/var/lib/munin-node
+ SPOOLDIR=\$(DESTDIR)/var/spool/munin-async
+ LOGDIR=\$(DESTDIR)/var/log/munin
+ PERLSITELIB=$(perl -V:vendorlib | cut -d"'" -f2)
+ JCVALID=$(usex java yes no)
+ STATEDIR=\$(DESTDIR)/run/munin
+ EOF
+}
+
+# parallel make and install need to be fixed before, and I haven't
+# gotten around to do so yet.
+src_compile() {
+ emake -j1
+ use doc && emake -C doc html
+}
+
+src_test() {
+ if [[ ${EUID} == 0 ]]; then
+ eerror "You cannot run tests as root."
+ eerror "Please enable FEATURES=userpriv before proceeding."
+ return 1
+ fi
+
+ local testtargets="test-common test-node test-plugins"
+ use minimal || testtargets+=" test-master"
+
+ LC_ALL=C emake -j1 ${testtargets}
+}
+
+src_install() {
+ local dirs="
+ /var/log/munin
+ /var/lib/munin/plugin-state
+ /etc/munin/plugin-conf.d
+ /etc/munin/plugins"
+ use minimal || dirs+=" /etc/munin/munin-conf.d/"
+
+ keepdir ${dirs}
+ fowners munin:munin ${dirs}
+
+ # parallel install doesn't work and it's also pointless to have this
+ # run in parallel for now (because it uses internal loops).
+ emake -j1 DESTDIR="${D}" $(usex minimal "install-minimal install-man" install)
+
+ # we remove /run from the install, as it's not the package's to deal
+ # with.
+ rm -rf "${D}"/run || die
+
+ # remove the plugins for non-Gentoo package managers; use -f so that
+ # it doesn't fail when installing on non-Linux platforms.
+ rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die
+
+ insinto /etc/munin/plugin-conf.d/
+ newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node
+
+ newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node
+ newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
+
+ newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd
+
+ dodir /usr/lib/tmpfiles.d
+ cat > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<- EOF
+ d /run/munin 0700 munin munin - -
+ EOF
+
+ systemd_dounit "${FILESDIR}"/munin-async.service
+ systemd_dounit "${FILESDIR}"/munin-graph.{service,socket}
+ systemd_dounit "${FILESDIR}"/munin-html.{service,socket}
+ systemd_dounit "${FILESDIR}"/munin-node.service
+
+ cat >> "${T}"/munin.env <<- EOF
+ CONFIG_PROTECT=/var/spool/munin-async/.ssh
+ EOF
+ newenvd "${T}"/munin.env 50munin
+
+ dodoc README ChangeLog INSTALL
+ if use doc; then
+ cd "${S}"/doc/_build/html || die
+ docinto html
+ dodoc -r *
+ cd "${S}" || die
+ fi
+
+ dodir /etc/logrotate.d/
+ sed -e "s:@CGIUSER@:$(usex apache apache munin):g" \
+ "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin
+
+ dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_
+
+ if use syslog; then
+ sed -i -e '/log_file/s| .*| Sys::Syslog|' \
+ "${D}"/etc/munin/munin-node.conf || die
+ fi
+
+ # Use a simpler pid file to avoid trouble with /run in tmpfs. The
+ # munin-node service is ran as user root, and only later drops
+ # privileges.
+ sed -i -e 's:/run/munin/munin-node.pid:/run/munin-node.pid:' \
+ "${D}"/etc/munin/munin-node.conf || die
+
+ keepdir /var/spool/munin-async/.ssh
+ touch "${D}"/var/spool/munin-async/.ssh/authorized_keys
+ fowners munin-async:munin /var/spool/munin-async{,/.ssh/{,authorized_keys}}
+ fperms 0750 /var/spool/munin-async{,/.ssh}
+ fperms 0600 /var/spool/munin-async/.ssh/authorized_keys
+
+ if use minimal; then
+ # This requires the presence of munin-update, which is part of
+ # the non-minimal install...
+ rm "${D}"/usr/libexec/munin/plugins/munin_stats
+ else
+ # remove font files so that we don't have to keep them around
+ rm "${D}"/usr/libexec/${PN}/*.ttf || die
+
+ if use cgi; then
+ sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die
+
+ keepdir /var/cache/munin-cgi
+ touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log
+ fowners $(usex apache apache munin) \
+ /var/cache/munin-cgi \
+ /var/log/munin/munin-cgi-{graph,html}.log
+
+ if use apache; then
+ insinto /etc/apache2/vhosts.d
+ newins "${FILESDIR}"/munin.apache.include munin.include
+ newins "${FILESDIR}"/munin.apache.include-2.4 munin-2.4.include
+ fi
+ else
+ sed \
+ -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \
+ -i "${D}"/etc/munin/munin.conf || die
+ fi
+
+ keepdir /var/lib/munin/.ssh
+ cat >> "${D}"/var/lib/munin/.ssh/config <<- EOF
+ IdentityFile /var/lib/munin/.ssh/id_ecdsa
+ IdentityFile /var/lib/munin/.ssh/id_rsa
+ EOF
+
+ fowners munin:munin /var/lib/munin/.ssh/{,config}
+ fperms go-rwx /var/lib/munin/.ssh/{,config}
+
+ dodir /usr/share/${PN}
+ cat >> "${D}"/usr/share/${PN}/crontab <<- EOF
+ # Force the shell to bash
+ SHELL=/bin/bash
+ # Mail reports to root@, not munin@
+ MAILTO=root
+
+ # This runs the munin task every 5 minutes.
+ */5 * * * * /usr/bin/munin-cron
+
+ # Alternatively, this route works differently
+ # Update once a minute (for busy sites)
+ #*/1 * * * * /usr/libexec/munin/munin-update
+ ## Check for limit excess every 2 minutes
+ #*/2 * * * * /usr/libexec/munin/munin-limits
+ ## Update graphs every 5 minutes
+ #*/5 * * * * nice /usr/libexec/munin/munin-graph
+ ## Update HTML pages every 15 minutes
+ #*/15 * * * * nice /usr/libexec/munin/munin-html
+ EOF
+
+ cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF
+ # Mail reports to root@, not munin@, only execute one at a time
+ !mailto(root),serial(true)
+
+ # This runs the munin task every 5 minutes.
+ @ 5 /usr/bin/munin-cron
+
+ # Alternatively, this route works differently
+ # Update once a minute (for busy sites)
+ #@ 1 /usr/libexec/munin/munin-update
+ ## Check for limit excess every 2 minutes
+ #@ 2 /usr/libexec/munin/munin-limits
+ ## Update graphs every 5 minutes
+ #@ 5 nice /usr/libexec/munin/munin-graph
+ ## Update HTML pages every 15 minutes
+ #@ 15 nice /usr/libexec/munin/munin-html
+ EOF
+
+ # remove .htaccess file
+ find "${D}" -name .htaccess -delete || die
+ fi
+}
+
+pkg_config() {
+ if use minimal; then
+ einfo "Nothing to do."
+ return 0
+ fi
+
+ einfo "Press enter to install the default crontab for the munin master"
+ einfo "installation from /usr/share/${PN}/f?crontab"
+ einfo "If you have a large site, you may wish to customize it."
+ read
+
+ ebegin "Setting up cron ..."
+ if has_version sys-process/fcron; then
+ fcrontab - -u munin < /usr/share/${PN}/fcrontab
+ else
+ # dcron is very fussy about syntax
+ # the following is the only form that works in BOTH dcron and vixie-cron
+ crontab - -u munin < /usr/share/${PN}/crontab
+ fi
+ eend $?
+
+ einfo "Press enter to set up the SSH keys used for SSH transport"
+ read
+
+ # generate one rsa (for legacy) and one ecdsa (for new systems)
+ ssh-keygen -t rsa \
+ -f /var/lib/munin/.ssh/id_rsa -N '' \
+ -C "created by portage for ${CATEGORY}/${PN}" || die
+ ssh-keygen -t ecdsa \
+ -f /var/lib/munin/.ssh/id_ecdsa -N '' \
+ -C "created by portage for ${CATEGORY}/${PN}" || die
+ chown -R munin:munin /var/lib/munin/.ssh || die
+ chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die
+
+ einfo "Your public keys are available in "
+ einfo " /var/lib/munin/.ssh/id_rsa.pub"
+ einfo " /var/lib/munin/.ssh/id_ecdsa.pub"
+ einfo "and follows for convenience"
+ echo
+ cat /var/lib/munin/.ssh/id_*.pub
+}
+
+pkg_postinst() {
+ elog "Please follow the munin documentation to set up the plugins you"
+ elog "need, afterwards start munin-node."
+ elog ""
+ elog "To make use of munin-async, make sure to set up the corresponding"
+ elog "SSH key in /var/lib/munin-async/.ssh/authorized_keys"
+ elog ""
+ if ! use minimal; then
+ elog "Please run"
+ elog " emerge --config net-analyzer/munin"
+ elog "to automatically configure munin's cronjobs as well as generate"
+ elog "passwordless SSH keys to be used with munin-async."
+ fi
+ elog ""
+ elog "Further information about setting up Munin in Gentoo can be found"
+ elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin"
+
+ if use cgi; then
+ chown $(usex apache apache munin) \
+ "${ROOT}"/var/cache/munin-cgi \
+ "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log
+
+ if use apache; then
+ elog "To use Munin with CGI you should include /etc/apache2/vhosts.d/munin.include"
+ elog "or /etc/apache2/vhosts.d/munin-2.4.include (for Apache 2.4) from the virtual"
+ elog "host you want it to be served."
+ elog "If you want to enable CGI-based HTML as well, you have to add to"
+ elog "/etc/conf.d/apache2 the option -D MUNIN_HTML_CGI."
+ else
+ elog "Effective CGI support has just been added in 2.0.7-r6."
+ elog "Documentation on how to use it is still sparse."
+ fi
+ fi
+
+ # we create this here as we don't want Portage to check /run
+ # symlinks but we still need this to be present before the reboot.
+ if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then
+ mkdir "${ROOT}"/run/munin
+ chown munin:munin "${ROOT}"/run/munin
+ chmod 0700 "${ROOT}"/run/munin
+ fi
+}
diff --git a/net-analyzer/munin/munin-2.1.9999.ebuild b/net-analyzer/munin/munin-2.1.9999.ebuild
new file mode 100644
index 000000000000..d041ec7f4195
--- /dev/null
+++ b/net-analyzer/munin/munin-2.1.9999.ebuild
@@ -0,0 +1,381 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils user java-pkg-opt-2 git-2
+
+EGIT_REPO_URI="https://github.com/munin-monitoring/${PN}.git"
+
+DESCRIPTION="Munin Server Monitoring Tool"
+HOMEPAGE="http://munin-monitoring.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="irc java memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache"
+REQUIRED_USE="cgi? ( !minimal ) apache? ( cgi )"
+
+# Upstream's listing of required modules is NOT correct!
+# Some of the postgres plugins use DBD::Pg, while others call psql directly.
+# Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
+# We replace the original ipmi plugins with the freeipmi_ plugin which at least works.
+DEPEND_COM="dev-lang/perl:=[berkdb]
+ sys-process/procps
+ doc? ( dev-python/sphinx )
+ irc? ( dev-perl/Net-IRC )
+ mysql? ( virtual/mysql
+ dev-perl/Cache-Cache
+ dev-perl/DBD-mysql )
+ ssl? ( dev-perl/Net-SSLeay )
+ postgres? ( dev-perl/DBD-Pg dev-db/postgresql )
+ memcached? ( dev-perl/Cache-Memcached )
+ cgi? ( dev-perl/FCGI )
+ apache? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] )
+ syslog? ( virtual/perl-Sys-Syslog )
+ http? ( dev-perl/libwww-perl )
+ dhcpd? (
+ >=net-misc/dhcp-3[server]
+ dev-perl/Net-IP
+ dev-perl/HTTP-Date
+ )
+ dev-perl/DBI
+ dev-perl/Date-Manip
+ dev-perl/File-Copy-Recursive
+ dev-perl/List-MoreUtils
+ dev-perl/Log-Log4perl
+ dev-perl/Net-CIDR
+ dev-perl/Net-Netmask
+ dev-perl/Net-SNMP
+ dev-perl/Net-Server[ipv6(-)?]
+ virtual/perl-Digest-MD5
+ virtual/perl-Getopt-Long
+ virtual/perl-MIME-Base64
+ virtual/perl-Storable
+ virtual/perl-Text-Balanced
+ virtual/perl-Time-HiRes
+ !minimal? (
+ dev-perl/HTML-Template
+ dev-perl/IO-Socket-INET6
+ dev-perl/URI
+ >=net-analyzer/rrdtool-1.3[graph,perl]
+ virtual/ssh
+ )"
+
+# Keep this seperate, as previous versions have had other deps here
+DEPEND="${DEPEND_COM}
+ dev-perl/Module-Build
+ java? ( >=virtual/jdk-1.5 )
+ test? (
+ dev-perl/Test-Deep
+ dev-perl/Test-LongString
+ dev-perl/Test-Differences
+ dev-perl/Test-MockModule
+ dev-perl/Test-MockObject
+ dev-perl/File-Slurp
+ dev-perl/IO-stringy
+ dev-perl/IO-Socket-INET6
+ )"
+RDEPEND="${DEPEND_COM}
+ virtual/awk
+ ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 )
+ java? (
+ >=virtual/jre-1.5
+ || ( net-analyzer/netcat6 net-analyzer/netcat )
+ )
+ !minimal? (
+ virtual/cron
+ media-fonts/dejavu
+ )
+ selinux? ( sec-policy/selinux-munin )
+ !<sys-apps/openrc-0.11.8"
+
+pkg_setup() {
+ enewgroup munin
+ enewuser munin 177 -1 /var/lib/munin munin
+ enewuser munin-async -1 /bin/sh /var/spool/munin-async
+ esethome munin-async /var/spool/munin-async
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+}
+
+src_configure() {
+ local cgidir='$(DESTDIR)/usr/libexec/munin/cgi'
+ use cgi || cgidir="${T}/useless/cgi-bin"
+
+ local cgiuser=$(usex apache apache munin)
+
+ cat - >> "${S}"/Makefile.config <<EOF
+PREFIX=\$(DESTDIR)/usr
+CONFDIR=\$(DESTDIR)/etc/munin
+DOCDIR=${T}/useless/doc
+MANDIR=\$(PREFIX)/share/man
+LIBDIR=\$(PREFIX)/libexec/munin
+HTMLDIR=\$(DESTDIR)/var/www/localhost/htdocs/munin
+CGIDIR=${cgidir}
+CGITMPDIR=\$(DESTDIR)/var/cache/munin-cgi
+CGIUSER=${cgiuser}
+DBDIR=\$(DESTDIR)/var/lib/munin
+DBDIRNODE=\$(DESTDIR)/var/lib/munin-node
+SPOOLDIR=\$(DESTDIR)/var/spool/munin-async
+LOGDIR=\$(DESTDIR)/var/log/munin
+PERLSITELIB=$(perl -V:vendorlib | cut -d"'" -f2)
+JCVALID=$(usex java yes no)
+STATEDIR=\$(DESTDIR)/run/munin
+EOF
+}
+
+# parallel make and install need to be fixed before, and I haven't
+# gotten around to do so yet.
+src_compile() {
+ emake -j1
+ if use doc; then
+ emake -C doc html
+ fi
+}
+
+src_test() {
+ if [[ ${EUID} == 0 ]]; then
+ eerror "You cannot run tests as root."
+ eerror "Please enable FEATURES=userpriv before proceeding."
+ return 1
+ fi
+
+ local testtargets="test-common test-node test-plugins"
+ use minimal || testtargets+=" test-master"
+
+ LC_ALL=C emake -j1 ${testtargets}
+}
+
+src_install() {
+ local dirs="
+ /var/log/munin
+ /var/lib/munin/plugin-state
+ /etc/munin/plugin-conf.d
+ /etc/munin/plugins"
+ use minimal || dirs+=" /etc/munin/munin-conf.d/"
+
+ keepdir ${dirs}
+ fowners munin:munin ${dirs}
+
+ # parallel install doesn't work and it's also pointless to have this
+ # run in parallel for now (because it uses internal loops).
+ emake -j1 DESTDIR="${D}" $(usex minimal "install-minimal install-man" install)
+
+ # we remove /run from the install, as it's not the package's to deal
+ # with.
+ rm -rf "${D}"/run
+
+ # remove the plugins for non-Gentoo package managers
+ rm "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die
+
+ insinto /etc/munin/plugin-conf.d/
+ newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node
+
+ newinitd "${FILESDIR}"/munin-node_init.d_2.0.7 munin-node
+ newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
+
+ newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd
+
+ cat - >> "${T}"/munin.env <<EOF
+CONFIG_PROTECT=/var/spool/munin-async/.ssh
+EOF
+ newenvd "${T}"/munin.env 50munin
+
+ dodoc README.rst ChangeLog INSTALL
+ if use doc; then
+ cd "${S}"/doc/_build/html
+ dohtml -r *
+ cd "${S}"
+ fi
+
+ dodir /etc/logrotate.d/
+ sed -e "s:@CGIUSER@:$(usex apache apache munin):g" \
+ "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin
+
+ dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_
+
+ if use syslog; then
+ sed -i -e '/log_file/s| .*| Sys::Syslog|' \
+ "${D}"/etc/munin/munin-node.conf || die
+ fi
+
+ # Use a simpler pid file to avoid trouble with /run in tmpfs. The
+ # munin-node service is ran as user root, and only later drops
+ # privileges.
+ sed -i -e 's:/run/munin/munin-node.pid:/run/munin-node.pid:' \
+ "${D}"/etc/munin/munin-node.conf || die
+
+ keepdir /var/spool/munin-async/.ssh
+ touch "${D}"/var/spool/munin-async/.ssh/authorized_keys
+ fowners munin-async:munin /var/spool/munin-async{,/.ssh/{,authorized_keys}}
+ fperms 0750 /var/spool/munin-async{,/.ssh}
+ fperms 0600 /var/spool/munin-async/.ssh/authorized_keys
+
+ if use minimal; then
+ # This requires the presence of munin-update, which is part of
+ # the non-minimal install...
+ rm "${D}"/usr/libexec/munin/plugins/munin_stats
+ else
+ dodir /usr/lib/tmpfiles.d
+ cat - > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<EOF
+d /run/munin 0700 munin munin - -
+EOF
+
+ # remove font files so that we don't have to keep them around
+ rm "${D}"/usr/libexec/${PN}/*.ttf || die
+
+ if use cgi; then
+ sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die
+
+ keepdir /var/cache/munin-cgi
+ touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log
+ fowners $(usex apache apache munin) \
+ /var/cache/munin-cgi \
+ /var/log/munin/munin-cgi-{graph,html}.log
+
+ if use apache; then
+ insinto /etc/apache2/vhosts.d
+ newins "${FILESDIR}"/munin.apache.include munin.include
+ newins "${FILESDIR}"/munin.apache.include-2.4 munin-2.4.include
+ fi
+ else
+ sed -i -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' "${D}"/etc/munin/munin.conf || die
+ fi
+
+ keepdir /var/lib/munin/.ssh
+ cat - >> "${D}"/var/lib/munin/.ssh/config <<EOF
+IdentityFile /var/lib/munin/.ssh/id_ecdsa
+IdentityFile /var/lib/munin/.ssh/id_rsa
+EOF
+
+ fowners munin:munin /var/lib/munin/.ssh/{,config}
+ fperms go-rwx /var/lib/munin/.ssh/{,config}
+
+ dodir /usr/share/${PN}
+ cat - >> "${D}"/usr/share/${PN}/crontab <<EOF
+# Force the shell to bash
+SHELL=/bin/bash
+# Mail reports to root@, not munin@
+MAILTO=root
+
+# This runs the munin task every 5 minutes.
+*/5 * * * * /usr/bin/munin-cron
+
+# Alternatively, this route works differently
+# Update once a minute (for busy sites)
+#*/1 * * * * /usr/libexec/munin/munin-update
+## Check for limit excess every 2 minutes
+#*/2 * * * * /usr/libexec/munin/munin-limits
+## Update graphs every 5 minutes
+#*/5 * * * * nice /usr/libexec/munin/munin-graph
+## Update HTML pages every 15 minutes
+#*/15 * * * * nice /usr/libexec/munin/munin-html
+EOF
+
+ cat - >> "${D}"/usr/share/${PN}/fcrontab <<EOF
+# Mail reports to root@, not munin@, only execute one at a time
+!mailto(root),serial(true)
+
+# This runs the munin task every 5 minutes.
+@ 5 /usr/bin/munin-cron
+
+# Alternatively, this route works differently
+# Update once a minute (for busy sites)
+#@ 1 /usr/libexec/munin/munin-update
+## Check for limit excess every 2 minutes
+#@ 2 /usr/libexec/munin/munin-limits
+## Update graphs every 5 minutes
+#@ 5 nice /usr/libexec/munin/munin-graph
+## Update HTML pages every 15 minutes
+#@ 15 nice /usr/libexec/munin/munin-html
+EOF
+
+ # remove .htaccess file
+ find "${D}" -name .htaccess -delete || die
+ fi
+}
+
+pkg_config() {
+ if use minimal; then
+ einfo "Nothing to do."
+ return 0
+ fi
+
+ einfo "Press enter to install the default crontab for the munin master"
+ einfo "installation from /usr/share/${PN}/f?crontab"
+ einfo "If you have a large site, you may wish to customize it."
+ read
+
+ ebegin "Setting up cron ..."
+ if has_version sys-process/fcron; then
+ fcrontab - -u munin < /usr/share/${PN}/fcrontab
+ else
+ # dcron is very fussy about syntax
+ # the following is the only form that works in BOTH dcron and vixie-cron
+ crontab - -u munin < /usr/share/${PN}/crontab
+ fi
+ eend $?
+
+ einfo "Press enter to set up the SSH keys used for SSH transport"
+ read
+
+ # generate one rsa (for legacy) and one ecdsa (for new systems)
+ ssh-keygen -t rsa -f /var/lib/munin/.ssh/id_rsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
+ ssh-keygen -t ecdsa -f /var/lib/munin/.ssh/id_ecdsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
+ chown -R munin:munin /var/lib/munin/.ssh || die
+ chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die
+
+ einfo "Your public keys are available in "
+ einfo " /var/lib/munin/.ssh/id_rsa.pub"
+ einfo " /var/lib/munin/.ssh/id_ecdsa.pub"
+ einfo "and follows for convenience"
+ echo
+ cat /var/lib/munin/.ssh/id_*.pub
+}
+
+pkg_postinst() {
+ elog "Please follow the munin documentation to set up the plugins you"
+ elog "need, afterwards start munin-node via /etc/init.d/munin-node."
+ elog ""
+ elog "To make use of munin-async, make sure to set up the corresponding"
+ elog "SSH key in /var/lib/munin-async/.ssh/authorized_keys"
+ elog ""
+ if ! use minimal; then
+ elog "Please run"
+ elog " emerge --config net-analyzer/munin"
+ elog "to automatically configure munin's cronjobs as well as generate"
+ elog "passwordless SSH keys to be used with munin-async."
+ fi
+ elog ""
+ elog "Further information about setting up Munin in Gentoo can be found"
+ elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin"
+
+ if use cgi; then
+ chown $(usex apache apache munin) \
+ "${ROOT}"/var/cache/munin-cgi \
+ "${ROOT}"/var/log/munin-cgi-{graph,html}.log
+
+ if use apache; then
+ elog "To use Munin with CGI you should include /etc/apache2/vhosts.d/munin.include"
+ elog "or /etc/apache2/vhosts.d/munin-2.4.include (for Apache 2.4) from the virtual"
+ elog "host you want it to be served."
+ elog "If you want to enable CGI-based HTML as well, you have to add to"
+ elog "/etc/conf.d/apache2 the option -D MUNIN_HTML_CGI."
+ else
+ elog "Effective CGI support has just been added in 2.0.7-r6."
+ elog "Documentation on how to use it is still sparse."
+ fi
+ fi
+
+ # we create this here as we don't want Portage to check /run
+ # symlinks but we still need this to be present before the reboot.
+ if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then
+ mkdir "${ROOT}"/run/munin
+ chown munin:munin "${ROOT}"/run/munin
+ chmod 0700 "${ROOT}"/run/munin
+ fi
+}