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