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.6.ebuild ChangeLog
Date: Sat, 01 Sep 2012 15:06:20
Message-Id: 20120901150605.D63D520EC9@flycatcher.gentoo.org
1 flameeyes 12/09/01 15:06:05
2
3 Modified: ChangeLog
4 Added: munin-2.0.6.ebuild
5 Log:
6 Version bump with new patchset.
7
8 (Portage version: 2.2.0_alpha123/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.99 net-analyzer/munin/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/ChangeLog?rev=1.99&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/ChangeLog?rev=1.99&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/ChangeLog?r1=1.98&r2=1.99
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v
20 retrieving revision 1.98
21 retrieving revision 1.99
22 diff -u -r1.98 -r1.99
23 --- ChangeLog 29 Aug 2012 18:04:07 -0000 1.98
24 +++ ChangeLog 1 Sep 2012 15:06:05 -0000 1.99
25 @@ -1,6 +1,11 @@
26 # ChangeLog for net-analyzer/munin
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.98 2012/08/29 18:04:07 flameeyes Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.99 2012/09/01 15:06:05 flameeyes Exp $
30 +
31 +*munin-2.0.6 (01 Sep 2012)
32 +
33 + 01 Sep 2012; Diego E. Pettenò <flameeyes@g.o> +munin-2.0.6.ebuild:
34 + Version bump with new patchset.
35
36 29 Aug 2012; Diego E. Pettenò <flameeyes@g.o>
37 files/munin-node_init.d_2.0.5, munin-2.0.5-r2.ebuild:
38
39
40
41 1.1 net-analyzer/munin/munin-2.0.6.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/munin-2.0.6.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/munin-2.0.6.ebuild?rev=1.1&content-type=text/plain
45
46 Index: munin-2.0.6.ebuild
47 ===================================================================
48 # Copyright 1999-2012 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.6.ebuild,v 1.1 2012/09/01 15:06:05 flameeyes Exp $
51
52 EAPI=4
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}-patches-${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"
69 REQUIRED_USE="cgi? ( !minimal )"
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
76 sys-process/procps
77 asterisk? ( dev-perl/Net-Telnet )
78 irc? ( dev-perl/Net-IRC )
79 mysql? ( virtual/mysql
80 dev-perl/Cache-Cache
81 dev-perl/DBD-mysql )
82 ssl? ( dev-perl/Net-SSLeay )
83 postgres? ( dev-perl/DBD-Pg dev-db/postgresql-base )
84 memcached? ( dev-perl/Cache-Memcached )
85 cgi? ( dev-perl/FCGI )
86 syslog? ( virtual/perl-Sys-Syslog )
87 http? ( dev-perl/libwww-perl )
88 dev-perl/DBI
89 dev-perl/DateManip
90 dev-perl/File-Copy-Recursive
91 dev-perl/Log-Log4perl
92 dev-perl/Net-CIDR
93 dev-perl/Net-Netmask
94 dev-perl/Net-SNMP
95 dev-perl/net-server[ipv6(-)?]
96 virtual/perl-Digest-MD5
97 virtual/perl-Getopt-Long
98 virtual/perl-MIME-Base64
99 virtual/perl-Storable
100 virtual/perl-Text-Balanced
101 virtual/perl-Time-HiRes
102 !minimal? (
103 dev-perl/HTML-Template
104 dev-perl/IO-Socket-INET6
105 >=net-analyzer/rrdtool-1.3[perl]
106 )"
107
108 # Keep this seperate, as previous versions have had other deps here
109 DEPEND="${DEPEND_COM}
110 virtual/perl-Module-Build
111 java? ( >=virtual/jdk-1.5 )
112 test? (
113 dev-perl/Test-LongString
114 dev-perl/Test-Differences
115 dev-perl/Test-MockModule
116 dev-perl/File-Slurp
117 dev-perl/IO-stringy
118 dev-perl/IO-Socket-INET6
119 )"
120 RDEPEND="${DEPEND_COM}
121 virtual/awk
122 ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 )
123 java? (
124 >=virtual/jre-1.5
125 || ( net-analyzer/netcat6 net-analyzer/netcat )
126 )
127 !minimal? (
128 virtual/cron
129 media-fonts/dejavu
130 )"
131
132 S="${WORKDIR}/${MY_P}"
133
134 pkg_setup() {
135 enewgroup munin
136 enewuser munin 177 -1 /var/lib/munin munin
137 enewuser munin-async -1 /bin/true /var/lib/munin-async
138 java-pkg-opt-2_pkg_setup
139 }
140
141 src_prepare() {
142 epatch "${WORKDIR}"/patches/*.patch
143
144 java-pkg-opt-2_src_prepare
145 }
146
147 src_configure() {
148 local cgidir='$(DESTDIR)/var/www/localhost/cgi-bin'
149 use cgi || cgidir="${T}/useless/cgi-bin"
150
151 cat - >> "${S}"/Makefile.config <<EOF
152 PREFIX=\$(DESTDIR)/usr
153 CONFDIR=\$(DESTDIR)/etc/munin
154 DOCDIR=${T}/useless/doc
155 MANDIR=\$(PREFIX)/share/man
156 LIBDIR=\$(PREFIX)/libexec/munin
157 HTMLDIR=\$(DESTDIR)/var/www/localhost/htdocs/munin
158 CGIDIR=${cgidir}
159 DBDIR=\$(DESTDIR)/var/lib/munin
160 SPOOLDIR=\$(DESTDIR)/var/spool/munin-async
161 LOGDIR=\$(DESTDIR)/var/log/munin
162 PERLSITELIB=$(perl -V:vendorlib | cut -d"'" -f2)
163 JCVALID=$(usex java yes no)
164 EOF
165 }
166
167 # parallel make and install need to be fixed before, and I haven't
168 # gotten around to do so yet.
169 src_compile() {
170 emake -j1
171 }
172
173 src_install() {
174 local dirs="
175 /var/log/munin
176 /var/lib/munin/plugin-state
177 /etc/munin/plugin-conf.d
178 /etc/munin/plugins"
179 keepdir ${dirs}
180 fowners munin:munin ${dirs}
181
182 local install_targets="install-common-prime install-node-prime install-plugins-prime"
183 use java && install_targets+=" install-plugins-java"
184
185 use minimal || install_targets=install
186 use minimal || dirs+=" /etc/munin/munin-conf.d/"
187
188 # parallel install doesn't work and it's also pointless to have this
189 # run in parallel for now (because it uses internal loops).
190 emake -j1 DESTDIR="${D}" ${install_targets}
191
192 # remove the plugins for non-Gentoo package managers
193 rm "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die
194
195 insinto /etc/munin/plugin-conf.d/
196 newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node
197
198 newinitd "${FILESDIR}"/munin-node_init.d_2.0.5 munin-node
199 newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
200
201 newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd
202
203 dodoc README ChangeLog INSTALL build/resources/apache*
204
205 # bug 254968
206 insinto /etc/logrotate.d/
207 newins "${FILESDIR}"/logrotate.d-munin munin
208
209 dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_
210
211 if use syslog; then
212 sed -i -e '/log_file/s| .*| Sys::Syslog|' \
213 "${D}"/etc/munin/munin-node.conf || die
214 fi
215
216 # Use a simpler pid file to avoid trouble with /run in tmpfs. The
217 # munin-node service is ran as user root, and only later drops
218 # privileges.
219 sed -i -e 's:/var/run/munin/munin-node.pid:/var/run/munin-node.pid:' \
220 "${D}"/etc/munin/munin-node.conf || die
221
222 keepdir /var/lib/munin-async/.ssh /var/spool/munin-async
223 touch "${D}"/var/lib/munin-async/.ssh/authorized_keys
224 fowners munin-async /var/lib/munin-async/.ssh/{,authorized_keys}
225 fperms 0700 /var/lib/munin-async/.ssh /var/spool/munin-async
226 fperms 0600 /var/lib/munin-async/.ssh/authorized_keys
227
228 if use minimal; then
229 # This requires the presence of munin-update, which is part of
230 # the non-minimal install...
231 rm "${D}"/usr/libexec/munin/plugins/munin_stats
232 else
233 exeinto /etc/local.d/
234 newexe "${FILESDIR}"/localstart-munin 50munin.start
235
236 # remove font files so that we don't have to keep them around
237 rm "${D}"/usr/libexec/${PN}/*.ttf || die
238
239 if use cgi; then
240 sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die
241 else
242 sed -i -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' "${D}"/etc/munin/munin.conf || die
243 fi
244
245 keepdir /var/lib/munin/.ssh
246 cat - >> "${D}"/var/lib/munin/.ssh/config <<EOF
247 IdentityFile /var/lib/munin/.ssh/id_ecdsa
248 IdentityFile /var/lib/munin/.ssh/id_rsa
249 EOF
250
251 fperms go-rwx /var/lib/munin/.ssh/{,config}
252
253 dodir /usr/share/${PN}
254 cat - >> "${D}"/usr/share/${PN}/crontab <<EOF
255 # Force the shell to bash
256 SHELL=/bin/bash
257 # Mail reports to root@, not munin@
258 MAILTO=root
259
260 # This runs the munin task every 5 minutes.
261 */5 * * * * /usr/bin/munin-cron
262
263 # Alternatively, this route works differently
264 # Update once a minute (for busy sites)
265 #*/1 * * * * /usr/libexec/munin/munin-update
266 ## Check for limit excess every 2 minutes
267 #*/2 * * * * /usr/libexec/munin/munin-limits
268 ## Update graphs every 5 minutes
269 #*/5 * * * * nice /usr/libexec/munin/munin-graph
270 ## Update HTML pages every 15 minutes
271 #*/15 * * * * nice /usr/libexec/munin/munin-html
272 EOF
273
274 cat - >> "${D}"/usr/share/${PN}/fcrontab <<EOF
275 # Mail reports to root@, not munin@, only execute one at a time
276 !mailto(root),serial(true)
277
278 # This runs the munin task every 5 minutes.
279 @ 5 /usr/bin/munin-cron
280
281 # Alternatively, this route works differently
282 # Update once a minute (for busy sites)
283 #@ 1 /usr/libexec/munin/munin-update
284 ## Check for limit excess every 2 minutes
285 #@ 2 /usr/libexec/munin/munin-limits
286 ## Update graphs every 5 minutes
287 #@ 5 nice /usr/libexec/munin/munin-graph
288 ## Update HTML pages every 15 minutes
289 #@ 15 nice /usr/libexec/munin/munin-html
290 EOF
291
292 # remove .htaccess file
293 find "${D}" -name .htaccess -delete || die
294 fi
295 }
296
297 pkg_config() {
298 if use minimal; then
299 einfo "Nothing to do."
300 return 0
301 fi
302
303 einfo "Press enter to install the default crontab for the munin master"
304 einfo "installation from /usr/share/${PN}/f?crontab"
305 einfo "If you have a large site, you may wish to customize it."
306 read
307
308 ebegin "Setting up cron ..."
309 if has_version sys-process/fcron; then
310 fcrontab - -u munin < /usr/share/${PN}/fcrontab
311 else
312 # dcron is very fussy about syntax
313 # the following is the only form that works in BOTH dcron and vixie-cron
314 crontab - -u munin < /usr/share/${PN}/crontab
315 fi
316 eend $?
317
318 einfo "Press enter to set up the SSH keys used for SSH transport"
319 read
320
321 # generate one rsa (for legacy) and one ecdsa (for new systems)
322 ssh-keygen -t rsa -f /var/lib/munin/.ssh/id_rsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
323 ssh-keygen -t ecdsa -f /var/lib/munin/.ssh/id_ecdsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
324 chown -R munin:munin /var/lib/munin/.ssh || die
325 chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die
326
327 einfo "Your public keys are available in "
328 einfo " /var/lib/munin/.ssh/id_rsa.pub"
329 einfo " /var/lib/munin/.ssh/id_ecdsa.pub"
330 einfo "and follows for convenience"
331 echo
332 cat /var/lib/munin/.ssh/id_*.pub
333 }
334
335 pkg_postinst() {
336 elog "Please follow the munin documentation to set up the plugins you"
337 elog "need, afterwards start munin-node via /etc/init.d/munin-node."
338 elog ""
339 elog "To make use of munin-async, make sure to set up the corresponding"
340 elog "SSH key in /var/lib/munin-async/.ssh/authorized_keys"
341 elog ""
342 if ! use minimal; then
343 elog "Please run"
344 elog " emerge --config net-analyzer/munin"
345 elog "to automatically configure munin's cronjobs as well as generate"
346 elog "passwordless SSH keys to be used with munin-async."
347 fi
348 elog ""
349 elog "Further information about setting up Munin in Gentoo can be found"
350 elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin"
351 }