]> git.pld-linux.org Git - packages/ganglia.git/blob - ganglia.spec
- 3.1.7, totally untested
[packages/ganglia.git] / ganglia.spec
1 # TODO
2 # - unpackaged
3 #   /etc/conf.d/modpython.conf
4 #   /etc/gmetad.conf
5 Summary:        Ganglia Distributed Monitoring System
6 Name:           ganglia
7 Version:        3.1.7
8 Release:        0.1
9 License:        BSD
10 Group:          Applications/Networking
11 URL:            http://www.ganglia.info/
12 Source0:        http://dl.sourceforge.net/ganglia/%{name}-%{version}.tar.gz
13 # Source0-md5:  6aa5e2109c2cc8007a6def0799cf1b4c
14 Source1:        %{name}-gmond.init
15 Source2:        %{name}-gmetad.init
16 Patch0:         %{name}-diskusage-fix.patch
17 BuildRequires:  apr-devel
18 BuildRequires:  expat-devel
19 BuildRequires:  freetype-devel
20 BuildRequires:  libart_lgpl-devel
21 BuildRequires:  libconfuse-devel
22 BuildRequires:  libpng-devel
23 BuildRequires:  python-devel
24 BuildRequires:  rrdtool-devel
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         _webapps        /etc/webapps
28 %define         _webapp         %{name}
29
30 %description
31 Ganglia is a scalable, real-time monitoring and execution environment
32 with all execution requests and statistics expressed in an open
33 well-defined XML format.
34
35 %package web
36 Summary:        Ganglia Web Frontend
37 Group:          Applications/Networking
38 Requires:       %{name}-gmetad = %{version}-%{release}
39 Requires:       php-gd
40 Requires:       rrdtool
41 Requires:       webserver(php)
42
43 %description web
44 This package provides a web frontend to display the XML tree published
45 by ganglia, and to provide historical graphs of collected metrics.
46
47 This website is written in the PHP4 language.
48
49 %package gmetad
50 Summary:        Ganglia Metadata collection daemon
51 Group:          Applications/Networking
52 Requires(post): /sbin/chkconfig
53 Requires(preun):        /sbin/chkconfig
54 Requires(preun):        /sbin/service
55 Requires:       %{name} = %{version}-%{release}
56
57 %description gmetad
58 Ganglia is a scalable, real-time monitoring and execution environment
59 with all execution requests and statistics expressed in an open
60 well-defined XML format.
61
62 This gmetad daemon aggregates monitoring data from several clusters to
63 form a monitoring grid. It also keeps metric history using rrdtool.
64
65 %package gmond
66 Summary:        Ganglia Monitoring daemon
67 Group:          Applications/Networking
68 Requires(post): /sbin/chkconfig
69 Requires(preun):        /sbin/chkconfig
70 Requires(preun):        /sbin/service
71 Requires:       %{name} = %{version}-%{release}
72
73 %description gmond
74 Ganglia is a scalable, real-time monitoring and execution environment
75 with all execution requests and statistics expressed in an open
76 well-defined XML format.
77
78 This gmond daemon provides the ganglia service within a single cluster
79 or Multicast domain.
80
81 %package gmond-python
82 Summary:        Ganglia Monitor daemon python DSO and metric modules
83 Group:          Applications/Networking
84 Requires:       ganglia-gmond
85 Requires:       python
86
87 %description gmond-python
88 Ganglia is a scalable, real-time monitoring and execution environment
89 with all execution requests and statistics expressed in an open
90 well-defined XML format.
91
92 This package provides the gmond python DSO and python gmond modules,
93 which can be loaded via the DSO at gmond daemon start time.
94
95 %package devel
96 Summary:        Ganglia Library
97 Group:          Applications/Networking
98 Requires:       %{name} = %{version}-%{release}
99
100 %description devel
101 The Ganglia Monitoring Core library provides a set of functions that
102 programmers can use to build scalable cluster or grid applications
103
104 %prep
105 %setup -q
106 %patch0 -p0
107 ## Hey, those shouldn't be executable...
108 chmod -x lib/*.{h,x}
109
110 cat << 'EOF' > apache.conf
111 #
112 # Ganglia monitoring system PHP web frontend
113 #
114
115 Alias /%{name} %{_datadir}/%{name}
116 <Location /%{name}>
117         Order deny,allow
118         Deny from all
119         Allow from 127.0.0.1
120         Allow from ::1
121         # Allow from .example.com
122 </Location>
123 EOF
124
125 %build
126 %configure \
127         --with-gmetad \
128         --disable-static \
129         --enable-shared
130
131 ## Default to run as user ganglia instead of nobody
132 %{__perl} -pi.orig -e 's|nobody|ganglia|g' \
133         lib/libgmond.c gmetad/conf.c gmond/g25_config.c \
134         gmetad/gmetad.conf gmond/gmond.conf.html ganglia.html \
135         gmond/conf.pod ganglia.pod README lib/default_conf.h
136
137 ## Don't have initscripts turn daemons on by default
138 %{__perl} -pi.orig -e 's|2345|-|g' \
139         gmond/gmond.init gmetad/gmetad.init
140
141 %{__make}
142
143 %install
144 rm -rf $RPM_BUILD_ROOT
145
146 ## Put web files in place
147 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
148 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
149 cp -a web/* $RPM_BUILD_ROOT%{_datadir}/%{name}
150 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/conf.php $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.php
151 ln -s ../../..%{_sysconfdir}/%{name}/conf.php \
152     $RPM_BUILD_ROOT%{_datadir}/%{name}/conf.php
153 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/private_clusters $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
154 ln -s ../../..%{_sysconfdir}/%{name}/private_clusters \
155     $RPM_BUILD_ROOT%{_datadir}/%{name}/private_clusters
156 install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
157 cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
158 cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
159
160 ## Create directory structures
161 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
162 install -d $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d
163 install -d $RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules
164 install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/rrds
165 install -d $RPM_BUILD_ROOT%{_mandir}/man1
166 install -d $RPM_BUILD_ROOT%{_mandir}/man5
167 ## Put files in place
168 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gmond
169 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/gmetad
170 cp -p gmond/gmond.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/gmond.conf.5
171 cp -p gmetad/gmetad.conf.in $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/gmetad.conf
172 cp -p mans/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
173 ## Build default gmond.conf from gmond using the '-t' flag
174 gmond/gmond -t | %{__perl} -pe 's|nobody|ganglia|g' > $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/gmond.conf
175
176 ## Python bits
177 # Copy the python metric modules and .conf files
178 cp -p gmond/python_modules/conf.d/*.pyconf $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d
179 cp -p gmond/modules/conf.d/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d
180 cp -p gmond/python_modules/*/*.py $RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules
181 # Don't install the example modules
182 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d/example.conf
183 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d/example.pyconf
184 # Don't install the status modules
185 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d/modgstatus.conf
186 # Clean up the .conf.in files
187 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d/*.conf.in
188 ## Disable the diskusage module until it is configured properly
189 #mv $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d/diskusage.pyconf $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d/diskusage.pyconf.off
190
191 ## Install binaries
192 %{__make} install \
193         DESTDIR=$RPM_BUILD_ROOT
194 ## House cleaning
195 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
196 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/{Makefile.am,version.php.in}
197
198 %clean
199 rm -rf $RPM_BUILD_ROOT
200
201 %pre
202 /sbin/ldconfig
203 %groupadd -g 206 ganglia
204 %useradd -u 206 -c "Ganglia Monitoring System" -s /sbin/nologin -g ganglia -r -d %{_localstatedir}/lib/%{name} ganglia
205
206 %post -p /sbin/ldconfig
207
208 %post gmond
209 /sbin/chkconfig --add gmond
210
211 %post gmetad
212 /sbin/chkconfig --add gmetad
213
214 %preun gmetad
215 if [ "$1" = 0 ]; then
216         %service gmetad stop
217         /sbin/chkconfig --del gmetad
218 fi
219
220 %preun gmond
221 if [ "$1" = 0 ]; then
222         %service gmond stop
223         /sbin/chkconfig --del gmond
224 fi
225
226 %post   devel -p /sbin/ldconfig
227 %postun devel -p /sbin/ldconfig
228
229 %triggerin web -- apache1 < 1.3.37-3, apache1-base
230 %webapp_register apache %{_webapp}
231
232 %triggerun web -- apache1 < 1.3.37-3, apache1-base
233 %webapp_unregister apache %{_webapp}
234
235 %triggerin web -- apache < 2.2.0, apache-base
236 %webapp_register httpd %{_webapp}
237
238 %triggerun web -- apache < 2.2.0, apache-base
239 %webapp_unregister httpd %{_webapp}
240
241 %files
242 %defattr(644,root,root,755)
243 %doc AUTHORS COPYING NEWS README ChangeLog
244 %attr(755,root,root) %{_libdir}/libganglia-%{version}.so.*.*.*
245 %attr(755,root,root) %ghost %{_libdir}/libganglia-%{version}.so.0
246 %dir %{_libdir}/ganglia
247 %{_libdir}/ganglia/*.so
248 %exclude %{_libdir}/ganglia/modpython.so
249
250 %files gmetad
251 %defattr(644,root,root,755)
252 %dir %{_localstatedir}/lib/%{name}
253 %attr(755,ganglia,ganglia) %{_localstatedir}/lib/%{name}/rrds
254 %attr(755,root,root) %{_sbindir}/gmetad
255 %{_mandir}/man1/gmetad.1*
256 %attr(754,root,root) /etc/rc.d/init.d/gmetad
257 %dir %{_sysconfdir}/ganglia
258 %config(noreplace) %{_sysconfdir}/ganglia/gmetad.conf
259
260 %files gmond
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{_bindir}/gmetric
263 %attr(755,root,root) %{_bindir}/gstat
264 %attr(755,root,root) %{_sbindir}/gmond
265 %attr(754,root,root) /etc/rc.d/init.d/gmond
266 %{_mandir}/man5/gmond.conf.5*
267 %{_mandir}/man1/gmond.1*
268 %{_mandir}/man1/gstat.1*
269 %{_mandir}/man1/gmetric.1*
270 %dir %{_sysconfdir}/ganglia
271 %dir %{_sysconfdir}/ganglia/conf.d
272 %config(noreplace) %{_sysconfdir}/ganglia/gmond.conf
273 %config(noreplace) %{_sysconfdir}/ganglia/conf.d/*.conf
274 %exclude %{_sysconfdir}/ganglia/conf.d/modpython.conf
275
276 %files gmond-python
277 %defattr(644,root,root,755)
278 %dir %{_libdir}/ganglia/python_modules
279 %{_libdir}/ganglia/python_modules/*.py*
280 %attr(755,root,root) %{_libdir}/ganglia/modpython.so*
281 %config(noreplace) %{_sysconfdir}/ganglia/conf.d/*.pyconf*
282 %config(noreplace) %{_sysconfdir}/ganglia/conf.d/modpython.conf
283
284 %files devel
285 %defattr(644,root,root,755)
286 %attr(755,root,root) %{_bindir}/ganglia-config
287 %{_includedir}/*.h
288 %{_libdir}/libganglia.so
289
290 %files web
291 %defattr(644,root,root,755)
292 %doc web/AUTHORS web/COPYING
293 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
294 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
295 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
296 %config(noreplace) %{_sysconfdir}/%{name}/conf.php
297 %config(noreplace) %{_sysconfdir}/%{name}/private_clusters
298 %{_datadir}/%{name}
This page took 0.125408 seconds and 3 git commands to generate.