]> git.pld-linux.org Git - packages/collectd.git/blob - collectd.spec
426e5152d348f2940eb9e00ff6a28465d8f304af
[packages/collectd.git] / collectd.spec
1 # TODO:
2 # - lm_sensors subpackage
3 # - package contrib scripts as %doc
4 # - put every plugin into subpackages
5 # - Current plugins status:
6 #    apache  . . . . . . yes
7 #    apcups  . . . . . . yes
8 #    apple_sensors . . . no
9 #    ascent  . . . . . . yes
10 #    battery . . . . . . yes
11 #    cpu . . . . . . . . yes
12 #    cpufreq . . . . . . yes
13 #    csv . . . . . . . . yes
14 #    df  . . . . . . . . yes
15 #    disk  . . . . . . . yes
16 #    dns . . . . . . . . yes
17 #    email . . . . . . . yes
18 #    entropy . . . . . . yes
19 #    exec  . . . . . . . yes
20 #    hddtemp . . . . . . yes
21 #    interface . . . . . yes
22 #    iptables  . . . . . yes
23 #    ipmi  . . . . . . . no
24 #    ipvs  . . . . . . . no (ip_vs.h not found)
25 #    irq . . . . . . . . yes
26 #    libvirt . . . . . . no
27 #    load  . . . . . . . yes
28 #    logfile . . . . . . yes
29 #    mbmon . . . . . . . yes
30 #    memcached . . . . . yes
31 #    memory  . . . . . . yes
32 #    multimeter  . . . . yes
33 #    mysql . . . . . . . yes
34 #    netlink . . . . . . yes
35 #    network . . . . . . yes
36 #    nfs . . . . . . . . yes
37 #    nginx . . . . . . . yes
38 #    ntpd  . . . . . . . yes
39 #    nut . . . . . . . . no
40 #    perl  . . . . . . . no (needs libperl)
41 #    ping  . . . . . . . yes
42 #    powerdns  . . . . . yes
43 #    processes . . . . . yes
44 #    rrdtool . . . . . . yes
45 #    sensors . . . . . . yes
46 #    serial  . . . . . . yes
47 #    snmp  . . . . . . . yes
48 #    swap  . . . . . . . yes
49 #    syslog  . . . . . . yes
50 #    tail  . . . . . . . yes
51 #    tape  . . . . . . . no
52 #    tcpconns  . . . . . yes
53 #    teamspeak2  . . . . yes
54 #    unixsock  . . . . . yes
55 #    users . . . . . . . yes
56 #    uuid  . . . . . . . yes
57 #    vmem  . . . . . . . yes
58 #    vserver . . . . . . yes
59 #    wireless  . . . . . yes
60 #    xmms  . . . . . . . yes
61 %bcond_without  dns
62 %bcond_without  iptables
63 %bcond_without  netlink
64
65 #http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=358637
66 %ifarch %{x8664}
67 %undefine with_iptables
68 %undefine with_netlink
69 %endif
70 Summary:        Collects system information in RRD files
71 Summary(pl.UTF-8):      Zbieranie informacji o systemie w plikach RRD
72 Name:           collectd
73 Version:        4.4.2
74 Release:        2
75 License:        GPL v2
76 Group:          Daemons
77 Source0:        http://collectd.org/files/%{name}-%{version}.tar.gz
78 # Source0-md5:  dbffe35a2d19840e86253c7052485ff0
79 Source1:        %{name}.conf
80 Source2:        %{name}.init
81 Source3:        %{name}-http.conf
82 URL:            http://collectd.org/
83 BuildRequires:  OpenIPMI-devel
84 BuildRequires:  autoconf
85 BuildRequires:  automake
86 BuildRequires:  curl-devel
87 BuildRequires:  iptables-devel
88 BuildRequires:  libnetlink-devel
89 BuildRequires:  liboping-devel
90 BuildRequires:  libpcap-devel
91 BuildRequires:  libstatgrab-devel >= 0.12
92 BuildRequires:  libtool
93 BuildRequires:  lm_sensors-devel
94 BuildRequires:  mysql-devel
95 BuildRequires:  perl-devel
96 BuildRequires:  rpmbuild(macros) >= 1.268
97 BuildRequires:  rrdtool-devel
98 BuildRequires:  net-snmp-devel
99 BuildRequires:  xmms-devel
100 Requires(post,preun):   /sbin/chkconfig
101 Requires:       rc-scripts
102 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
103
104 %define         _pkglibdir      /var/lib/%{name}
105 %define         _webapps        /etc/webapps 
106 %define         _webapp         %{name}
107 %define         _webappdir      %{_webapps}/%{_webapp}
108 %define         _appdir         %{_datadir}/%{_webapp}
109
110 %description
111 collectd is a small daemon which collects system information every 10
112 seconds and writes the results in an RRD-file.
113
114 In contrast to most similar software, collectd is not a script but
115 written in plain C for performance and portability. As a daemon it
116 stays in memory, so there is no need to start up a heavy interpreter
117 every time new values should be logged. This allows collectd to have a
118 10 second resolution while being nice to the system.
119
120 %description -l pl.UTF-8
121 collectd to mały demon zbierający co 10 sekund informacje o systemie i
122 zapisujący wyniki do pliku RRD.
123
124 W odróżnieniu od innych podobnych programów collectd nie jest
125 skryptem, lecz jest napisany w czystym C z myślą o wydajności i
126 przenośności. Jako demon pozostaje w pamięci, więc nie ma potrzeby
127 urychamiania ciężkiego interpretera za każdym razem, kiedy powinny być
128 zapisane nowe wartości. Dzięki temu collect może mieć rozdzielczość 10
129 sekund i nie obciążać zbytnio systemu.
130
131 %package ascent
132 Summary:        ascent-plugin for collectd
133 Summary(pl_PL.UTF-8):   Wtyczka ascent dla collectd
134 Group:          Daemons
135 Requires:       %{name} = %{version}-%{release}
136
137 %description ascent
138 ascent plugin for collectd.
139
140 %package apache
141 Summary:        apache-plugin for collectd
142 Summary(pl_PL.UTF-8):   Wtyczka apache dla collectd
143 Group:          Daemons
144 Requires:       %{name} = %{version}-%{release}
145
146 %description apache
147 This plugin collectd data provided by Apache's `mod_status'.
148
149 %description apache -l pl.UTF-8
150 Wtyczka collectd zbierająca informacje udostępniane przez moduł
151 'mod_status' Apacha.
152
153 %package collection
154 Summary:        Web script for collectiond
155 Summary(pl_PL.UTF-8):   Web script for collectiond
156 Group:          Applications/WWW
157 Requires:       %{name} = %{version}-%{release}
158
159 %description collection
160 Web script for collectiond
161
162 %package dns
163 Summary:        dns-plugin for collectd
164 Summary(pl_PL.UTF-8):   Wtyczka dns dla collectd
165 Group:          Daemons
166 Requires:       %{name} = %{version}-%{release}
167 Requires:       perl-rrdtool
168
169 %description dns
170 dns plugin for collectd.
171
172 %package hddtemp
173 Summary:        hddtemp-plugin for collectd
174 Summary(pl_PL.UTF-8):   Wtyczka hddtemp dla collectd
175 Group:          Daemons
176 Requires:       %{name} = %{version}-%{release}
177
178 %description hddtemp
179 hddtemp plugin for collectd.
180
181 %package mysql
182 Summary:        mysql-plugin for collectd
183 Summary(pl_PL.UTF-8):   Moduł mysql dla collectd.
184 Group:          Daemons
185 Requires:       %{name} = %{version}-%{release}
186
187 %description mysql
188 MySQL querying plugin. This plugins provides data of issued commands,
189 called handlers and database traffic.
190
191 %description mysql -l pl.UTF-8
192 Moduł odpytujący MySQL. Wtyczka udostępnia dane o wydawanych
193 poleceniach, wywoływanych procedurach obsługi i ruchu bazodanowym.
194
195 %package nginx
196 Summary:        nginx-plugin for collectd
197 Summary(pl_PL.UTF-8):   Wtyczka nginx dla collectd
198 Group:          Daemons
199 Requires:       %{name} = %{version}-%{release}
200
201 %description nginx
202 nginx plugin for collectd.
203
204 %package ping
205 Summary:        ping-plugin for collectd
206 Summary(pl_PL.UTF-8):   Wtyczka ping dla collectd
207 Group:          Daemons
208 Requires:       %{name} = %{version}-%{release}
209
210 %description ping
211 ping plugin for collectd.
212
213 %package powerdns
214 Summary:        powerdns-plugin for collectd
215 Summary(pl_PL.UTF-8):   Wtyczka powerdns dla collectd
216 Group:          Daemons
217 Requires:       %{name} = %{version}-%{release}
218
219 %description powerdns
220 powerdns plugin for collectd.
221
222 %package rrdtool
223 Summary:        rrdtool-plugin for collectd
224 Summary(pl_PL.UTF-8):   Wtyczka rrdtool dla collectd
225 Group:          Daemons
226 Requires:       %{name} = %{version}-%{release}
227 Requires:       rrdtool
228
229 %description rrdtool
230 RRDTOOL plugin for collectd.
231
232 %package sensors
233 Summary:        sensors-plugin for collectd
234 Summary(pl_PL.UTF-8):   Wtyczka sensors dla collectd
235 Group:          Daemons
236 Requires:       %{name} = %{version}-%{release}
237
238 %description sensors
239 This plugin collectd data provided by hardware sensors.
240
241 %package snmp
242 Summary:        snmp-plugin for collectd
243 Summary(pl_PL.UTF-8):   Wtyczka snmp dla collectd
244 Group:          Daemons
245 Requires:       %{name} = %{version}-%{release}
246
247 %description snmp
248 snmp plugin for collectd.
249
250 %package uuid
251 Summary:        uuid-plugin for collectd
252 Summary(pl_PL.UTF-8):   Wtyczka uuid dla collectd
253 Group:          Daemons
254 Requires:       %{name} = %{version}-%{release}
255
256 %description uuid
257 This plugin collectd UUID data.
258
259 %package xmms
260 Summary:        xmms-plugin for collectd
261 Summary(pl_PL.UTF-8):   Wtyczka xmms dla collectd
262 Group:          Daemons
263 Requires:       %{name} = %{version}-%{release}
264 Requires:       xmms-libs
265
266 %description xmms
267 This plugin collectd data provided by XMMS.
268
269 %prep
270 %setup -q
271
272 cat >> collection.conf <<'EOF'
273 datadir: "/var/lib/collectd/"
274 libdir: "/usr/lib/collectd/"
275 EOF
276
277 %build
278 %{__libtoolize}
279 %{__aclocal}
280 %{__autoconf}
281 %{__autoheader}
282 %{__automake}
283
284 %configure \
285         --with-libstatgrab=/usr \
286         --with-lm-sensors=/usr \
287         --with-libmysql=/usr \
288         --%{?with_dns:en}%{?!with_dns:dis}able-dns \
289         --%{?with_iptables:en}%{?!with_iptables:dis}able-iptables \
290         --%{?with_netlink:en}%{?!with_netlink:dis}able-netlink
291
292
293 %{__make} LDFLAGS="%{rpmldflags} -lstatgrab"
294
295 %install
296 rm -rf $RPM_BUILD_ROOT
297 install -d $RPM_BUILD_ROOT{%{_var}/{log/,lib/%{name}},/etc/rc.d/init.d/} \
298         $RPM_BUILD_ROOT{%{_appdir}/cgi-bin,%{_webappdir},%{_pkglibdir}}
299
300 %{__make} install \
301         DESTDIR=$RPM_BUILD_ROOT
302
303 #install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/collectd.conf
304 touch $RPM_BUILD_ROOT%{_var}/log/collectd.log
305 install src/collectd.conf $RPM_BUILD_ROOT%{_sysconfdir}/collectd.conf
306 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
307
308 # Web frontend:
309 install contrib/collection.conf $RPM_BUILD_ROOT%{_webappdir}
310 install contrib/collection.cgi $RPM_BUILD_ROOT%{_appdir}/cgi-bin
311 install %{SOURCE3} $RPM_BUILD_ROOT%{_webappdir}/apache.conf
312 install %{SOURCE3} $RPM_BUILD_ROOT%{_webappdir}/httpd.conf
313
314 # Cleanups:
315 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
316
317 %clean
318 rm -rf $RPM_BUILD_ROOT
319
320 %post
321 /sbin/chkconfig --add %{name}
322 %service %{name} restart
323
324 %preun
325 if [ "$1" = "0" ]; then
326         %service -q %{name} stop
327         /sbin/chkconfig --del %{name}
328 fi
329
330 %triggerin collection -- apache1 < 1.3.37-3, apache1-base
331 %webapp_register apache %{_webapp}
332
333 %triggerun collection -- apache1 < 1.3.37-3, apache1-base
334 %webapp_unregister apache %{_webapp}
335
336 %triggerin collection -- apache < 2.2.0, apache-base
337 %webapp_register httpd %{_webapp}
338
339 %triggerun collection -- apache < 2.2.0, apache-base
340 %webapp_unregister httpd %{_webapp}
341
342 %files
343 %defattr(644,root,root,755)
344 %doc AUTHORS ChangeLog README TODO contrib
345
346 %attr(755,root,root) %{_sbindir}/collectd
347 %attr(755,root,root) %{_sbindir}/collectdmon
348 %attr(755,root,root) %{_bindir}/collectd-nagios
349 %dir %{_libdir}/%{name}
350 %attr(755,root,root) %{_libdir}/%{name}/apcups.so
351 #%attr(755,root,root) %{_libdir}/%{name}/apple_sensors.so
352 %attr(755,root,root) %{_libdir}/%{name}/battery.so
353 %attr(755,root,root) %{_libdir}/%{name}/cpufreq.so
354 %attr(755,root,root) %{_libdir}/%{name}/cpu.so
355 %attr(755,root,root) %{_libdir}/%{name}/csv.so
356 %attr(755,root,root) %{_libdir}/%{name}/df.so
357 %attr(755,root,root) %{_libdir}/%{name}/disk.so
358 %attr(755,root,root) %{_libdir}/%{name}/email.so
359 %attr(755,root,root) %{_libdir}/%{name}/entropy.so
360 %attr(755,root,root) %{_libdir}/%{name}/exec.so
361 %attr(755,root,root) %{_libdir}/%{name}/interface.so
362 %if %{with iptables}
363 %attr(755,root,root) %{_libdir}/%{name}/iptables.so
364 %endif
365 %attr(755,root,root) %{_libdir}/%{name}/irq.so
366 %attr(755,root,root) %{_libdir}/%{name}/load.so
367 %attr(755,root,root) %{_libdir}/%{name}/logfile.so
368 %attr(755,root,root) %{_libdir}/%{name}/mbmon.so
369 %attr(755,root,root) %{_libdir}/%{name}/memcached.so
370 %attr(755,root,root) %{_libdir}/%{name}/memory.so
371 %attr(755,root,root) %{_libdir}/%{name}/multimeter.so
372 %if %{with netlink}
373 %attr(755,root,root) %{_libdir}/%{name}/netlink.so
374 %endif
375 %attr(755,root,root) %{_libdir}/%{name}/network.so
376 %attr(755,root,root) %{_libdir}/%{name}/nfs.so
377 %attr(755,root,root) %{_libdir}/%{name}/ntpd.so
378 #%attr(755,root,root) %{_libdir}/%{name}/perl.so
379 %attr(755,root,root) %{_libdir}/%{name}/processes.so
380 %attr(755,root,root) %{_libdir}/%{name}/serial.so
381 %attr(755,root,root) %{_libdir}/%{name}/swap.so
382 %attr(755,root,root) %{_libdir}/%{name}/syslog.so
383 %attr(755,root,root) %{_libdir}/%{name}/tail.so
384 #%attr(755,root,root) %{_libdir}/%{name}/tape.so
385 %attr(755,root,root) %{_libdir}/%{name}/teamspeak2.so
386 %attr(755,root,root) %{_libdir}/%{name}/tcpconns.so
387 #%attr(755,root,root) %{_libdir}/%{name}/traffic.so
388 %attr(755,root,root) %{_libdir}/%{name}/unixsock.so
389 %attr(755,root,root) %{_libdir}/%{name}/users.so
390 %attr(755,root,root) %{_libdir}/%{name}/vmem.so
391 %attr(755,root,root) %{_libdir}/%{name}/vserver.so
392 %attr(755,root,root) %{_libdir}/%{name}/wireless.so
393 %{_libdir}/%{name}/types.db
394
395 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
396
397 %attr(754,root,root) /etc/rc.d/init.d/%{name}
398
399 %{_mandir}/man1/collectd.1*
400 %{_mandir}/man1/collectd-nagios.1*
401 %{_mandir}/man5/collectd.conf.5*
402 %{_mandir}/man5/collectd-email.5*
403 %{_mandir}/man5/collectd-exec.5*
404 %{_mandir}/man5/collectd-perl.5*
405 %{_mandir}/man5/collectd-snmp.5*
406 %{_mandir}/man5/collectd-unixsock.5*
407 %{_mandir}/man1/collectdmon.1*
408 %{_mandir}/man5/types.db.5*
409 %{_var}/log/collectd.log
410 %dir %{_var}/lib/%{name}
411
412 ########## PLUGINS:
413 %files ascent
414 %defattr(644,root,root,755)
415 %attr(755,root,root) %{_libdir}/%{name}/ascent.so
416
417 %files apache
418 %defattr(644,root,root,755)
419 %attr(755,root,root) %{_libdir}/%{name}/apache.so
420
421 %files collection
422 %defattr(644,root,root,755)
423 %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/collection.conf
424 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/apache.conf
425 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/httpd.conf
426 %attr(755,root,root) %{_appdir}/cgi-bin/collection.cgi
427
428 %files dns
429 %defattr(644,root,root,755)
430 %attr(755,root,root) %{_libdir}/%{name}/dns.so
431
432 %files hddtemp
433 %defattr(644,root,root,755)
434 %attr(755,root,root) %{_libdir}/%{name}/hddtemp.so
435
436 %files mysql
437 %defattr(644,root,root,755)
438 %attr(755,root,root) %{_libdir}/%{name}/mysql.so
439
440 %files nginx
441 %defattr(644,root,root,755)
442 %attr(755,root,root) %{_libdir}/%{name}/nginx.so
443
444 %files ping
445 %defattr(644,root,root,755)
446 %attr(755,root,root) %{_libdir}/%{name}/ping.so
447
448 %files powerdns
449 %defattr(644,root,root,755)
450 %attr(755,root,root) %{_libdir}/%{name}/powerdns.so
451
452 %files rrdtool
453 %defattr(644,root,root,755)
454 %attr(755,root,root) %{_libdir}/%{name}/rrdtool.so
455
456 %files sensors
457 %defattr(644,root,root,755)
458 %attr(755,root,root) %{_libdir}/%{name}/sensors.so
459
460 %files snmp
461 %defattr(644,root,root,755)
462 %attr(755,root,root) %{_libdir}/%{name}/snmp.so
463
464 %files uuid
465 %defattr(644,root,root,755)
466 %attr(755,root,root) %{_libdir}/%{name}/uuid.so
467
468 %files xmms
469 %defattr(644,root,root,755)
470 %attr(755,root,root) %{_libdir}/%{name}/xmms.so
This page took 0.070746 seconds and 3 git commands to generate.