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