Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/munin: munin-2.0.11.ebuild ChangeLog
Date: Fri, 01 Feb 2013 16:16:35
Message-Id: 20130201161630.519D32171D@flycatcher.gentoo.org
1 flameeyes 13/02/01 16:16:30
2
3 Modified: ChangeLog
4 Added: munin-2.0.11.ebuild
5 Log:
6 Version bump.
7
8 (Portage version: 2.2.0_alpha161/cvs/Linux x86_64, signed Manifest commit with key 1CD13C8AD4301342)
9
10 Revision Changes Path
11 1.134 net-analyzer/munin/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/ChangeLog?rev=1.134&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/ChangeLog?rev=1.134&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/ChangeLog?r1=1.133&r2=1.134
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v
20 retrieving revision 1.133
21 retrieving revision 1.134
22 diff -u -r1.133 -r1.134
23 --- ChangeLog 23 Jan 2013 19:22:41 -0000 1.133
24 +++ ChangeLog 1 Feb 2013 16:16:30 -0000 1.134
25 @@ -1,6 +1,11 @@
26 # ChangeLog for net-analyzer/munin
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.133 2013/01/23 19:22:41 flameeyes Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.134 2013/02/01 16:16:30 flameeyes Exp $
30 +
31 +*munin-2.0.11 (01 Feb 2013)
32 +
33 + 01 Feb 2013; Diego E. Pettenò <flameeyes@g.o> +munin-2.0.11.ebuild:
34 + Version bump.
35
36 *munin-2.0.10-r2 (23 Jan 2013)
37
38
39
40
41 1.1 net-analyzer/munin/munin-2.0.11.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/munin-2.0.11.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/munin-2.0.11.ebuild?rev=1.1&content-type=text/plain
45
46 Index: munin-2.0.11.ebuild
47 ===================================================================
48 # Copyright 1999-2013 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/munin-2.0.11.ebuild,v 1.1 2013/02/01 16:16:30 flameeyes Exp $
51
52 EAPI=5
53
54 PATCHSET=1
55
56 inherit eutils user java-pkg-opt-2
57
58 MY_P=${P/_/-}
59
60 DESCRIPTION="Munin Server Monitoring Tool"
61 HOMEPAGE="http://munin-monitoring.org/"
62 SRC_URI="mirror://sourceforge/munin/${MY_P}.tar.gz
63 http://dev.gentoo.org/~flameeyes/${PN}/${P}-gentoo-${PATCHSET}.tar.xz"
64
65 LICENSE="GPL-2"
66 SLOT="0"
67 KEYWORDS="~amd64 ~mips ~ppc ~x86"
68 IUSE="asterisk irc java memcached minimal mysql postgres ssl test cgi ipv6 syslog ipmi http dhcpd doc apache"
69 REQUIRED_USE="cgi? ( !minimal ) apache? ( cgi )"
70
71 # Upstream's listing of required modules is NOT correct!
72 # Some of the postgres plugins use DBD::Pg, while others call psql directly.
73 # Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
74 # We replace the original ipmi plugins with the freeipmi_ plugin which at least works.
75 DEPEND_COM="dev-lang/perl[berkdb]
76 sys-process/procps
77 doc? ( dev-python/sphinx )
78 asterisk? ( dev-perl/Net-Telnet )
79 irc? ( dev-perl/Net-IRC )
80 mysql? ( virtual/mysql
81 dev-perl/Cache-Cache
82 dev-perl/DBD-mysql )
83 ssl? ( dev-perl/Net-SSLeay )
84 postgres? ( dev-perl/DBD-Pg dev-db/postgresql-base )
85 memcached? ( dev-perl/Cache-Memcached )
86 cgi? ( dev-perl/FCGI )
87 apache? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] )
88 syslog? ( virtual/perl-Sys-Syslog )
89 http? ( dev-perl/libwww-perl )
90 dhcpd? (
91 >=net-misc/dhcp-3[server]
92 dev-perl/Net-IP
93 dev-perl/HTTP-Date
94 )
95 dev-perl/DBI
96 dev-perl/DateManip
97 dev-perl/File-Copy-Recursive
98 dev-perl/List-MoreUtils
99 dev-perl/Log-Log4perl
100 dev-perl/Net-CIDR
101 dev-perl/Net-Netmask
102 dev-perl/Net-SNMP
103 dev-perl/net-server[ipv6(-)?]
104 virtual/perl-Digest-MD5
105 virtual/perl-Getopt-Long
106 virtual/perl-MIME-Base64
107 virtual/perl-Storable
108 virtual/perl-Text-Balanced
109 virtual/perl-Time-HiRes
110 !minimal? (
111 dev-perl/HTML-Template
112 dev-perl/IO-Socket-INET6
113 dev-perl/URI
114 >=net-analyzer/rrdtool-1.3[perl]
115 virtual/ssh
116 )"
117
118 # Keep this seperate, as previous versions have had other deps here
119 DEPEND="${DEPEND_COM}
120 virtual/perl-Module-Build
121 java? ( >=virtual/jdk-1.5 )
122 test? (
123 dev-perl/Test-Deep
124 dev-perl/Test-LongString
125 dev-perl/Test-Differences
126 dev-perl/Test-MockModule
127 dev-perl/Test-MockObject
128 dev-perl/File-Slurp
129 dev-perl/IO-stringy
130 dev-perl/IO-Socket-INET6
131 )"
132 RDEPEND="${DEPEND_COM}
133 virtual/awk
134 ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 )
135 java? (
136 >=virtual/jre-1.5
137 || ( net-analyzer/netcat6 net-analyzer/netcat )
138 )
139 !minimal? (
140 virtual/cron
141 media-fonts/dejavu
142 )
143 !<sys-apps/openrc-0.11.8"
144
145 S="${WORKDIR}/${MY_P}"
146
147 pkg_setup() {
148 enewgroup munin
149 enewuser munin 177 -1 /var/lib/munin munin
150 enewuser munin-async -1 /bin/sh /var/spool/munin-async
151 esethome munin-async /var/spool/munin-async
152 java-pkg-opt-2_pkg_setup
153 }
154
155 src_prepare() {
156 epatch "${WORKDIR}"/patches/*.patch
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 apache 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 if use doc; then
192 emake -C doc html
193 fi
194 }
195
196 src_test() {
197 if [[ ${EUID} == 0 ]]; then
198 eerror "You cannot run tests as root."
199 eerror "Please enable FEATURES=userpriv before proceeding."
200 return 1
201 fi
202
203 local testtargets="test-common test-node test-plugins"
204 use minimal || testtargets+=" test-master"
205
206 LC_ALL=C emake -j1 ${testtargets}
207 }
208
209 src_install() {
210 local dirs="
211 /var/log/munin
212 /var/lib/munin/plugin-state
213 /etc/munin/plugin-conf.d
214 /etc/munin/plugins"
215 use minimal || dirs+=" /etc/munin/munin-conf.d/"
216
217 keepdir ${dirs}
218 fowners munin:munin ${dirs}
219
220 # parallel install doesn't work and it's also pointless to have this
221 # run in parallel for now (because it uses internal loops).
222 emake -j1 DESTDIR="${D}" $(usex minimal install-minimal install)
223
224 # we remove /run from the install, as it's not the package's to deal
225 # with.
226 rm -rf "${D}"/run
227
228 # remove the plugins for non-Gentoo package managers
229 rm "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die
230
231 insinto /etc/munin/plugin-conf.d/
232 newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node
233
234 newinitd "${FILESDIR}"/munin-node_init.d_2.0.7 munin-node
235 newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
236
237 newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd
238
239 cat - >> "${T}"/munin.env <<EOF
240 CONFIG_PROTECT=/var/spool/munin-async/.ssh
241 EOF
242 newenvd "${T}"/munin.env 50munin
243
244 dodoc README ChangeLog INSTALL
245 if use doc; then
246 cd "${S}"/doc/_build/html
247 dohtml -r *
248 cd "${S}"
249 fi
250
251 dodir /etc/logrotate.d/
252 sed -e "s:@CGIUSER@:$(usex apache apache munin):g" \
253 "${FILESDIR}"/logrotate.d-munin.2 > "${D}"/etc/logrotate.d/munin
254
255 dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_
256
257 if use syslog; then
258 sed -i -e '/log_file/s| .*| Sys::Syslog|' \
259 "${D}"/etc/munin/munin-node.conf || die
260 fi
261
262 # Use a simpler pid file to avoid trouble with /run in tmpfs. The
263 # munin-node service is ran as user root, and only later drops
264 # privileges.
265 sed -i -e 's:/run/munin/munin-node.pid:/run/munin-node.pid:' \
266 "${D}"/etc/munin/munin-node.conf || die
267
268 keepdir /var/spool/munin-async/.ssh
269 touch "${D}"/var/spool/munin-async/.ssh/authorized_keys
270 fowners munin-async:munin /var/spool/munin-async{,/.ssh/{,authorized_keys}}
271 fperms 0750 /var/spool/munin-async{,/.ssh}
272 fperms 0600 /var/spool/munin-async/.ssh/authorized_keys
273
274 if use minimal; then
275 # This requires the presence of munin-update, which is part of
276 # the non-minimal install...
277 rm "${D}"/usr/libexec/munin/plugins/munin_stats
278 else
279 dodir /usr/lib/tmpfiles.d
280 cat - > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<EOF
281 d /run/munin 0700 munin munin - -
282 EOF
283
284 # remove font files so that we don't have to keep them around
285 rm "${D}"/usr/libexec/${PN}/*.ttf || die
286
287 if use cgi; then
288 sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die
289
290 keepdir /var/cache/munin-cgi
291 touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log
292 fowners $(usex apache apache munin) \
293 /var/cache/munin-cgi \
294 /var/log/munin/munin-cgi-{graph,html}.log
295
296 if use apache; then
297 insinto /etc/apache2/vhosts.d
298 newins "${FILESDIR}"/munin.apache.include munin.include
299 newins "${FILESDIR}"/munin.apache.include-2.4 munin-2.4.include
300 fi
301 else
302 sed -i -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' "${D}"/etc/munin/munin.conf || die
303 fi
304
305 keepdir /var/lib/munin/.ssh
306 cat - >> "${D}"/var/lib/munin/.ssh/config <<EOF
307 IdentityFile /var/lib/munin/.ssh/id_ecdsa
308 IdentityFile /var/lib/munin/.ssh/id_rsa
309 EOF
310
311 fowners munin:munin /var/lib/munin/.ssh/{,config}
312 fperms go-rwx /var/lib/munin/.ssh/{,config}
313
314 dodir /usr/share/${PN}
315 cat - >> "${D}"/usr/share/${PN}/crontab <<EOF
316 # Force the shell to bash
317 SHELL=/bin/bash
318 # Mail reports to root@, not munin@
319 MAILTO=root
320
321 # This runs the munin task every 5 minutes.
322 */5 * * * * /usr/bin/munin-cron
323
324 # Alternatively, this route works differently
325 # Update once a minute (for busy sites)
326 #*/1 * * * * /usr/libexec/munin/munin-update
327 ## Check for limit excess every 2 minutes
328 #*/2 * * * * /usr/libexec/munin/munin-limits
329 ## Update graphs every 5 minutes
330 #*/5 * * * * nice /usr/libexec/munin/munin-graph
331 ## Update HTML pages every 15 minutes
332 #*/15 * * * * nice /usr/libexec/munin/munin-html
333 EOF
334
335 cat - >> "${D}"/usr/share/${PN}/fcrontab <<EOF
336 # Mail reports to root@, not munin@, only execute one at a time
337 !mailto(root),serial(true)
338
339 # This runs the munin task every 5 minutes.
340 @ 5 /usr/bin/munin-cron
341
342 # Alternatively, this route works differently
343 # Update once a minute (for busy sites)
344 #@ 1 /usr/libexec/munin/munin-update
345 ## Check for limit excess every 2 minutes
346 #@ 2 /usr/libexec/munin/munin-limits
347 ## Update graphs every 5 minutes
348 #@ 5 nice /usr/libexec/munin/munin-graph
349 ## Update HTML pages every 15 minutes
350 #@ 15 nice /usr/libexec/munin/munin-html
351 EOF
352
353 # remove .htaccess file
354 find "${D}" -name .htaccess -delete || die
355 fi
356 }
357
358 pkg_config() {
359 if use minimal; then
360 einfo "Nothing to do."
361 return 0
362 fi
363
364 einfo "Press enter to install the default crontab for the munin master"
365 einfo "installation from /usr/share/${PN}/f?crontab"
366 einfo "If you have a large site, you may wish to customize it."
367 read
368
369 ebegin "Setting up cron ..."
370 if has_version sys-process/fcron; then
371 fcrontab - -u munin < /usr/share/${PN}/fcrontab
372 else
373 # dcron is very fussy about syntax
374 # the following is the only form that works in BOTH dcron and vixie-cron
375 crontab - -u munin < /usr/share/${PN}/crontab
376 fi
377 eend $?
378
379 einfo "Press enter to set up the SSH keys used for SSH transport"
380 read
381
382 # generate one rsa (for legacy) and one ecdsa (for new systems)
383 ssh-keygen -t rsa -f /var/lib/munin/.ssh/id_rsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
384 ssh-keygen -t ecdsa -f /var/lib/munin/.ssh/id_ecdsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
385 chown -R munin:munin /var/lib/munin/.ssh || die
386 chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die
387
388 einfo "Your public keys are available in "
389 einfo " /var/lib/munin/.ssh/id_rsa.pub"
390 einfo " /var/lib/munin/.ssh/id_ecdsa.pub"
391 einfo "and follows for convenience"
392 echo
393 cat /var/lib/munin/.ssh/id_*.pub
394 }
395
396 pkg_postinst() {
397 elog "Please follow the munin documentation to set up the plugins you"
398 elog "need, afterwards start munin-node via /etc/init.d/munin-node."
399 elog ""
400 elog "To make use of munin-async, make sure to set up the corresponding"
401 elog "SSH key in /var/lib/munin-async/.ssh/authorized_keys"
402 elog ""
403 if ! use minimal; then
404 elog "Please run"
405 elog " emerge --config net-analyzer/munin"
406 elog "to automatically configure munin's cronjobs as well as generate"
407 elog "passwordless SSH keys to be used with munin-async."
408 fi
409 elog ""
410 elog "Further information about setting up Munin in Gentoo can be found"
411 elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin"
412
413 if use cgi; then
414 chown $(usex apache apache munin) \
415 "${ROOT}"/var/cache/munin-cgi \
416 "${ROOT}"/var/log/munin-cgi-{graph,html}.log
417
418 if use apache; then
419 elog "To use Munin with CGI you should include /etc/apache2/vhosts.d/munin.include"
420 elog "or /etc/apache2/vhosts.d/munin-2.4.include (for Apache 2.4) from the virtual"
421 elog "host you want it to be served."
422 elog "If you want to enable CGI-based HTML as well, you have to add to"
423 elog "/etc/conf.d/apache2 the option -D MUNIN_HTML_CGI."
424 else
425 elog "Effective CGI support has just been added in 2.0.7-r6."
426 elog "Documentation on how to use it is still sparse."
427 fi
428 fi
429
430 # we create this here as we don't want Portage to check /run
431 # symlinks but we still need this to be present before the reboot.
432 if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then
433 mkdir "${ROOT}"/run/munin
434 chown munin:munin "${ROOT}"/run/munin
435 chmod 0700 "${ROOT}"/run/munin
436 fi
437 }