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