Exec plugin: Update copyright header.
[collectd.git] / contrib / redhat / collectd.spec
1 Summary:        Statistics collection daemon for filling RRD files.
2 Name:           collectd
3 Version:        4.3.1
4 Release:        0.centos5
5 Source:         http://collectd.org/files/%{name}-%{version}.tar.gz
6 License:        GPL
7 Group:          System Environment/Daemons
8 BuildRoot:      %{_tmppath}/%{name}-%{version}-root
9 BuildPrereq:    lm_sensors-devel, mysql-devel, rrdtool-devel, curl-devel, libpcap-devel, net-snmp-devel, libstatgrab-devel, mysql-devel, libxml2-devel, libiptcdata-devel
10 Requires:       rrdtool, perl-Regexp-Common, libstatgrab
11 Packager:       RightScale <support@rightscale.com>
12 Vendor:         collectd development team <collectd@verplant.org>
13
14 %description
15 collectd is a small daemon which collects system information periodically and
16 provides mechanisms to monitor and store the values in a variety of ways. It
17 is written in C for performance. Since the daemon doesn't need to startup
18 every time it wants to update the values it's very fast and easy on the
19 system. Also, the statistics are very fine grained since the files are updated
20 every 10 seconds.
21
22 %package apache
23 Summary:        apache-plugin for collectd.
24 Group:          System Environment/Daemons
25 Requires:       collectd = %{version}, curl
26 %description apache
27 This plugin collects data provided by Apache's `mod_status'.
28
29 %package email
30 Summary:        email-plugin for collectd.
31 Group:          System Environment/Daemons
32 Requires:       collectd = %{version}, spamassassin
33 %description email
34 This plugin collects data provided by spamassassin.
35
36 %package mysql
37 Summary:        mysql-module for collectd.
38 Group:          System Environment/Daemons
39 Requires:       collectd = %{version}, mysql
40 %description mysql
41 MySQL querying plugin. This plugins provides data of issued commands, called
42 handlers and database traffic.
43
44 %package nginx
45 Summary:        nginx-plugin for collectd.
46 Group:          System Environment/Daemons
47 Requires:       collectd = %{version}, curl
48 %description nginx
49 This plugin gets data provided by nginx.
50
51 %package sensors
52 Summary:        libsensors-module for collectd.
53 Group:          System Environment/Daemons
54 Requires:       collectd = %{version}, lm_sensors
55 %description sensors
56 This plugin for collectd provides querying of sensors supported by lm_sensors.
57
58 %package snmp
59 Summary:        snmp-module for collectd.
60 Group:          System Environment/Daemons
61 Requires:       collectd = %{version}, net-snmp
62 %description snmp
63 This plugin for collectd allows querying of network equipment using SNMP.
64
65 %prep
66 rm -rf $RPM_BUILD_ROOT
67 %setup
68
69 %build
70 ./configure CFLAGS=-"DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL'" --prefix=%{_prefix} --sbindir=%{_sbindir} --mandir=%{_mandir} --libdir=%{_libdir} --sysconfdir=%{_sysconfdir} --enable-apache --enable-email --enable-mysql --enable-dns
71 make
72
73 %install
74 make install DESTDIR=$RPM_BUILD_ROOT
75 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
76 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin
77 cp contrib/redhat/init.d-collectd $RPM_BUILD_ROOT/etc/rc.d/init.d/collectd
78 cp contrib/collection.cgi $RPM_BUILD_ROOT/var/www/cgi-bin
79 mkdir -p $RPM_BUILD_ROOT/etc/collectd.d
80 mkdir -p $RPM_BUILD_ROOT/var/lib/collectd
81 ### Clean up docs
82 find contrib/ -type f -exec %{__chmod} a-x {} \;
83 ###Modify Config for Redhat Based Distros
84 cp contrib/redhat/collectd.conf $RPM_BUILD_ROOT/etc/collectd.conf
85 sed -i 's:#BaseDir     "/usr/var/lib/collectd":BaseDir     "/var/lib/collectd":' $RPM_BUILD_ROOT/etc/collectd.conf
86 sed -i 's:#PIDFile     "/usr/var/run/collectd.pid":PIDFile     "/var/run/collectd.pid":' $RPM_BUILD_ROOT/etc/collectd.conf
87 sed -i 's:#PluginDir   "/usr/lib/collectd":PluginDir   "/usr/lib/collectd":' $RPM_BUILD_ROOT/etc/collectd.conf
88 sed -i 's:#TypesDB     "/usr/share/collectd/types.db":TypesDB     "/usr/share/collectd/types.db":' $RPM_BUILD_ROOT/etc/collectd.conf
89 sed -i 's:#Interval     10:Interval     10:' $RPM_BUILD_ROOT/etc/collectd.conf
90 sed -i 's:#ReadThreads  5:ReadThreads  5:' $RPM_BUILD_ROOT/etc/collectd.conf
91 ##Move config contribs
92 cp contrib/redhat/apache.conf $RPM_BUILD_ROOT/etc/collectd.d/apache.conf
93 cp contrib/redhat/email.conf $RPM_BUILD_ROOT/etc/collectd.d/email.conf
94 cp contrib/redhat/sensors.conf $RPM_BUILD_ROOT/etc/collectd.d/sensors.conf
95 cp contrib/redhat/mysql.conf $RPM_BUILD_ROOT/etc/collectd.d/mysql.conf
96 cp contrib/redhat/nginx.conf $RPM_BUILD_ROOT/etc/collectd.d/nginx.conf
97 cp contrib/redhat/snmp.conf $RPM_BUILD_ROOT/etc/collectd.d/snmp.conf
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %post
103 /sbin/chkconfig --add collectd
104 /sbin/chkconfig collectd on
105
106 %preun
107 if [ "$1" = 0 ]; then
108    /sbin/chkconfig collectd off
109    /etc/init.d/collectd stop
110    /sbin/chkconfig --del collectd
111 fi
112 exit 0
113
114 %postun
115 if [ "$1" -ge 1 ]; then
116     /etc/init.d/collectd restart
117 fi
118 exit 0
119
120 %files
121 %defattr(-,root,root)
122 %doc AUTHORS COPYING ChangeLog INSTALL NEWS README contrib/
123 %attr(0644,root,root) %config(noreplace) /etc/collectd.conf
124 %attr(0755,root,root) /etc/rc.d/init.d/collectd
125 %attr(0755,root,root) /var/www/cgi-bin/collection.cgi
126 %attr(0755,root,root) %{_sbindir}/collectd
127 %attr(0755,root,root) %{_bindir}/collectd-nagios
128 %attr(0755,root,root) %{_sbindir}/collectdmon
129 %attr(0644,root,root) %{_mandir}/man1/*
130 %attr(0644,root,root) %{_mandir}/man5/*
131 %dir /etc/collectd.d
132
133 %attr(0644,root,root) %{_libdir}/%{name}/apcups.so*
134 %attr(0644,root,root) %{_libdir}/%{name}/apcups.la
135
136 #%attr(0644,root,root) %{_libdir}/%{name}/apple_sensors.so*
137 #%attr(0644,root,root) %{_libdir}/%{name}/apple_sensors.la
138
139 %attr(0644,root,root) %{_libdir}/%{name}/battery.so*
140 %attr(0644,root,root) %{_libdir}/%{name}/battery.la
141
142 %attr(0644,root,root) %{_libdir}/%{name}/conntrack.so*
143 %attr(0644,root,root) %{_libdir}/%{name}/conntrack.la
144
145 %attr(0644,root,root) %{_libdir}/%{name}/cpufreq.so*
146 %attr(0644,root,root) %{_libdir}/%{name}/cpufreq.la
147
148 %attr(0644,root,root) %{_libdir}/%{name}/cpu.so*
149 %attr(0644,root,root) %{_libdir}/%{name}/cpu.la
150
151 %attr(0644,root,root) %{_libdir}/%{name}/csv.so*
152 %attr(0644,root,root) %{_libdir}/%{name}/csv.la
153
154 %attr(0644,root,root) %{_libdir}/%{name}/df.so*
155 %attr(0644,root,root) %{_libdir}/%{name}/df.la
156
157 %attr(0644,root,root) %{_libdir}/%{name}/disk.so*
158 %attr(0644,root,root) %{_libdir}/%{name}/disk.la
159
160 %attr(0644,root,root) %{_libdir}/%{name}/dns.so*
161 %attr(0644,root,root) %{_libdir}/%{name}/dns.la
162
163 %attr(0644,root,root) %{_libdir}/%{name}/entropy.so*
164 %attr(0644,root,root) %{_libdir}/%{name}/entropy.la
165
166 %attr(0644,root,root) %{_libdir}/%{name}/exec.so*
167 %attr(0644,root,root) %{_libdir}/%{name}/exec.la
168
169 %attr(0644,root,root) %{_libdir}/%{name}/hddtemp.so*
170 %attr(0644,root,root) %{_libdir}/%{name}/hddtemp.la
171
172 %attr(0644,root,root) %{_libdir}/%{name}/interface.so*
173 %attr(0644,root,root) %{_libdir}/%{name}/interface.la
174
175 #%attr(0644,root,root) %{_libdir}/%{name}/iptables.so*
176 #%attr(0644,root,root) %{_libdir}/%{name}/iptables.la
177
178 %attr(0644,root,root) %{_libdir}/%{name}/irq.so*
179 %attr(0644,root,root) %{_libdir}/%{name}/irq.la
180
181 %attr(0644,root,root) %{_libdir}/%{name}/load.so*
182 %attr(0644,root,root) %{_libdir}/%{name}/load.la
183
184 %attr(0644,root,root) %{_libdir}/%{name}/logfile.so*
185 %attr(0644,root,root) %{_libdir}/%{name}/logfile.la
186
187 %attr(0644,root,root) %{_libdir}/%{name}/mbmon.so
188 %attr(0644,root,root) %{_libdir}/%{name}/mbmon.la
189
190 %attr(0644,root,root) %{_libdir}/%{name}/memcached.so*
191 %attr(0644,root,root) %{_libdir}/%{name}/memcached.la
192
193 %attr(0644,root,root) %{_libdir}/%{name}/memory.so*
194 %attr(0644,root,root) %{_libdir}/%{name}/memory.la
195
196 %attr(0644,root,root) %{_libdir}/%{name}/multimeter.so*
197 %attr(0644,root,root) %{_libdir}/%{name}/multimeter.la
198
199 %attr(0644,root,root) %{_libdir}/%{name}/network.so*
200 %attr(0644,root,root) %{_libdir}/%{name}/network.la
201
202 %attr(0644,root,root) %{_libdir}/%{name}/nfs.so*
203 %attr(0644,root,root) %{_libdir}/%{name}/nfs.la
204
205 %attr(0644,root,root) %{_libdir}/%{name}/ntpd.so*
206 %attr(0644,root,root) %{_libdir}/%{name}/ntpd.la
207
208 #%attr(0644,root,root) %{_libdir}/%{name}/nut.so*
209 #%attr(0644,root,root) %{_libdir}/%{name}/nut.la
210
211 %attr(0644,root,root) %{_libdir}/%{name}/perl.so*
212 %attr(0644,root,root) %{_libdir}/%{name}/perl.la
213
214 %attr(0644,root,root) %{_libdir}/%{name}/ping.so*
215 %attr(0644,root,root) %{_libdir}/%{name}/ping.la
216
217 %attr(0644,root,root) %{_libdir}/%{name}/processes.so*
218 %attr(0644,root,root) %{_libdir}/%{name}/processes.la
219
220 %attr(0644,root,root) %{_libdir}/%{name}/rrdtool.so*
221 %attr(0644,root,root) %{_libdir}/%{name}/rrdtool.la
222
223 %attr(0644,root,root) %{_libdir}/%{name}/serial.so*
224 %attr(0644,root,root) %{_libdir}/%{name}/serial.la
225
226 %attr(0644,root,root) %{_libdir}/%{name}/swap.so*
227 %attr(0644,root,root) %{_libdir}/%{name}/swap.la
228
229 %attr(0644,root,root) %{_libdir}/%{name}/syslog.so*
230 %attr(0644,root,root) %{_libdir}/%{name}/syslog.la
231
232 #%attr(0644,root,root) %{_libdir}/%{name}/tape.so*
233 #%attr(0644,root,root) %{_libdir}/%{name}/tape.la
234
235 %attr(0644,root,root) %{_libdir}/%{name}/tcpconns.so*
236 %attr(0644,root,root) %{_libdir}/%{name}/tcpconns.la
237
238 %attr(0644,root,root) %{_libdir}/%{name}/unixsock.so*
239 %attr(0644,root,root) %{_libdir}/%{name}/unixsock.la
240
241 %attr(0644,root,root) %{_libdir}/%{name}/users.so*
242 %attr(0644,root,root) %{_libdir}/%{name}/users.la
243
244 %attr(0644,root,root) %{_libdir}/%{name}/uuid.so*
245 %attr(0644,root,root) %{_libdir}/%{name}/uuid.la
246
247 %attr(0644,root,root) %{_libdir}/%{name}/vserver.so*
248 %attr(0644,root,root) %{_libdir}/%{name}/vserver.la
249
250 %attr(0644,root,root) %{_libdir}/%{name}/wireless.so*
251 %attr(0644,root,root) %{_libdir}/%{name}/wireless.la
252
253 %attr(0644,root,root) %{_datadir}/%{name}/types.db
254
255 %exclude %{_libdir}/perl5/5.8.8/%{_arch}-linux-thread-multi/perllocal.pod
256 %attr(0644,root,root) %{_libdir}/perl5/site_perl/5.8.8/Collectd.pm
257 %attr(0644,root,root) %{_libdir}/perl5/site_perl/5.8.8/Collectd/Unixsock.pm
258 %attr(0644,root,root) %{_libdir}/perl5/site_perl/5.8.8/%{_arch}-linux-thread-multi/auto/Collectd/.packlist
259 %attr(0644,root,root) /usr/share/man/man3/Collectd::Unixsock.3pm.gz
260
261 %dir /var/lib/collectd
262
263 %files apache
264 %attr(0644,root,root) %{_libdir}/%{name}/apache.so*
265 %attr(0644,root,root) %{_libdir}/%{name}/apache.la
266 %attr(0644,root,root) /etc/collectd.d/apache.conf
267
268 %files email
269 %attr(0644,root,root) %{_libdir}/%{name}/email.so*
270 %attr(0644,root,root) %{_libdir}/%{name}/email.la
271 %attr(0644,root,root) /etc/collectd.d/email.conf
272
273 %files mysql
274 %attr(0644,root,root) %{_libdir}/%{name}/mysql.so*
275 %attr(0644,root,root) %{_libdir}/%{name}/mysql.la
276 %attr(0644,root,root) /etc/collectd.d/mysql.conf
277
278 %files nginx
279 %attr(0644,root,root) %{_libdir}/%{name}/nginx.so*
280 %attr(0644,root,root) %{_libdir}/%{name}/nginx.la
281 %attr(0644,root,root) /etc/collectd.d/nginx.conf
282
283 %files sensors
284 %attr(0644,root,root) %{_libdir}/%{name}/sensors.so*
285 %attr(0644,root,root) %{_libdir}/%{name}/sensors.la
286 %attr(0644,root,root) /etc/collectd.d/sensors.conf
287
288 %files snmp
289 %attr(0644,root,root) %{_libdir}/%{name}/snmp.so*
290 %attr(0644,root,root) %{_libdir}/%{name}/snmp.la
291 %attr(0644,root,root) /etc/collectd.d/snmp.conf
292
293 %changelog
294 * Mon Mar 17 2008 RightScale <support@rightscale.com> 4.3.1
295 - New upstream version
296 - Changes to support 4.3.1
297 - Added More Prereqs to support more plugins
298 - Added support for perl plugin
299
300 * Mon Aug 06 2007 Kjell Randa <Kjell.Randa@broadpark.no> 4.0.6
301 - New upstream version
302
303 * Wed Jul 25 2007 Kjell Randa <Kjell.Randa@broadpark.no> 4.0.5
304 - New major releas
305 - Changes to support 4.0.5 
306
307 * Wed Jan 11 2007 Iain Lea <iain@bricbrac.de> 3.11.0-0
308 - fixed spec file to build correctly on fedora core
309 - added improved init.d script to work with chkconfig
310 - added %post and %postun to call chkconfig automatically
311
312 * Sun Jul 09 2006 Florian octo Forster <octo@verplant.org> 3.10.0-1
313 - New upstream version
314
315 * Tue Jun 25 2006 Florian octo Forster <octo@verplant.org> 3.9.4-1
316 - New upstream version
317
318 * Tue Jun 01 2006 Florian octo Forster <octo@verplant.org> 3.9.3-1
319 - New upstream version
320
321 * Tue May 09 2006 Florian octo Forster <octo@verplant.org> 3.9.2-1
322 - New upstream version
323
324 * Tue May 09 2006 Florian octo Forster <octo@verplant.org> 3.8.5-1
325 - New upstream version
326
327 * Fri Apr 21 2006 Florian octo Forster <octo@verplant.org> 3.9.1-1
328 - New upstream version
329
330 * Fri Apr 14 2006 Florian octo Forster <octo@verplant.org> 3.9.0-1
331 - New upstream version
332 - Added the `apache' package.
333
334 * Thu Mar 14 2006 Florian octo Forster <octo@verplant.org> 3.8.2-1
335 - New upstream version
336
337 * Thu Mar 13 2006 Florian octo Forster <octo@verplant.org> 3.8.1-1
338 - New upstream version
339
340 * Thu Mar 09 2006 Florian octo Forster <octo@verplant.org> 3.8.0-1
341 - New upstream version
342
343 * Sat Feb 18 2006 Florian octo Forster <octo@verplant.org> 3.7.2-1
344 - Include `tape.so' so the build doesn't terminate because of missing files..
345 - New upstream version
346
347 * Sat Feb 04 2006 Florian octo Forster <octo@verplant.org> 3.7.1-1
348 - New upstream version
349
350 * Mon Jan 30 2006 Florian octo Forster <octo@verplant.org> 3.7.0-1
351 - New upstream version
352 - Removed the extra `hddtemp' package
353
354 * Tue Jan 24 2006 Florian octo Forster <octo@verplant.org> 3.6.2-1
355 - New upstream version
356
357 * Fri Jan 20 2006 Florian octo Forster <octo@verplant.org> 3.6.1-1
358 - New upstream version
359
360 * Fri Jan 20 2006 Florian octo Forster <octo@verplant.org> 3.6.0-1
361 - New upstream version
362 - Added config file, `collectd.conf(5)', `df.so'
363 - Added package `collectd-mysql', dependency on `mysqlclient10 | mysql'
364
365 * Wed Dec 07 2005 Florian octo Forster <octo@verplant.org> 3.5.0-1
366 - New upstream version
367
368 * Sat Nov 26 2005 Florian octo Forster <octo@verplant.org> 3.4.0-1
369 - New upstream version
370
371 * Sat Nov 05 2005 Florian octo Forster <octo@verplant.org> 3.3.0-1
372 - New upstream version
373
374 * Tue Oct 26 2005 Florian octo Forster <octo@verplant.org> 3.2.0-1
375 - New upstream version
376 - Added statement to remove the `*.la' files. This fixes a problem when
377   `Unpackaged files terminate build' is in effect.
378 - Added `processes.so*' to the main package
379
380 * Fri Oct 14 2005 Florian octo Forster <octo@verplant.org> 3.1.0-1
381 - New upstream version
382 - Added package `collectd-hddtemp'
383
384 * Fri Sep 30 2005 Florian octo Forster <octo@verplant.org> 3.0.0-1
385 - New upstream version
386 - Split the package into `collectd' and `collectd-sensors'
387
388 * Fri Sep 16 2005 Florian octo Forster <octo@verplant.org> 2.1.0-1
389 - New upstream version
390
391 * Mon Sep 10 2005 Florian octo Forster <octo@verplant.org> 2.0.0-1
392 - New upstream version
393
394 * Mon Aug 29 2005 Florian octo Forster <octo@verplant.org> 1.8.0-1
395 - New upstream version
396
397 * Sun Aug 25 2005 Florian octo Forster <octo@verplant.org> 1.7.0-1
398 - New upstream version
399
400 * Sun Aug 21 2005 Florian octo Forster <octo@verplant.org> 1.6.0-1
401 - New upstream version
402
403 * Sun Jul 17 2005 Florian octo Forster <octo@verplant.org> 1.5.1-1
404 - New upstream version
405
406 * Sun Jul 17 2005 Florian octo Forster <octo@verplant.org> 1.5-1
407 - New upstream version
408
409 * Mon Jul 11 2005 Florian octo Forster <octo@verplant.org> 1.4.2-1
410 - New upstream version
411
412 * Sat Jul 09 2005 Florian octo Forster <octo@verplant.org> 1.4-1
413 - Built on RedHat 7.3