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