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.3-r1.ebuild ChangeLog
Date: Sun, 29 Jul 2012 03:53:32
Message-Id: 20120729035320.6D43F2004B@flycatcher.gentoo.org
1 flameeyes 12/07/29 03:53:20
2
3 Modified: ChangeLog
4 Added: munin-2.0.3-r1.ebuild
5 Log:
6 Update my freeipmi_ plugin and use it to replace the other two originals (which it replaces entirely).
7
8 (Portage version: 2.2.0_alpha120/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.86 net-analyzer/munin/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/ChangeLog?rev=1.86&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/ChangeLog?rev=1.86&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/ChangeLog?r1=1.85&r2=1.86
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v
20 retrieving revision 1.85
21 retrieving revision 1.86
22 diff -u -r1.85 -r1.86
23 --- ChangeLog 28 Jul 2012 00:44:43 -0000 1.85
24 +++ ChangeLog 29 Jul 2012 03:53:20 -0000 1.86
25 @@ -1,6 +1,12 @@
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.85 2012/07/28 00:44:43 flameeyes Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.86 2012/07/29 03:53:20 flameeyes Exp $
30 +
31 +*munin-2.0.3-r1 (29 Jul 2012)
32 +
33 + 29 Jul 2012; Diego E. Pettenò <flameeyes@g.o> +munin-2.0.3-r1.ebuild:
34 + Update my freeipmi_ plugin and use it to replace the other two originals
35 + (which it replaces entirely).
36
37 28 Jul 2012; Diego E. Pettenò <flameeyes@g.o> metadata.xml,
38 munin-2.0.3.ebuild:
39
40
41
42 1.1 net-analyzer/munin/munin-2.0.3-r1.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/munin-2.0.3-r1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/munin-2.0.3-r1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: munin-2.0.3-r1.ebuild
48 ===================================================================
49 # Copyright 1999-2012 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/munin-2.0.3-r1.ebuild,v 1.1 2012/07/29 03:53:20 flameeyes Exp $
52
53 EAPI=4
54
55 PATCHSET=6
56
57 inherit eutils user java-pkg-opt-2
58
59 MY_P=${P/_/-}
60
61 DESCRIPTION="Munin Server Monitoring Tool"
62 HOMEPAGE="http://munin-monitoring.org/"
63 SRC_URI="mirror://sourceforge/munin/${MY_P}.tar.gz
64 http://dev.gentoo.org/~flameeyes/${PN}/${P}-patches-${PATCHSET}.tar.xz"
65
66 LICENSE="GPL-2"
67 SLOT="0"
68 KEYWORDS="~amd64 ~mips ~x86"
69 IUSE="asterisk irc java memcached minimal mysql postgres ssl test +cgi ipv6 syslog ipmi http"
70 REQUIRED_USE="cgi? ( !minimal )"
71
72 # Upstream's listing of required modules is NOT correct!
73 # Some of the postgres plugins use DBD::Pg, while others call psql directly.
74 # Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
75 # We replace the original ipmi plugisn with the freeipmi_ plugin which at least works.
76 DEPEND_COM="dev-lang/perl
77 sys-process/procps
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 syslog? ( virtual/perl-Sys-Syslog )
88 ipmi? (
89 >=sys-libs/freeipmi-1.1.6-r1
90 virtual/awk
91 )
92 http? ( dev-perl/libwww-perl )
93 dev-perl/DBI
94 dev-perl/DateManip
95 dev-perl/File-Copy-Recursive
96 dev-perl/Log-Log4perl
97 dev-perl/Net-CIDR
98 dev-perl/Net-Netmask
99 dev-perl/Net-SNMP
100 dev-perl/net-server[ipv6(-)?]
101 virtual/perl-Digest-MD5
102 virtual/perl-Getopt-Long
103 virtual/perl-MIME-Base64
104 virtual/perl-Storable
105 virtual/perl-Text-Balanced
106 virtual/perl-Time-HiRes
107 !minimal? (
108 dev-perl/HTML-Template
109 dev-perl/IO-Socket-INET6
110 >=net-analyzer/rrdtool-1.3[perl]
111 )"
112
113 # Keep this seperate, as previous versions have had other deps here
114 DEPEND="${DEPEND_COM}
115 virtual/perl-Module-Build
116 java? ( >=virtual/jdk-1.5 )
117 test? (
118 dev-perl/Test-LongString
119 dev-perl/Test-Differences
120 dev-perl/Test-MockModule
121 dev-perl/File-Slurp
122 dev-perl/IO-stringy
123 dev-perl/IO-Socket-INET6
124 )"
125 RDEPEND="${DEPEND_COM}
126 java? ( >=virtual/jre-1.5 )
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 java-pkg-opt-2_pkg_setup
138 }
139
140 src_prepare() {
141 epatch "${WORKDIR}"/patches/*.patch
142 mv b/plugins/node.d/freeipmi_.in plugins/node.d/
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 LOGDIR=\$(DESTDIR)/var/log/munin
161 PERLSITELIB=$(perl -V:vendorlib | cut -d"'" -f2)
162 JCVALID=$(usex java yes no)
163 EOF
164 }
165
166 # parallel make and install need to be fixed before, and I haven't
167 # gotten around to do so yet.
168 src_compile() {
169 emake -j1
170 }
171
172 src_install() {
173 local dirs="
174 /var/log/munin/
175 /var/lib/munin/plugin-state/
176 /etc/munin/plugin-conf.d/
177 /etc/munin/plugins/"
178 keepdir ${dirs}
179 fowners munin:munin ${dirs}
180 use minimal || dirs+=" /etc/munin/munin-conf.d/"
181
182 local install_targets="install-common-prime install-node-prime install-plugins-prime"
183 use java && install_targets+=" install-plugins-java"
184 use minimal || install_targets=install
185
186 # parallel install doesn't work and it's also pointless to have this
187 # run in parallel for now (because it uses internal loops).
188 emake -j1 DESTDIR="${D}" ${install_targets}
189
190 # remove the plugins for non-Gentoo package managers
191 rm "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die
192
193 insinto /etc/munin/plugin-conf.d/
194 newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node
195
196 # make sure we've got everything in the correct directory
197 newinitd "${FILESDIR}"/munin-node_init.d_2.0.2 munin-node
198 newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
199 dodoc README ChangeLog INSTALL build/resources/apache*
200
201 # bug 254968
202 insinto /etc/logrotate.d/
203 newins "${FILESDIR}"/logrotate.d-munin munin
204
205 dosym freeipmi_ /usr/libexec/munin/plugins/ipmi_
206 dosym freeipmi_ /usr/libexec/munin/plugins/ipmi_sensor_
207
208 if use syslog; then
209 sed -i -e '/log_file/s| .*| Sys::Syslog|' \
210 "${D}"/etc/munin/munin-node.conf || die
211 fi
212
213 if ! use minimal; then
214 exeinto /etc/local.d/
215 newexe "${FILESDIR}"/localstart-munin 50munin.start
216
217 # remove font files so that we don't have to keep them around
218 rm "${D}"/usr/libexec/${PN}/*.ttf || die
219
220 if use cgi; then
221 sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die
222 else
223 sed -i -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' "${D}"/etc/munin/munin.conf || die
224 fi
225
226 dodir /usr/share/${PN}
227 cat - >> "${D}"/usr/share/${PN}/crontab <<EOF
228 # Force the shell to bash
229 SHELL=/bin/bash
230 # Mail reports to root@, not munin@
231 MAILTO=root
232
233 # This runs the munin task every 5 minutes.
234 */5 * * * * /usr/bin/munin-cron
235
236 # Alternatively, this route works differently
237 # Update once a minute (for busy sites)
238 #*/1 * * * * /usr/libexec/munin/munin-update
239 ## Check for limit excess every 2 minutes
240 #*/2 * * * * /usr/libexec/munin/munin-limits
241 ## Update graphs every 5 minutes
242 #*/5 * * * * nice /usr/libexec/munin/munin-graph
243 ## Update HTML pages every 15 minutes
244 #*/15 * * * * nice /usr/libexec/munin/munin-html
245 EOF
246
247 cat - >> "${D}"/usr/share/${PN}/fcrontab <<EOF
248 # Mail reports to root@, not munin@, only execute one at a time
249 !mailto(root),serial(true)
250
251 # This runs the munin task every 5 minutes.
252 @ 5 /usr/bin/munin-cron
253
254 # Alternatively, this route works differently
255 # Update once a minute (for busy sites)
256 #@ 1 /usr/libexec/munin/munin-update
257 ## Check for limit excess every 2 minutes
258 #@ 2 /usr/libexec/munin/munin-limits
259 ## Update graphs every 5 minutes
260 #@ 5 nice /usr/libexec/munin/munin-graph
261 ## Update HTML pages every 15 minutes
262 #@ 15 nice /usr/libexec/munin/munin-html
263 EOF
264
265 # remove .htaccess file
266 find "${D}" -name .htaccess -delete || die
267 fi
268 }
269
270 pkg_config() {
271 if use minimal; then
272 einfo "Nothing to do."
273 return 0
274 fi
275
276 einfo "Press enter to install the default crontab for the munin master"
277 einfo "installation from /usr/share/${PN}/f?crontab"
278 einfo "If you have a large site, you may wish to customize it."
279 read
280
281 if has_version sys-process/fcron; then
282 fcrontab - -u munin < /usr/share/${PN}/fcrontab
283 else
284 # dcron is very fussy about syntax
285 # the following is the only form that works in BOTH dcron and vixie-cron
286 crontab - -u munin < /usr/share/${PN}/crontab
287 fi
288 }
289
290 pkg_postinst() {
291 elog "Please follow the munin documentation to set up the plugins you"
292 elog "need, afterwards start munin-node via /etc/init.d/munin-node."
293 if ! use minimal; then
294 elog "To have munin's cronjob automatically configured for you if this is"
295 elog "your munin master installation, please:"
296 elog "emerge --config net-analyzer/munin"
297 fi
298 elog ""
299 elog "Further information about setting up Munin in Gentoo can be found"
300 elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin"
301 }