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