Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/munin/
Date: Sun, 03 Jun 2018 06:37:59
Message-Id: 1528007867.f97358003b9389642c883d2f42a7588495bc224a.graaff@gentoo
1 commit: f97358003b9389642c883d2f42a7588495bc224a
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 3 06:11:34 2018 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 3 06:37:47 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9735800
7
8 net-analyzer/munin: cleanup
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 net-analyzer/munin/Manifest | 3 -
13 net-analyzer/munin/munin-2.0.33-r1.ebuild | 415 ------------------------------
14 net-analyzer/munin/munin-2.0.33.ebuild | 412 -----------------------------
15 3 files changed, 830 deletions(-)
16
17 diff --git a/net-analyzer/munin/Manifest b/net-analyzer/munin/Manifest
18 index 855718a1d65..2a3d5ca2521 100644
19 --- a/net-analyzer/munin/Manifest
20 +++ b/net-analyzer/munin/Manifest
21 @@ -1,5 +1,2 @@
22 -DIST munin-2.0.33-gentoo-1.tar.xz 11024 BLAKE2B 60170b0e25143f56c6663394ae08b7323c4371111c7faf35b9fdfe0849860ecfdb1fbd50c0400e950d3330c5d0b3a309ab09c1f5724805c759a2e6078efd2dfe SHA512 c1f49f01fd641e157145d9710a091696c09380887a374ee845e516d40384ee6bc576019f3510ac322436b1f10ee1b675ae512b9f677a6a0fa2ef022cbb7269b8
23 -DIST munin-2.0.33-gentoo-2.tar.xz 11288 BLAKE2B 3e39e7ad1f7ed39f8ba1f5eef4183f94dc6010f31c05ee3e1c60e44450f932f677d0d2ecac40c1255959afb0069b9332f82397c7be3225acb3f1400cd720eb3f SHA512 4d185529199377e85fb3e7d0a8c38de2ae500d2f992292e6ae016d11e81642833725987ac006b5f535963593c7698c676d28091805691e8b46c016fc2580917d
24 -DIST munin-2.0.33.tar.gz 1349546 BLAKE2B e2604c1ea492df6d6bc801bab664483b63186010c0a5cb021c355ad5bffb6ccac738d8462351e795704f7305ac752c8efa342d6ad20a43d7db96729c1d05fb5d SHA512 33c56fcb347396f29662f304aa50f0e3dfc909b067ea49809762bbbb4dd2cd7e95789c318adcef64923e6d0248dcf9ea6fe933c49d920b6b7856d85511d40d67
25 DIST munin-2.0.34-gentoo-1.tar.xz 11920 BLAKE2B 19cb949b8712ad57544b424de0cb09f9eb33d4c8fe5f680bd3655efb5f0adce53ba4a839258e0324bf734f7367819abc8c6a4b859a48b36b015ea80c0b1f4a29 SHA512 706f8dd1ba49eadb5e89f821f52d4c691b0270885a4167639b6417f9516bb2b0b8b212a82f50fb892e03b57817d650b3552754ecb437718c7e7ef3cdfaf83b2b
26 DIST munin-2.0.34.tar.gz 1349842 BLAKE2B 641a780cd42d07c1a4f370dbf3a2647c99d3d69b5226a50f198ef561ff36e362fe397a55102ce57ef70a4a730ed14e02cb3a4f3043cac1874f36670535e0968e SHA512 db802266842e103017c8c3bc0fc676d0d6146a37b06e69e709cfb396d67c42ac4932b8d4979e4d1a108fc0c2467c66423799212f6ea1279fb9ed64352ddf41cc
27
28 diff --git a/net-analyzer/munin/munin-2.0.33-r1.ebuild b/net-analyzer/munin/munin-2.0.33-r1.ebuild
29 deleted file mode 100644
30 index e8bec20e108..00000000000
31 --- a/net-analyzer/munin/munin-2.0.33-r1.ebuild
32 +++ /dev/null
33 @@ -1,415 +0,0 @@
34 -# Copyright 1999-2017 Gentoo Foundation
35 -# Distributed under the terms of the GNU General Public License v2
36 -
37 -EAPI=6
38 -
39 -PATCHSET=2
40 -
41 -inherit eutils user java-pkg-opt-2 systemd
42 -
43 -MY_P=${P/_/-}
44 -
45 -DESCRIPTION="Munin Server Monitoring Tool"
46 -HOMEPAGE="http://munin-monitoring.org/"
47 -SRC_URI="
48 - https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz
49 - https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz"
50 -
51 -LICENSE="GPL-2"
52 -SLOT="0"
53 -KEYWORDS="~amd64 ~arm ~ppc ~x86"
54 -IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2"
55 -REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )"
56 -
57 -# Upstream's listing of required modules is NOT correct!
58 -# Some of the postgres plugins use DBD::Pg, while others call psql directly.
59 -# Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
60 -# We replace the original ipmi plugins with the freeipmi_ plugin which at least works.
61 -DEPEND_COM="
62 - dev-lang/perl:=[berkdb]
63 - dev-perl/DBI
64 - dev-perl/Date-Manip
65 - dev-perl/File-Copy-Recursive
66 - dev-perl/List-MoreUtils
67 - dev-perl/Log-Log4perl
68 - dev-perl/Net-CIDR
69 - dev-perl/Net-DNS
70 - dev-perl/Net-Netmask
71 - dev-perl/Net-SNMP
72 - dev-perl/Net-Server[ipv6(-)?]
73 - virtual/perl-Digest-MD5
74 - virtual/perl-Getopt-Long
75 - virtual/perl-MIME-Base64
76 - virtual/perl-Storable
77 - virtual/perl-Text-Balanced
78 - virtual/perl-Time-HiRes
79 - apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] )
80 - asterisk? ( dev-perl/Net-Telnet )
81 - cgi? (
82 - dev-perl/FCGI
83 - dev-perl/CGI-Fast
84 - )
85 - dhcpd? (
86 - >=net-misc/dhcp-3[server]
87 - dev-perl/Net-IP
88 - dev-perl/HTTP-Date
89 - )
90 - doc? ( dev-python/sphinx )
91 - http? ( dev-perl/libwww-perl )
92 - irc? ( dev-perl/Net-IRC )
93 - ldap? ( dev-perl/perl-ldap )
94 - kernel_linux? ( sys-process/procps )
95 - memcached? ( dev-perl/Cache-Memcached )
96 - mysql? (
97 - virtual/mysql
98 - dev-perl/Cache-Cache
99 - dev-perl/DBD-mysql
100 - )
101 - postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* )
102 - ssl? ( dev-perl/Net-SSLeay )
103 - syslog? ( virtual/perl-Sys-Syslog )
104 - !minimal? (
105 - dev-perl/HTML-Template
106 - dev-perl/IO-Socket-INET6
107 - dev-perl/URI
108 - >=net-analyzer/rrdtool-1.3[graph,perl]
109 - virtual/ssh
110 - )
111 - "
112 -
113 -# Keep this seperate, as previous versions have had other deps here
114 -DEPEND="${DEPEND_COM}
115 - dev-perl/Module-Build
116 - java? ( >=virtual/jdk-1.5 )
117 - test? (
118 - dev-perl/Test-Deep
119 - dev-perl/Test-LongString
120 - dev-perl/Test-Differences
121 - dev-perl/Test-MockModule
122 - dev-perl/Test-MockObject
123 - dev-perl/File-Slurp
124 - dev-perl/IO-stringy
125 - dev-perl/IO-Socket-INET6
126 - )"
127 -RDEPEND="${DEPEND_COM}
128 - virtual/awk
129 - ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 )
130 - java? (
131 - >=virtual/jre-1.5
132 - || ( net-analyzer/netcat6 net-analyzer/netcat )
133 - )
134 - !minimal? (
135 - virtual/cron
136 - media-fonts/dejavu
137 - )
138 - selinux? ( sec-policy/selinux-munin )
139 - !<sys-apps/openrc-0.11.8"
140 -
141 -S="${WORKDIR}/${MY_P}"
142 -
143 -pkg_setup() {
144 - enewgroup munin
145 - enewuser munin 177 -1 /var/lib/munin munin
146 - enewuser munin-async -1 /bin/sh /var/spool/munin-async
147 - esethome munin-async /var/spool/munin-async
148 - java-pkg-opt-2_pkg_setup
149 -}
150 -
151 -src_prepare() {
152 - epatch "${WORKDIR}"/patches/*.patch
153 - eapply "${FILESDIR}/${P}"-perl526.patch
154 - eapply "${FILESDIR}/${P}"-nogitversion.patch
155 -
156 - eapply_user
157 -
158 - java-pkg-opt-2_src_prepare
159 -}
160 -
161 -src_configure() {
162 - local cgidir='$(DESTDIR)/usr/libexec/munin/cgi'
163 - use cgi || cgidir="${T}/useless/cgi-bin"
164 -
165 - local cgiuser=$(usex apache2 apache munin)
166 -
167 - cat >> "${S}"/Makefile.config <<- EOF
168 - PREFIX=\$(DESTDIR)/usr
169 - CONFDIR=\$(DESTDIR)/etc/munin
170 - DOCDIR=${T}/useless/doc
171 - MANDIR=\$(PREFIX)/share/man
172 - LIBDIR=\$(PREFIX)/libexec/munin
173 - HTMLDIR=\$(DESTDIR)/var/www/localhost/htdocs/munin
174 - CGIDIR=${cgidir}
175 - CGITMPDIR=\$(DESTDIR)/var/cache/munin-cgi
176 - CGIUSER=${cgiuser}
177 - DBDIR=\$(DESTDIR)/var/lib/munin
178 - DBDIRNODE=\$(DESTDIR)/var/lib/munin-node
179 - SPOOLDIR=\$(DESTDIR)/var/spool/munin-async
180 - LOGDIR=\$(DESTDIR)/var/log/munin
181 - PERLSITELIB=$(perl -V:vendorlib | cut -d"'" -f2)
182 - JCVALID=$(usex java yes no)
183 - STATEDIR=\$(DESTDIR)/run/munin
184 - EOF
185 -}
186 -
187 -# parallel make and install need to be fixed before, and I haven't
188 -# gotten around to do so yet.
189 -src_compile() {
190 - emake -j1
191 - use doc && emake -C doc html
192 -}
193 -
194 -src_test() {
195 - if [[ ${EUID} == 0 ]]; then
196 - eerror "You cannot run tests as root."
197 - eerror "Please enable FEATURES=userpriv before proceeding."
198 - return 1
199 - fi
200 -
201 - local testtargets="test-common test-node test-plugins"
202 - use minimal || testtargets+=" test-master"
203 -
204 - LC_ALL=C emake -j1 ${testtargets}
205 -}
206 -
207 -src_install() {
208 - local dirs="
209 - /var/log/munin
210 - /var/lib/munin/plugin-state
211 - /etc/munin/plugin-conf.d
212 - /etc/munin/plugins"
213 - use minimal || dirs+=" /etc/munin/munin-conf.d/"
214 -
215 - keepdir ${dirs}
216 - fowners munin:munin ${dirs}
217 -
218 - # parallel install doesn't work and it's also pointless to have this
219 - # run in parallel for now (because it uses internal loops).
220 - emake -j1 DESTDIR="${D}" $(usex minimal "install-minimal install-man" install)
221 -
222 - # we remove /run from the install, as it's not the package's to deal
223 - # with.
224 - rm -rf "${D}"/run || die
225 -
226 - # remove the plugins for non-Gentoo package managers; use -f so that
227 - # it doesn't fail when installing on non-Linux platforms.
228 - rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die
229 -
230 - insinto /etc/munin/plugin-conf.d/
231 - newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node
232 -
233 - newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node
234 - newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
235 -
236 - newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd
237 -
238 - dodir /usr/lib/tmpfiles.d
239 - cat > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<- EOF
240 - d /run/munin 0700 munin munin - -
241 - EOF
242 -
243 - systemd_dounit "${FILESDIR}"/munin-async.service
244 - systemd_dounit "${FILESDIR}"/munin-graph.{service,socket}
245 - systemd_dounit "${FILESDIR}"/munin-html.{service,socket}
246 - systemd_dounit "${FILESDIR}"/munin-node.service
247 -
248 - cat >> "${T}"/munin.env <<- EOF
249 - CONFIG_PROTECT=/var/spool/munin-async/.ssh
250 - EOF
251 - newenvd "${T}"/munin.env 50munin
252 -
253 - dodoc README ChangeLog INSTALL
254 - if use doc; then
255 - cd "${S}"/doc/_build/html || die
256 - docinto html
257 - dodoc -r *
258 - cd "${S}" || die
259 - fi
260 -
261 - dodir /etc/logrotate.d/
262 - sed -e "s:@CGIUSER@:$(usex apache2 apache munin):g" \
263 - "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin
264 -
265 - dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_
266 -
267 - if use syslog; then
268 - sed -i -e '/log_file/s| .*| Sys::Syslog|' \
269 - "${D}"/etc/munin/munin-node.conf || die
270 - fi
271 -
272 - # Use a simpler pid file to avoid trouble with /run in tmpfs. The
273 - # munin-node service is ran as user root, and only later drops
274 - # privileges.
275 - sed -i -e 's:/run/munin/munin-node.pid:/run/munin-node.pid:' \
276 - "${D}"/etc/munin/munin-node.conf || die
277 -
278 - keepdir /var/spool/munin-async/.ssh
279 - touch "${D}"/var/spool/munin-async/.ssh/authorized_keys
280 - fowners munin-async:munin /var/spool/munin-async{,/.ssh/{,authorized_keys}}
281 - fperms 0750 /var/spool/munin-async{,/.ssh}
282 - fperms 0600 /var/spool/munin-async/.ssh/authorized_keys
283 -
284 - if use minimal; then
285 - # This requires the presence of munin-update, which is part of
286 - # the non-minimal install...
287 - rm "${D}"/usr/libexec/munin/plugins/munin_stats
288 - else
289 - # remove font files so that we don't have to keep them around
290 - rm "${D}"/usr/libexec/${PN}/*.ttf || die
291 -
292 - if use cgi; then
293 - sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die
294 -
295 - keepdir /var/cache/munin-cgi
296 - touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log
297 - fowners $(usex apache2 apache munin) \
298 - /var/cache/munin-cgi \
299 - /var/log/munin/munin-cgi-{graph,html}.log
300 -
301 - if use apache2; then
302 - insinto /etc/apache2/vhosts.d
303 - newins "${FILESDIR}"/munin.apache.include munin.include
304 - newins "${FILESDIR}"/munin.apache.include-2.4 munin-2.4.include
305 - fi
306 - else
307 - sed \
308 - -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \
309 - -i "${D}"/etc/munin/munin.conf || die
310 - fi
311 -
312 - keepdir /var/lib/munin/.ssh
313 - cat >> "${D}"/var/lib/munin/.ssh/config <<- EOF
314 - IdentityFile /var/lib/munin/.ssh/id_ecdsa
315 - IdentityFile /var/lib/munin/.ssh/id_rsa
316 - EOF
317 -
318 - fowners munin:munin /var/lib/munin/.ssh/{,config}
319 - fperms go-rwx /var/lib/munin/.ssh/{,config}
320 -
321 - dodir /usr/share/${PN}
322 - cat >> "${D}"/usr/share/${PN}/crontab <<- EOF
323 - # Force the shell to bash
324 - SHELL=/bin/bash
325 - # Mail reports to root@, not munin@
326 - MAILTO=root
327 -
328 - # This runs the munin task every 5 minutes.
329 - */5 * * * * /usr/bin/munin-cron
330 -
331 - # Alternatively, this route works differently
332 - # Update once a minute (for busy sites)
333 - #*/1 * * * * /usr/libexec/munin/munin-update
334 - ## Check for limit excess every 2 minutes
335 - #*/2 * * * * /usr/libexec/munin/munin-limits
336 - ## Update graphs every 5 minutes
337 - #*/5 * * * * nice /usr/libexec/munin/munin-graph
338 - ## Update HTML pages every 15 minutes
339 - #*/15 * * * * nice /usr/libexec/munin/munin-html
340 - EOF
341 -
342 - cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF
343 - # Mail reports to root@, not munin@, only execute one at a time
344 - !mailto(root),serial(true)
345 -
346 - # This runs the munin task every 5 minutes.
347 - @ 5 /usr/bin/munin-cron
348 -
349 - # Alternatively, this route works differently
350 - # Update once a minute (for busy sites)
351 - #@ 1 /usr/libexec/munin/munin-update
352 - ## Check for limit excess every 2 minutes
353 - #@ 2 /usr/libexec/munin/munin-limits
354 - ## Update graphs every 5 minutes
355 - #@ 5 nice /usr/libexec/munin/munin-graph
356 - ## Update HTML pages every 15 minutes
357 - #@ 15 nice /usr/libexec/munin/munin-html
358 - EOF
359 -
360 - # remove .htaccess file
361 - find "${D}" -name .htaccess -delete || die
362 - fi
363 -}
364 -
365 -pkg_config() {
366 - if use minimal; then
367 - einfo "Nothing to do."
368 - return 0
369 - fi
370 -
371 - einfo "Press enter to install the default crontab for the munin master"
372 - einfo "installation from /usr/share/${PN}/f?crontab"
373 - einfo "If you have a large site, you may wish to customize it."
374 - read
375 -
376 - ebegin "Setting up cron ..."
377 - if has_version sys-process/fcron; then
378 - fcrontab - -u munin < /usr/share/${PN}/fcrontab
379 - else
380 - # dcron is very fussy about syntax
381 - # the following is the only form that works in BOTH dcron and vixie-cron
382 - crontab - -u munin < /usr/share/${PN}/crontab
383 - fi
384 - eend $?
385 -
386 - einfo "Press enter to set up the SSH keys used for SSH transport"
387 - read
388 -
389 - # generate one rsa (for legacy) and one ecdsa (for new systems)
390 - ssh-keygen -t rsa \
391 - -f /var/lib/munin/.ssh/id_rsa -N '' \
392 - -C "created by portage for ${CATEGORY}/${PN}" || die
393 - ssh-keygen -t ecdsa \
394 - -f /var/lib/munin/.ssh/id_ecdsa -N '' \
395 - -C "created by portage for ${CATEGORY}/${PN}" || die
396 - chown -R munin:munin /var/lib/munin/.ssh || die
397 - chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die
398 -
399 - einfo "Your public keys are available in "
400 - einfo " /var/lib/munin/.ssh/id_rsa.pub"
401 - einfo " /var/lib/munin/.ssh/id_ecdsa.pub"
402 - einfo "and follows for convenience"
403 - echo
404 - cat /var/lib/munin/.ssh/id_*.pub
405 -}
406 -
407 -pkg_postinst() {
408 - elog "Please follow the munin documentation to set up the plugins you"
409 - elog "need, afterwards start munin-node."
410 - elog ""
411 - elog "To make use of munin-async, make sure to set up the corresponding"
412 - elog "SSH key in /var/lib/munin-async/.ssh/authorized_keys"
413 - elog ""
414 - if ! use minimal; then
415 - elog "Please run"
416 - elog " emerge --config net-analyzer/munin"
417 - elog "to automatically configure munin's cronjobs as well as generate"
418 - elog "passwordless SSH keys to be used with munin-async."
419 - fi
420 - elog ""
421 - elog "Further information about setting up Munin in Gentoo can be found"
422 - elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin"
423 -
424 - if use cgi; then
425 - chown $(usex apache2 apache munin) \
426 - "${ROOT}"/var/cache/munin-cgi \
427 - "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log
428 -
429 - if use apache2; then
430 - elog "To use Munin with CGI you should include /etc/apache2/vhosts.d/munin.include"
431 - elog "or /etc/apache2/vhosts.d/munin-2.4.include (for Apache 2.4) from the virtual"
432 - elog "host you want it to be served."
433 - elog "If you want to enable CGI-based HTML as well, you have to add to"
434 - elog "/etc/conf.d/apache2 the option -D MUNIN_HTML_CGI."
435 - else
436 - elog "Effective CGI support has just been added in 2.0.7-r6."
437 - elog "Documentation on how to use it is still sparse."
438 - fi
439 - fi
440 -
441 - # we create this here as we don't want Portage to check /run
442 - # symlinks but we still need this to be present before the reboot.
443 - if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then
444 - mkdir "${ROOT}"/run/munin
445 - chown munin:munin "${ROOT}"/run/munin
446 - chmod 0700 "${ROOT}"/run/munin
447 - fi
448 -}
449
450 diff --git a/net-analyzer/munin/munin-2.0.33.ebuild b/net-analyzer/munin/munin-2.0.33.ebuild
451 deleted file mode 100644
452 index 71e21e8175b..00000000000
453 --- a/net-analyzer/munin/munin-2.0.33.ebuild
454 +++ /dev/null
455 @@ -1,412 +0,0 @@
456 -# Copyright 1999-2017 Gentoo Foundation
457 -# Distributed under the terms of the GNU General Public License v2
458 -
459 -EAPI=6
460 -
461 -PATCHSET=1
462 -
463 -inherit eutils user java-pkg-opt-2 systemd
464 -
465 -MY_P=${P/_/-}
466 -
467 -DESCRIPTION="Munin Server Monitoring Tool"
468 -HOMEPAGE="http://munin-monitoring.org/"
469 -SRC_URI="
470 - https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz
471 - https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz"
472 -
473 -LICENSE="GPL-2"
474 -SLOT="0"
475 -KEYWORDS="amd64 ~arm ppc x86"
476 -IUSE="asterisk irc java memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache"
477 -REQUIRED_USE="cgi? ( !minimal ) apache? ( cgi )"
478 -
479 -# Upstream's listing of required modules is NOT correct!
480 -# Some of the postgres plugins use DBD::Pg, while others call psql directly.
481 -# Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
482 -# We replace the original ipmi plugins with the freeipmi_ plugin which at least works.
483 -DEPEND_COM="
484 - dev-lang/perl:=[berkdb]
485 - dev-perl/DBI
486 - dev-perl/Date-Manip
487 - dev-perl/File-Copy-Recursive
488 - dev-perl/List-MoreUtils
489 - dev-perl/Log-Log4perl
490 - dev-perl/Net-CIDR
491 - dev-perl/Net-DNS
492 - dev-perl/Net-Netmask
493 - dev-perl/Net-SNMP
494 - dev-perl/Net-Server[ipv6(-)?]
495 - virtual/perl-Digest-MD5
496 - virtual/perl-Getopt-Long
497 - virtual/perl-MIME-Base64
498 - virtual/perl-Storable
499 - virtual/perl-Text-Balanced
500 - virtual/perl-Time-HiRes
501 - apache? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] )
502 - asterisk? ( dev-perl/Net-Telnet )
503 - cgi? (
504 - dev-perl/FCGI
505 - dev-perl/CGI-Fast
506 - )
507 - dhcpd? (
508 - >=net-misc/dhcp-3[server]
509 - dev-perl/Net-IP
510 - dev-perl/HTTP-Date
511 - )
512 - doc? ( dev-python/sphinx )
513 - http? ( dev-perl/libwww-perl )
514 - irc? ( dev-perl/Net-IRC )
515 - kernel_linux? ( sys-process/procps )
516 - memcached? ( dev-perl/Cache-Memcached )
517 - mysql? (
518 - virtual/mysql
519 - dev-perl/Cache-Cache
520 - dev-perl/DBD-mysql
521 - )
522 - postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* )
523 - ssl? ( dev-perl/Net-SSLeay )
524 - syslog? ( virtual/perl-Sys-Syslog )
525 - !minimal? (
526 - dev-perl/HTML-Template
527 - dev-perl/IO-Socket-INET6
528 - dev-perl/URI
529 - >=net-analyzer/rrdtool-1.3[graph,perl]
530 - virtual/ssh
531 - )
532 - "
533 -
534 -# Keep this seperate, as previous versions have had other deps here
535 -DEPEND="${DEPEND_COM}
536 - dev-perl/Module-Build
537 - java? ( >=virtual/jdk-1.5 )
538 - test? (
539 - dev-perl/Test-Deep
540 - dev-perl/Test-LongString
541 - dev-perl/Test-Differences
542 - dev-perl/Test-MockModule
543 - dev-perl/Test-MockObject
544 - dev-perl/File-Slurp
545 - dev-perl/IO-stringy
546 - dev-perl/IO-Socket-INET6
547 - )"
548 -RDEPEND="${DEPEND_COM}
549 - virtual/awk
550 - ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 )
551 - java? (
552 - >=virtual/jre-1.5
553 - || ( net-analyzer/netcat6 net-analyzer/netcat )
554 - )
555 - !minimal? (
556 - virtual/cron
557 - media-fonts/dejavu
558 - )
559 - selinux? ( sec-policy/selinux-munin )
560 - !<sys-apps/openrc-0.11.8"
561 -
562 -S="${WORKDIR}/${MY_P}"
563 -
564 -pkg_setup() {
565 - enewgroup munin
566 - enewuser munin 177 -1 /var/lib/munin munin
567 - enewuser munin-async -1 /bin/sh /var/spool/munin-async
568 - esethome munin-async /var/spool/munin-async
569 - java-pkg-opt-2_pkg_setup
570 -}
571 -
572 -src_prepare() {
573 - epatch "${WORKDIR}"/patches/*.patch
574 -
575 - eapply_user
576 -
577 - java-pkg-opt-2_src_prepare
578 -}
579 -
580 -src_configure() {
581 - local cgidir='$(DESTDIR)/usr/libexec/munin/cgi'
582 - use cgi || cgidir="${T}/useless/cgi-bin"
583 -
584 - local cgiuser=$(usex apache apache munin)
585 -
586 - cat >> "${S}"/Makefile.config <<- EOF
587 - PREFIX=\$(DESTDIR)/usr
588 - CONFDIR=\$(DESTDIR)/etc/munin
589 - DOCDIR=${T}/useless/doc
590 - MANDIR=\$(PREFIX)/share/man
591 - LIBDIR=\$(PREFIX)/libexec/munin
592 - HTMLDIR=\$(DESTDIR)/var/www/localhost/htdocs/munin
593 - CGIDIR=${cgidir}
594 - CGITMPDIR=\$(DESTDIR)/var/cache/munin-cgi
595 - CGIUSER=${cgiuser}
596 - DBDIR=\$(DESTDIR)/var/lib/munin
597 - DBDIRNODE=\$(DESTDIR)/var/lib/munin-node
598 - SPOOLDIR=\$(DESTDIR)/var/spool/munin-async
599 - LOGDIR=\$(DESTDIR)/var/log/munin
600 - PERLSITELIB=$(perl -V:vendorlib | cut -d"'" -f2)
601 - JCVALID=$(usex java yes no)
602 - STATEDIR=\$(DESTDIR)/run/munin
603 - EOF
604 -}
605 -
606 -# parallel make and install need to be fixed before, and I haven't
607 -# gotten around to do so yet.
608 -src_compile() {
609 - emake -j1
610 - use doc && emake -C doc html
611 -}
612 -
613 -src_test() {
614 - if [[ ${EUID} == 0 ]]; then
615 - eerror "You cannot run tests as root."
616 - eerror "Please enable FEATURES=userpriv before proceeding."
617 - return 1
618 - fi
619 -
620 - local testtargets="test-common test-node test-plugins"
621 - use minimal || testtargets+=" test-master"
622 -
623 - LC_ALL=C emake -j1 ${testtargets}
624 -}
625 -
626 -src_install() {
627 - local dirs="
628 - /var/log/munin
629 - /var/lib/munin/plugin-state
630 - /etc/munin/plugin-conf.d
631 - /etc/munin/plugins"
632 - use minimal || dirs+=" /etc/munin/munin-conf.d/"
633 -
634 - keepdir ${dirs}
635 - fowners munin:munin ${dirs}
636 -
637 - # parallel install doesn't work and it's also pointless to have this
638 - # run in parallel for now (because it uses internal loops).
639 - emake -j1 DESTDIR="${D}" $(usex minimal "install-minimal install-man" install)
640 -
641 - # we remove /run from the install, as it's not the package's to deal
642 - # with.
643 - rm -rf "${D}"/run || die
644 -
645 - # remove the plugins for non-Gentoo package managers; use -f so that
646 - # it doesn't fail when installing on non-Linux platforms.
647 - rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die
648 -
649 - insinto /etc/munin/plugin-conf.d/
650 - newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node
651 -
652 - newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node
653 - newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
654 -
655 - newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd
656 -
657 - dodir /usr/lib/tmpfiles.d
658 - cat > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<- EOF
659 - d /run/munin 0700 munin munin - -
660 - EOF
661 -
662 - systemd_dounit "${FILESDIR}"/munin-async.service
663 - systemd_dounit "${FILESDIR}"/munin-graph.{service,socket}
664 - systemd_dounit "${FILESDIR}"/munin-html.{service,socket}
665 - systemd_dounit "${FILESDIR}"/munin-node.service
666 -
667 - cat >> "${T}"/munin.env <<- EOF
668 - CONFIG_PROTECT=/var/spool/munin-async/.ssh
669 - EOF
670 - newenvd "${T}"/munin.env 50munin
671 -
672 - dodoc README ChangeLog INSTALL
673 - if use doc; then
674 - cd "${S}"/doc/_build/html || die
675 - docinto html
676 - dodoc -r *
677 - cd "${S}" || die
678 - fi
679 -
680 - dodir /etc/logrotate.d/
681 - sed -e "s:@CGIUSER@:$(usex apache apache munin):g" \
682 - "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin
683 -
684 - dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_
685 -
686 - if use syslog; then
687 - sed -i -e '/log_file/s| .*| Sys::Syslog|' \
688 - "${D}"/etc/munin/munin-node.conf || die
689 - fi
690 -
691 - # Use a simpler pid file to avoid trouble with /run in tmpfs. The
692 - # munin-node service is ran as user root, and only later drops
693 - # privileges.
694 - sed -i -e 's:/run/munin/munin-node.pid:/run/munin-node.pid:' \
695 - "${D}"/etc/munin/munin-node.conf || die
696 -
697 - keepdir /var/spool/munin-async/.ssh
698 - touch "${D}"/var/spool/munin-async/.ssh/authorized_keys
699 - fowners munin-async:munin /var/spool/munin-async{,/.ssh/{,authorized_keys}}
700 - fperms 0750 /var/spool/munin-async{,/.ssh}
701 - fperms 0600 /var/spool/munin-async/.ssh/authorized_keys
702 -
703 - if use minimal; then
704 - # This requires the presence of munin-update, which is part of
705 - # the non-minimal install...
706 - rm "${D}"/usr/libexec/munin/plugins/munin_stats
707 - else
708 - # remove font files so that we don't have to keep them around
709 - rm "${D}"/usr/libexec/${PN}/*.ttf || die
710 -
711 - if use cgi; then
712 - sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die
713 -
714 - keepdir /var/cache/munin-cgi
715 - touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log
716 - fowners $(usex apache apache munin) \
717 - /var/cache/munin-cgi \
718 - /var/log/munin/munin-cgi-{graph,html}.log
719 -
720 - if use apache; then
721 - insinto /etc/apache2/vhosts.d
722 - newins "${FILESDIR}"/munin.apache.include munin.include
723 - newins "${FILESDIR}"/munin.apache.include-2.4 munin-2.4.include
724 - fi
725 - else
726 - sed \
727 - -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \
728 - -i "${D}"/etc/munin/munin.conf || die
729 - fi
730 -
731 - keepdir /var/lib/munin/.ssh
732 - cat >> "${D}"/var/lib/munin/.ssh/config <<- EOF
733 - IdentityFile /var/lib/munin/.ssh/id_ecdsa
734 - IdentityFile /var/lib/munin/.ssh/id_rsa
735 - EOF
736 -
737 - fowners munin:munin /var/lib/munin/.ssh/{,config}
738 - fperms go-rwx /var/lib/munin/.ssh/{,config}
739 -
740 - dodir /usr/share/${PN}
741 - cat >> "${D}"/usr/share/${PN}/crontab <<- EOF
742 - # Force the shell to bash
743 - SHELL=/bin/bash
744 - # Mail reports to root@, not munin@
745 - MAILTO=root
746 -
747 - # This runs the munin task every 5 minutes.
748 - */5 * * * * /usr/bin/munin-cron
749 -
750 - # Alternatively, this route works differently
751 - # Update once a minute (for busy sites)
752 - #*/1 * * * * /usr/libexec/munin/munin-update
753 - ## Check for limit excess every 2 minutes
754 - #*/2 * * * * /usr/libexec/munin/munin-limits
755 - ## Update graphs every 5 minutes
756 - #*/5 * * * * nice /usr/libexec/munin/munin-graph
757 - ## Update HTML pages every 15 minutes
758 - #*/15 * * * * nice /usr/libexec/munin/munin-html
759 - EOF
760 -
761 - cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF
762 - # Mail reports to root@, not munin@, only execute one at a time
763 - !mailto(root),serial(true)
764 -
765 - # This runs the munin task every 5 minutes.
766 - @ 5 /usr/bin/munin-cron
767 -
768 - # Alternatively, this route works differently
769 - # Update once a minute (for busy sites)
770 - #@ 1 /usr/libexec/munin/munin-update
771 - ## Check for limit excess every 2 minutes
772 - #@ 2 /usr/libexec/munin/munin-limits
773 - ## Update graphs every 5 minutes
774 - #@ 5 nice /usr/libexec/munin/munin-graph
775 - ## Update HTML pages every 15 minutes
776 - #@ 15 nice /usr/libexec/munin/munin-html
777 - EOF
778 -
779 - # remove .htaccess file
780 - find "${D}" -name .htaccess -delete || die
781 - fi
782 -}
783 -
784 -pkg_config() {
785 - if use minimal; then
786 - einfo "Nothing to do."
787 - return 0
788 - fi
789 -
790 - einfo "Press enter to install the default crontab for the munin master"
791 - einfo "installation from /usr/share/${PN}/f?crontab"
792 - einfo "If you have a large site, you may wish to customize it."
793 - read
794 -
795 - ebegin "Setting up cron ..."
796 - if has_version sys-process/fcron; then
797 - fcrontab - -u munin < /usr/share/${PN}/fcrontab
798 - else
799 - # dcron is very fussy about syntax
800 - # the following is the only form that works in BOTH dcron and vixie-cron
801 - crontab - -u munin < /usr/share/${PN}/crontab
802 - fi
803 - eend $?
804 -
805 - einfo "Press enter to set up the SSH keys used for SSH transport"
806 - read
807 -
808 - # generate one rsa (for legacy) and one ecdsa (for new systems)
809 - ssh-keygen -t rsa \
810 - -f /var/lib/munin/.ssh/id_rsa -N '' \
811 - -C "created by portage for ${CATEGORY}/${PN}" || die
812 - ssh-keygen -t ecdsa \
813 - -f /var/lib/munin/.ssh/id_ecdsa -N '' \
814 - -C "created by portage for ${CATEGORY}/${PN}" || die
815 - chown -R munin:munin /var/lib/munin/.ssh || die
816 - chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die
817 -
818 - einfo "Your public keys are available in "
819 - einfo " /var/lib/munin/.ssh/id_rsa.pub"
820 - einfo " /var/lib/munin/.ssh/id_ecdsa.pub"
821 - einfo "and follows for convenience"
822 - echo
823 - cat /var/lib/munin/.ssh/id_*.pub
824 -}
825 -
826 -pkg_postinst() {
827 - elog "Please follow the munin documentation to set up the plugins you"
828 - elog "need, afterwards start munin-node."
829 - elog ""
830 - elog "To make use of munin-async, make sure to set up the corresponding"
831 - elog "SSH key in /var/lib/munin-async/.ssh/authorized_keys"
832 - elog ""
833 - if ! use minimal; then
834 - elog "Please run"
835 - elog " emerge --config net-analyzer/munin"
836 - elog "to automatically configure munin's cronjobs as well as generate"
837 - elog "passwordless SSH keys to be used with munin-async."
838 - fi
839 - elog ""
840 - elog "Further information about setting up Munin in Gentoo can be found"
841 - elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin"
842 -
843 - if use cgi; then
844 - chown $(usex apache apache munin) \
845 - "${ROOT}"/var/cache/munin-cgi \
846 - "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log
847 -
848 - if use apache; then
849 - elog "To use Munin with CGI you should include /etc/apache2/vhosts.d/munin.include"
850 - elog "or /etc/apache2/vhosts.d/munin-2.4.include (for Apache 2.4) from the virtual"
851 - elog "host you want it to be served."
852 - elog "If you want to enable CGI-based HTML as well, you have to add to"
853 - elog "/etc/conf.d/apache2 the option -D MUNIN_HTML_CGI."
854 - else
855 - elog "Effective CGI support has just been added in 2.0.7-r6."
856 - elog "Documentation on how to use it is still sparse."
857 - fi
858 - fi
859 -
860 - # we create this here as we don't want Portage to check /run
861 - # symlinks but we still need this to be present before the reboot.
862 - if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then
863 - mkdir "${ROOT}"/run/munin
864 - chown munin:munin "${ROOT}"/run/munin
865 - chmod 0700 "${ROOT}"/run/munin
866 - fi
867 -}