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