]> git.pld-linux.org Git - packages/ganglia.git/blame - ganglia.spec
No empty pidfile/config.
[packages/ganglia.git] / ganglia.spec
CommitLineData
1849544f
ER
1# TODO
2# - unpackaged
3# /etc/conf.d/modpython.conf
4# /etc/gmetad.conf
b8f9622c
ER
5Summary: Ganglia Distributed Monitoring System
6Name: ganglia
1849544f
ER
7Version: 3.1.7
8Release: 0.1
b8f9622c
ER
9License: BSD
10Group: Applications/Networking
1849544f 11URL: http://www.ganglia.info/
b8f9622c 12Source0: http://dl.sourceforge.net/ganglia/%{name}-%{version}.tar.gz
1849544f 13# Source0-md5: 6aa5e2109c2cc8007a6def0799cf1b4c
9971739d
ER
14Source1: %{name}-gmond.init
15Source2: %{name}-gmetad.init
b8f9622c
ER
16Patch0: %{name}-diskusage-fix.patch
17BuildRequires: apr-devel
18BuildRequires: expat-devel
19BuildRequires: freetype-devel
20BuildRequires: libart_lgpl-devel
21BuildRequires: libconfuse-devel
22BuildRequires: libpng-devel
23BuildRequires: python-devel
24BuildRequires: rrdtool-devel
25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27%define _webapps /etc/webapps
28%define _webapp %{name}
29
30%description
31Ganglia is a scalable, real-time monitoring and execution environment
32with all execution requests and statistics expressed in an open
33well-defined XML format.
34
35%package web
36Summary: Ganglia Web Frontend
37Group: Applications/Networking
38Requires: %{name}-gmetad = %{version}-%{release}
39Requires: php-gd
40Requires: rrdtool
41Requires: webserver(php)
42
43%description web
44This package provides a web frontend to display the XML tree published
45by ganglia, and to provide historical graphs of collected metrics.
46
47This website is written in the PHP4 language.
48
49%package gmetad
50Summary: Ganglia Metadata collection daemon
51Group: Applications/Networking
52Requires(post): /sbin/chkconfig
53Requires(preun): /sbin/chkconfig
54Requires(preun): /sbin/service
55Requires: %{name} = %{version}-%{release}
56
57%description gmetad
58Ganglia is a scalable, real-time monitoring and execution environment
59with all execution requests and statistics expressed in an open
60well-defined XML format.
61
62This gmetad daemon aggregates monitoring data from several clusters to
63form a monitoring grid. It also keeps metric history using rrdtool.
64
65%package gmond
66Summary: Ganglia Monitoring daemon
67Group: Applications/Networking
68Requires(post): /sbin/chkconfig
69Requires(preun): /sbin/chkconfig
70Requires(preun): /sbin/service
71Requires: %{name} = %{version}-%{release}
72
73%description gmond
74Ganglia is a scalable, real-time monitoring and execution environment
75with all execution requests and statistics expressed in an open
76well-defined XML format.
77
78This gmond daemon provides the ganglia service within a single cluster
79or Multicast domain.
80
81%package gmond-python
82Summary: Ganglia Monitor daemon python DSO and metric modules
83Group: Applications/Networking
84Requires: ganglia-gmond
85Requires: python
86
87%description gmond-python
88Ganglia is a scalable, real-time monitoring and execution environment
89with all execution requests and statistics expressed in an open
90well-defined XML format.
91
92This package provides the gmond python DSO and python gmond modules,
93which can be loaded via the DSO at gmond daemon start time.
94
95%package devel
96Summary: Ganglia Library
97Group: Applications/Networking
98Requires: %{name} = %{version}-%{release}
99
100%description devel
101The Ganglia Monitoring Core library provides a set of functions that
102programmers 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...
108chmod -x lib/*.{h,x}
109
1849544f
ER
110cat << 'EOF' > apache.conf
111#
112# Ganglia monitoring system PHP web frontend
113#
114
115Alias /%{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>
123EOF
b8f9622c
ER
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
144rm -rf $RPM_BUILD_ROOT
145
146## Put web files in place
147install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
148install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
149cp -a web/* $RPM_BUILD_ROOT%{_datadir}/%{name}
1849544f 150mv $RPM_BUILD_ROOT%{_datadir}/%{name}/conf.php $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.php
b8f9622c
ER
151ln -s ../../..%{_sysconfdir}/%{name}/conf.php \
152 $RPM_BUILD_ROOT%{_datadir}/%{name}/conf.php
1849544f 153mv $RPM_BUILD_ROOT%{_datadir}/%{name}/private_clusters $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
b8f9622c
ER
154ln -s ../../..%{_sysconfdir}/%{name}/private_clusters \
155 $RPM_BUILD_ROOT%{_datadir}/%{name}/private_clusters
156install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
b8f9622c
ER
157cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
158cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
159
160## Create directory structures
161install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
162install -d $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d
163install -d $RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules
164install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/rrds
165install -d $RPM_BUILD_ROOT%{_mandir}/man1
166install -d $RPM_BUILD_ROOT%{_mandir}/man5
167## Put files in place
9971739d
ER
168install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gmond
169install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/gmetad
b8f9622c 170cp -p gmond/gmond.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/gmond.conf.5
1849544f
ER
171cp -p gmetad/gmetad.conf.in $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/gmetad.conf
172cp -p mans/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
b8f9622c
ER
173## Build default gmond.conf from gmond using the '-t' flag
174gmond/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
1849544f
ER
178cp -p gmond/python_modules/conf.d/*.pyconf $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d
179cp -p gmond/modules/conf.d/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d
180cp -p gmond/python_modules/*/*.py $RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules
b8f9622c
ER
181# Don't install the example modules
182rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d/example.conf
183rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d/example.pyconf
184# Don't install the status modules
185rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ganglia/conf.d/modgstatus.conf
186# Clean up the .conf.in files
187rm -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
195rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
196rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/{Makefile.am,version.php.in}
197
198%clean
199rm -rf $RPM_BUILD_ROOT
200
201%pre
1849544f 202/sbin/ldconfig
b8f9622c
ER
203%groupadd -g 206 ganglia
204%useradd -u 206 -c "Ganglia Monitoring System" -s /sbin/nologin -g ganglia -r -d %{_localstatedir}/lib/%{name} ganglia
b8f9622c
ER
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
215if [ "$1" = 0 ]; then
216 %service gmetad stop
217 /sbin/chkconfig --del gmetad
218fi
219
220%preun gmond
221if [ "$1" = 0 ]; then
222 %service gmond stop
223 /sbin/chkconfig --del gmond
224fi
225
1849544f
ER
226%post devel -p /sbin/ldconfig
227%postun devel -p /sbin/ldconfig
b8f9622c
ER
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
1849544f
ER
244%attr(755,root,root) %{_libdir}/libganglia-%{version}.so.*.*.*
245%attr(755,root,root) %ghost %{_libdir}/libganglia-%{version}.so.0
b8f9622c
ER
246%dir %{_libdir}/ganglia
247%{_libdir}/ganglia/*.so
248%exclude %{_libdir}/ganglia/modpython.so
b8f9622c
ER
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)
1849544f 278%dir %{_libdir}/ganglia/python_modules
b8f9622c
ER
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)
9971739d 286%attr(755,root,root) %{_bindir}/ganglia-config
b8f9622c 287%{_includedir}/*.h
1849544f 288%{_libdir}/libganglia.so
b8f9622c
ER
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.099248 seconds and 4 git commands to generate.