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, 29 Oct 2017 07:06:29
Message-Id: 1509260780.7ff2503aa9204d04d65cac9a7f76004b98cbddf2.graaff@gentoo
1 commit: 7ff2503aa9204d04d65cac9a7f76004b98cbddf2
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 29 06:59:35 2017 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 29 07:06:20 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ff2503a
7
8 net-analyzer/munin: add 2.0.34
9
10 Consolidate patches into patchset
11 Avoid test that is broken on Linux, bug 630472
12
13 Package-Manager: Portage-2.3.8, Repoman-2.3.3
14
15 net-analyzer/munin/Manifest | 2 +
16 net-analyzer/munin/munin-2.0.34.ebuild | 413 +++++++++++++++++++++++++++++++++
17 2 files changed, 415 insertions(+)
18
19 diff --git a/net-analyzer/munin/Manifest b/net-analyzer/munin/Manifest
20 index 4e0cb52a426..e6920312b14 100644
21 --- a/net-analyzer/munin/Manifest
22 +++ b/net-analyzer/munin/Manifest
23 @@ -1,3 +1,5 @@
24 DIST munin-2.0.33-gentoo-1.tar.xz 11024 SHA256 f956d9051e0da05231bb8777c0ca3342ca5bb86e48c44a68289c41c42c440e46 SHA512 c1f49f01fd641e157145d9710a091696c09380887a374ee845e516d40384ee6bc576019f3510ac322436b1f10ee1b675ae512b9f677a6a0fa2ef022cbb7269b8 WHIRLPOOL 3c0fbccc4c8ee9a2dacf8ce1845d149198c8d53ed17cd62fd17bae60986ca6616e12213d4f520fd06e8329accec559a7f9529559f21dc62de3aa0b66680d7ab7
25 DIST munin-2.0.33-gentoo-2.tar.xz 11288 SHA256 a7cc6b060cc1344c9b40278a960ab8fa6848e5db53f8665a952fb602ab0c0c55 SHA512 4d185529199377e85fb3e7d0a8c38de2ae500d2f992292e6ae016d11e81642833725987ac006b5f535963593c7698c676d28091805691e8b46c016fc2580917d WHIRLPOOL 98d2916c10adf554ab1672c602271673cb6dea7ae72fb7849b1bdf16d6f63c6f330def1f4a3cb62fd1fab4e888b2dede2807cde9a7907058f37a0f87a8b67a6b
26 DIST munin-2.0.33.tar.gz 1349546 SHA256 99dbc1e5f4f0fed4e28f295245333544193f9a26c597f2a78571ae20b4d450b6 SHA512 33c56fcb347396f29662f304aa50f0e3dfc909b067ea49809762bbbb4dd2cd7e95789c318adcef64923e6d0248dcf9ea6fe933c49d920b6b7856d85511d40d67 WHIRLPOOL 2429b605d19bbf4caa460e9f2b46de8e2462bf606bd1143bcdcbb4f2e079b2acf5f87def86affa6152ed8b26cf14bc83d62274bb58424818deb2b5f2024de7f0
27 +DIST munin-2.0.34-gentoo-1.tar.xz 11920 SHA256 c9c2a7c1e8022092fd661896b9196662b82facab965a70308cb6a273e9bcd40b SHA512 706f8dd1ba49eadb5e89f821f52d4c691b0270885a4167639b6417f9516bb2b0b8b212a82f50fb892e03b57817d650b3552754ecb437718c7e7ef3cdfaf83b2b WHIRLPOOL e82d38d47baf77ea3ad4cab06a6f84d213fe3cf4d1df9911750769409a2ee93366dd6b25e885af01484c708bf658aec8605aff18793e5ee2e8b72b51ea6fe40c
28 +DIST munin-2.0.34.tar.gz 1349842 SHA256 5152f006900ce5619b5c8d32441c24566f565e3f83e74379b287bef2fae58f6f SHA512 db802266842e103017c8c3bc0fc676d0d6146a37b06e69e709cfb396d67c42ac4932b8d4979e4d1a108fc0c2467c66423799212f6ea1279fb9ed64352ddf41cc WHIRLPOOL a7e491124b882f46fc56f3e2b264380d056f3cabe41f1f5bf8afe47c3e88332b9ad0ef305dfc1f5dfc4ba194d9d58472b5512b01b929a1ccacc1e88092ff8d40
29
30 diff --git a/net-analyzer/munin/munin-2.0.34.ebuild b/net-analyzer/munin/munin-2.0.34.ebuild
31 new file mode 100644
32 index 00000000000..e1f2ead7110
33 --- /dev/null
34 +++ b/net-analyzer/munin/munin-2.0.34.ebuild
35 @@ -0,0 +1,413 @@
36 +# Copyright 1999-2017 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +PATCHSET=1
42 +
43 +inherit eutils user java-pkg-opt-2 systemd
44 +
45 +MY_P=${P/_/-}
46 +
47 +DESCRIPTION="Munin Server Monitoring Tool"
48 +HOMEPAGE="http://munin-monitoring.org/"
49 +SRC_URI="
50 + https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz
51 + https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz"
52 +
53 +LICENSE="GPL-2"
54 +SLOT="0"
55 +KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
56 +IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2"
57 +REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )"
58 +
59 +# Upstream's listing of required modules is NOT correct!
60 +# Some of the postgres plugins use DBD::Pg, while others call psql directly.
61 +# Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
62 +# We replace the original ipmi plugins with the freeipmi_ plugin which at least works.
63 +DEPEND_COM="
64 + dev-lang/perl:=[berkdb]
65 + dev-perl/DBI
66 + dev-perl/Date-Manip
67 + dev-perl/File-Copy-Recursive
68 + dev-perl/List-MoreUtils
69 + dev-perl/Log-Log4perl
70 + dev-perl/Net-CIDR
71 + dev-perl/Net-DNS
72 + dev-perl/Net-Netmask
73 + dev-perl/Net-SNMP
74 + dev-perl/Net-Server[ipv6(-)?]
75 + virtual/perl-Digest-MD5
76 + virtual/perl-Getopt-Long
77 + virtual/perl-MIME-Base64
78 + virtual/perl-Storable
79 + virtual/perl-Text-Balanced
80 + virtual/perl-Time-HiRes
81 + apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] )
82 + asterisk? ( dev-perl/Net-Telnet )
83 + cgi? (
84 + dev-perl/FCGI
85 + dev-perl/CGI-Fast
86 + )
87 + dhcpd? (
88 + >=net-misc/dhcp-3[server]
89 + dev-perl/Net-IP
90 + dev-perl/HTTP-Date
91 + )
92 + doc? ( dev-python/sphinx )
93 + http? ( dev-perl/libwww-perl )
94 + irc? ( dev-perl/Net-IRC )
95 + ldap? ( dev-perl/perl-ldap )
96 + kernel_linux? ( sys-process/procps )
97 + memcached? ( dev-perl/Cache-Memcached )
98 + mysql? (
99 + virtual/mysql
100 + dev-perl/Cache-Cache
101 + dev-perl/DBD-mysql
102 + )
103 + postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* )
104 + ssl? ( dev-perl/Net-SSLeay )
105 + syslog? ( virtual/perl-Sys-Syslog )
106 + !minimal? (
107 + dev-perl/HTML-Template
108 + dev-perl/IO-Socket-INET6
109 + dev-perl/URI
110 + >=net-analyzer/rrdtool-1.3[graph,perl]
111 + virtual/ssh
112 + )
113 + "
114 +
115 +# Keep this seperate, as previous versions have had other deps here
116 +DEPEND="${DEPEND_COM}
117 + dev-perl/Module-Build
118 + java? ( >=virtual/jdk-1.5 )
119 + test? (
120 + dev-perl/Test-Deep
121 + dev-perl/Test-LongString
122 + dev-perl/Test-Differences
123 + dev-perl/Test-MockModule
124 + dev-perl/Test-MockObject
125 + dev-perl/File-Slurp
126 + dev-perl/IO-stringy
127 + dev-perl/IO-Socket-INET6
128 + )"
129 +RDEPEND="${DEPEND_COM}
130 + virtual/awk
131 + ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 )
132 + java? (
133 + >=virtual/jre-1.5
134 + || ( net-analyzer/netcat6 net-analyzer/netcat )
135 + )
136 + !minimal? (
137 + virtual/cron
138 + media-fonts/dejavu
139 + )
140 + selinux? ( sec-policy/selinux-munin )
141 + !<sys-apps/openrc-0.11.8"
142 +
143 +S="${WORKDIR}/${MY_P}"
144 +
145 +pkg_setup() {
146 + enewgroup munin
147 + enewuser munin 177 -1 /var/lib/munin munin
148 + enewuser munin-async -1 /bin/sh /var/spool/munin-async
149 + esethome munin-async /var/spool/munin-async
150 + java-pkg-opt-2_pkg_setup
151 +}
152 +
153 +src_prepare() {
154 + epatch "${WORKDIR}"/patches/*.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 +}