Gentoo Archives: gentoo-commits

From: "Justin Bronder (jsbronder)" <jsbronder@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-cluster/ganglia: ganglia-3.1.1-r2.ebuild ChangeLog ganglia-3.1.1-r1.ebuild
Date: Tue, 20 Jan 2009 16:42:31
Message-Id: E1LPJgI-0004yZ-Lx@stork.gentoo.org
1 jsbronder 09/01/20 16:42:26
2
3 Modified: ChangeLog
4 Added: ganglia-3.1.1-r2.ebuild
5 Removed: ganglia-3.1.1-r1.ebuild
6 Log:
7 Update the patch for ganglia bug #223 , Gentoo bug #255593. Remove old ganglia-3.1.1-r1 and associated patch.
8 (Portage version: 2.2_rc23/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.22 sys-cluster/ganglia/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/ganglia/ChangeLog?rev=1.22&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/ganglia/ChangeLog?rev=1.22&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/ganglia/ChangeLog?r1=1.21&r2=1.22
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-cluster/ganglia/ChangeLog,v
20 retrieving revision 1.21
21 retrieving revision 1.22
22 diff -u -r1.21 -r1.22
23 --- ChangeLog 18 Jan 2009 21:12:50 -0000 1.21
24 +++ ChangeLog 20 Jan 2009 16:42:26 -0000 1.22
25 @@ -1,6 +1,15 @@
26 # ChangeLog for sys-cluster/ganglia
27 # Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/ganglia/ChangeLog,v 1.21 2009/01/18 21:12:50 jsbronder Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/ganglia/ChangeLog,v 1.22 2009/01/20 16:42:26 jsbronder Exp $
30 +
31 +*ganglia-3.1.1-r2 (20 Jan 2009)
32 +
33 + 20 Jan 2009; Justin Bronder <jsbronder@g.o>
34 + -files/ganglia-3.1.1-process_path-overflow.patch,
35 + +files/ganglia-3.1.1-process_path-overflow-r1.patch,
36 + -ganglia-3.1.1-r1.ebuild, +ganglia-3.1.1-r2.ebuild:
37 + Update the patch for ganglia bug #223 , Gentoo bug #255593. Remove old
38 + ganglia-3.1.1-r1 and associated patch.
39
40 *ganglia-3.1.1-r1 (18 Jan 2009)
41
42
43
44
45 1.1 sys-cluster/ganglia/ganglia-3.1.1-r2.ebuild
46
47 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/ganglia/ganglia-3.1.1-r2.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/ganglia/ganglia-3.1.1-r2.ebuild?rev=1.1&content-type=text/plain
49
50 Index: ganglia-3.1.1-r2.ebuild
51 ===================================================================
52 # Copyright 1999-2009 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/ganglia/ganglia-3.1.1-r2.ebuild,v 1.1 2009/01/20 16:42:26 jsbronder Exp $
55
56 WEBAPP_OPTIONAL="yes"
57 inherit multilib webapp depend.php python
58
59 DESCRIPTION="A scalable distributed monitoring system for clusters and grids"
60 HOMEPAGE="http://ganglia.sourceforge.net/"
61 SRC_URI="mirror://sourceforge/ganglia/${P}.tar.gz"
62 LICENSE="BSD"
63
64 WEBAPP_MANUAL_SLOT="yes"
65 SLOT="0"
66 KEYWORDS="~amd64 ~ppc ~x86"
67 IUSE="minimal vhosts python"
68
69 DEPEND="
70 dev-libs/confuse
71 dev-libs/expat
72 >=dev-libs/apr-1.0
73 python? ( >=dev-lang/python-2.3 )
74 !dev-db/firebird"
75
76 RDEPEND="
77 ${DEPEND}
78 !minimal? ( net-analyzer/rrdtool
79 ${WEBAPP_DEPEND}
80 =virtual/httpd-php-5* )"
81
82 pkg_setup() {
83 if ! use minimal ; then
84 require_gd
85 require_php_with_use xml ctype
86 webapp_pkg_setup
87 fi
88 }
89
90 src_unpack() {
91 unpack ${A}
92 cd "${S}"
93 epatch "${FILESDIR}"/${P}-ctype-c99.patch
94 epatch "${FILESDIR}"/${P}-multidisk-group.patch
95 # Shouldn't be needed for 3.1.2
96 # http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=223
97 epatch "${FILESDIR}"/${P}-process_path-overflow-r1.patch
98 }
99
100 src_compile() {
101 econf \
102 --enable-gexec \
103 $(use_enable python) \
104 $(use_with !minimal gmetad) || die "econf failed"
105
106 emake || die "emake failed"
107 }
108
109 src_install() {
110 emake DESTDIR="${D}" install || die "emake install failed"
111
112 newinitd "${FILESDIR}"/gmond.rc gmond
113 doman mans/{gmetric.1,gmond.1,gstat.1}
114 doman gmond/gmond.conf.5
115 dodoc AUTHORS ChangeLog INSTALL NEWS README
116 dodir /etc/ganglia/conf.d
117 gmond/gmond -t > "${D}"/etc/ganglia/gmond.conf
118
119 # Sadly, there is no install target for any of this.
120 if use python; then
121 # We install the multidisk module, but not the configuration
122 # as this needs to be generated later. See pkg_config
123 local gmond_py="disk/multidisk network/tcpconn"
124 local gmond_py_conf="tcpconn"
125 newdoc gmond/modules/python/README README.python_modules
126 insinto /etc/ganglia/conf.d
127 doins gmond/modules/conf.d/modpython.conf
128 for i in ${gmond_py_conf}; do
129 doins gmond/python_modules/conf.d/${i}.pyconf
130 done
131 dodir /usr/$(get_libdir)/ganglia/python_modules
132 insinto /usr/$(get_libdir)/ganglia/python_modules
133 for i in ${gmond_py}; do
134 doins gmond/python_modules/${i}.py
135 done
136
137 fi
138
139 insinto /etc/ganglia
140 if ! use minimal; then
141 doins gmetad/gmetad.conf
142 doman mans/gmetad.1
143 keepdir /var/lib/ganglia/rrds
144 fowners nobody:nobody /var/lib/ganglia/rrds
145 newinitd "${FILESDIR}"/gmetad.rc gmetad
146
147 webapp_src_preinst
148 insinto "${MY_HTDOCSDIR}"
149 doins -r web/*
150
151 webapp_configfile "${MY_HTDOCSDIR}"/conf.php
152 webapp_src_install
153 fi
154 }
155
156 pkg_preinst() {
157 if has_version '<sys-cluster/ganglia-3.1.0'; then
158 elog "Previous ganglia installation detected."
159 elog "Copying gmetad configuration to /etc/ganglia"
160 elog "You may have to remove /etc/gmond.conf yourself."
161 mkdir -p "${D}"/etc/ganglia
162 [ -f "${ROOT}"etc/gmetad.conf ] \
163 && cp "${ROOT}"etc/gmetad.conf "${D}"/etc/ganglia
164 fi
165 }
166
167 pkg_postinst() {
168 elog "A default configuration file for gmond has been generated"
169 elog "for you as a template by running:"
170 elog " /usr/sbin/gmond -t > /etc/ganglia/gmond.conf"
171 elog "customize it from there or provide your own but be aware"
172 elog "the format has changed since 3.0 and so you won't be able"
173 elog "to use your current configuration (if you generated any)"
174 elog "in /etc/gmond.conf directly"
175 elog
176 elog "If you require disk {usage,total} statistics, please run"
177 elog " emerge --config ${PN}"
178 elog "then check ${ROOT}etc/ganglia/conf.d/diskusage.pyconf"
179 elog "for correctness."
180
181 use minimal || webapp_pkg_postinst
182
183 use python && \
184 python_mod_optimize /usr/$(get_libdir)/ganglia/python_modules/
185 }
186
187 pkg_prerm() {
188 use minimal || webapp_pkg_prerm
189 }
190
191 pkg_postrm() {
192 use python && \
193 python_mod_cleanup /usr/$(get_libdir)/ganglia/python_modules/
194 [ -d /usr/$(get_libdir)/ganglia ] && \
195 rmdir /usr/$(get_libdir)/ganglia 2>/dev/null
196 }
197
198 pkg_config() {
199 local disk_used_metrics disk_total_metrics i
200 local disk_pyconf="${ROOT}"etc/ganglia/conf.d/diskusage.pyconf
201
202 if ! use python; then
203 einfo "No configuration necessary :)"
204 exit 0
205 fi
206
207 if [ ! -w ${disk_pyconf} ]; then
208 eerror "Cannot write to ${disk_pyconf}"
209 exit 1
210 fi
211
212 ebegin "Generating disk used/total metric configuration to ${disk_pyconf}"
213 disk_used_metrics=$(${ROOT}/usr/sbin/gmond -m | awk '/-disk_used/{print $1}')
214 disk_total_metrics=$(${ROOT}/usr/sbin/gmond -m | awk '/-disk_total/{print $1}')
215 cat > ${disk_pyconf} <<-EOF
216 #/* Disk usage collection groups for
217 # multidisk python module */
218 #
219 # Autogenerated by pkg_config in the Gentoo ganglia ebuild.
220
221 modules {
222 module {
223 name = "multidisk"
224 language = "python"
225 }
226 }
227
228 collection_group {
229 collect_every = 10
230 time_threshold = 50
231 EOF
232 for i in ${disk_used_metrics}; do
233 printf \
234 "\n metric {\n name = \"%s\"\n value_threshold = 1.0\n }" \
235 ${i} >> ${disk_pyconf}
236 done
237 printf "\n}\n\n" >> ${disk_pyconf}
238
239 # Get the disk total metrics.
240 cat >> ${disk_pyconf} <<-EOF
241 collection_group {
242 collect_once = yes
243 time_threshold = 20
244 EOF
245 for i in ${disk_total_metrics}; do
246 printf \
247 "\n metric {\n name = \"%s\"\n }" \
248 ${i} >> ${disk_pyconf}
249 done
250 printf "\n}\n" >> ${disk_pyconf}
251 }