1
+
2
+ %define with_java %(test -z "$JAVA_HOME" ; echo $?)
3
+
1
4
Summary: Statistics collection daemon for filling RRD files.
2
5
Name: collectd
3
- Version: 4.3.1
4
- Release: 0.centos5
6
+ Version: 4.9.0
7
+ Release: 1%{? dist }
5
8
Source: http://collectd.org/files/%{name }-%{version }.tar.gz
6
9
License: GPL
7
10
Group: System Environment/Daemons
8
11
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
12
+ BuildPrereq: lm_sensors-devel, rrdtool-devel, libpcap-devel, net-snmp-devel, libstatgrab-devel, libxml2-devel, libiptcdata-devel
13
+ # libcurl deps
14
+ BuildPrereq: curl-devel,libidn-devel,openssl-devel
10
15
Requires: rrdtool, perl-Regexp-Common, libstatgrab
11
16
Packager: RightScale
< [email protected] >
12
17
Vendor: collectd development team
< [email protected] >
@@ -19,6 +24,7 @@ every time it wants to update the values it's very fast and easy on the
19
24
system. Also, the statistics are very fine grained since the files are updated
20
25
every 10 seconds.
21
26
27
+
22
28
%package apache
23
29
Summary: apache-plugin for collectd.
24
30
Group: System Environment/Daemons
@@ -62,12 +68,25 @@ Requires: collectd = %{version}, net-snmp
62
68
%description snmp
63
69
This plugin for collectd allows querying of network equipment using SNMP.
64
70
71
+ %if %with_java
72
+ %package java
73
+ Summary: java-module for collectd.
74
+ Group: System Environment/Daemons
75
+ Requires: collectd = %{version }, jdk >= 1.6
76
+ BuildPrereq: jdk >= 1.6
77
+ %description java
78
+ This plugin for collectd allows plugins to be written in Java and executed
79
+ in an embedded JVM.
80
+ %endif
81
+
65
82
%prep
66
83
rm -rf $RPM_BUILD_ROOT
67
84
%setup
68
85
69
86
%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
87
+ ./configure CFLAGS=-" DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL'" --prefix=%{_prefix } --sbindir=%{_sbindir } --mandir=%{_mandir } --libdir=%{_libdir } --sysconfdir=%{_sysconfdir } \
88
+ %{! ? with_java:" --with-java=$JAVA_HOME --enable-java" } \
89
+ --disable-battery
71
90
make
72
91
73
92
%install
@@ -80,14 +99,17 @@ mkdir -p $RPM_BUILD_ROOT/etc/collectd.d
80
99
mkdir -p $RPM_BUILD_ROOT /var/lib/collectd
81
100
### Clean up docs
82
101
find contrib/ -type f -exec %{__chmod} a-x {} \;
102
+
83
103
###Modify Config for Redhat Based Distros
84
- cp contrib/redhat/collectd.conf $RPM_BUILD_ROOT /etc/collectd.conf
85
104
sed -i 's:#BaseDir "/usr/var/lib/collectd":BaseDir "/var/lib/collectd":' $RPM_BUILD_ROOT/etc/collectd.conf
86
105
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
106
+ sed -i 's:#PluginDir "/usr/lib/collectd":PluginDir "%{_libdir} /collectd":' $RPM_BUILD_ROOT/etc/collectd.conf
88
107
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
108
+ sed -i 's:#Interval 10:Interval 30 :' $RPM_BUILD_ROOT/etc/collectd.conf
90
109
sed -i 's:#ReadThreads 5:ReadThreads 5:' $RPM_BUILD_ROOT/etc/collectd.conf
110
+ ###Include broken out config directory
111
+ echo -e '\nInclude "/etc/collectd.d"' >> $RPM_BUILD_ROOT/etc/collectd.conf
112
+
91
113
##Move config contribs
92
114
cp contrib/redhat/apache.conf $RPM_BUILD_ROOT/etc/collectd.d/apache.conf
93
115
cp contrib/redhat/email.conf $RPM_BUILD_ROOT/etc/collectd.d/email.conf
@@ -120,7 +142,7 @@ exit 0
120
142
%files
121
143
%defattr(-,root,root)
122
144
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README contrib/
123
- %attr(0644,root,root) %config(noreplace ) /etc/collectd.conf
145
+ %config % attr(0644,root,root) /etc/collectd.conf
124
146
%attr(0755,root,root) /etc/rc.d/init.d/collectd
125
147
%attr(0755,root,root) /var/www/cgi-bin/collection.cgi
126
148
%attr(0755,root,root) %{_sbindir }/collectd
@@ -130,167 +152,142 @@ exit 0
130
152
%attr(0644,root,root) %{_mandir }/man5/*
131
153
%dir /etc/collectd.d
132
154
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
155
+ # client
156
+ %attr(0644,root,root) /usr/include/collectd/client.h
157
+ %attr(0644,root,root) /usr/include/collectd/lcc_features.h
158
+
159
+ %attr(0644,root,root) %{_libdir }/libcollectdclient.*
160
+ %attr(0644,root,root) %{_libdir }/pkgconfig/libcollectdclient.pc
161
+
162
+ # macro to grab binaries for a plugin, given a name
163
+ %define plugin_macro() \
164
+ %attr(0644,root,root) %{_libdir }/%{name }/%1.a \
165
+ %attr(0644,root,root) %{_libdir }/%{name }/%1.so* \
166
+ %attr(0644,root,root) %{_libdir }/%{name }/%1.la
167
+
168
+ %plugin_macro apcups
169
+ %plugin_macro ascent
170
+ %plugin_macro bind
171
+ %plugin_macro conntrack
172
+ %plugin_macro contextswitch
173
+ %plugin_macro cpufreq
174
+ %plugin_macro cpu
175
+ %plugin_macro csv
176
+ %plugin_macro curl
177
+ %plugin_macro df
178
+ %plugin_macro disk
179
+ %plugin_macro dns
180
+ %plugin_macro entropy
181
+ %plugin_macro email
182
+ %plugin_macro exec
183
+ %plugin_macro filecount
184
+ %plugin_macro fscache
185
+ %plugin_macro hddtemp
186
+ %plugin_macro interface
187
+ %plugin_macro iptables
188
+ %plugin_macro irq
189
+ %plugin_macro load
190
+ %plugin_macro logfile
191
+ %plugin_macro madwifi
192
+
193
+ %plugin_macro match_empty_counter
194
+ %plugin_macro match_hashed
195
+ %plugin_macro match_regex
196
+ %plugin_macro match_timediff
197
+ %plugin_macro match_value
198
+
199
+ %plugin_macro mbmon
200
+ %plugin_macro memcached
201
+ %plugin_macro memory
202
+ %plugin_macro multimeter
203
+ %plugin_macro network
204
+ %plugin_macro nfs
205
+ %plugin_macro ntpd
206
+ %plugin_macro openvpn
207
+ %plugin_macro olsrd
208
+ %plugin_macro perl
209
+ %plugin_macro powerdns
210
+ %plugin_macro processes
211
+ %plugin_macro protocols
212
+ %plugin_macro python
213
+ %plugin_macro rrdtool
214
+ %plugin_macro serial
215
+ %plugin_macro sensors
216
+ %plugin_macro swap
217
+ %plugin_macro syslog
218
+ %plugin_macro table
219
+ %plugin_macro tail
220
+
221
+ %plugin_macro target_notification
222
+ %plugin_macro target_replace
223
+ %plugin_macro target_scale
224
+ %plugin_macro target_set
225
+
226
+ %plugin_macro tcpconns
227
+ %plugin_macro teamspeak2
228
+ %plugin_macro ted
229
+ %plugin_macro thermal
230
+ %plugin_macro unixsock
231
+ %plugin_macro uptime
232
+ %plugin_macro users
233
+ %plugin_macro uuid
234
+ %plugin_macro vmem
235
+ %plugin_macro vserver
236
+ %plugin_macro wireless
237
+ %plugin_macro write_http
252
238
253
239
%attr(0644,root,root) %{_datadir }/%{name }/types.db
254
240
255
241
%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
242
%attr(0644,root,root) %{_libdir }/perl5/site_perl/5.8.8/%{_arch }-linux-thread-multi/auto/Collectd/.packlist
243
+ %attr(0644,root,root) /usr/lib/perl5/site_perl/5.8.8/Collectd.pm
244
+ %attr(0644,root,root) /usr/lib/perl5/site_perl/5.8.8/Collectd/Unixsock.pm
245
+ %attr(0644,root,root) /usr/lib/perl5/site_perl/5.8.8/Collectd/Plugins/OpenVZ.pm
259
246
%attr(0644,root,root) /usr/share/man/man3/Collectd::Unixsock.3pm.gz
260
247
248
+ %exclude /usr/share/collectd/postgresql_default.conf
249
+
261
250
%dir /var/lib/collectd
262
251
252
+ %if %with_java
253
+ %files java
254
+ %attr(0644,root,root) /usr/share/%{name }/java/org/collectd/api/* .class
255
+ %attr(0644,root,root) /usr/share/%{name }/java/org/collectd/java/* .class
256
+ %plugin_macro java
257
+ %endif
258
+
263
259
%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
260
+ %config %attr(0644,root,root) /etc/collectd.d/apache.conf
261
+ %plugin_macro apache
267
262
268
263
%files email
269
264
%attr(0644,root,root) %{_libdir }/%{name }/email.so*
270
265
%attr(0644,root,root) %{_libdir }/%{name }/email.la
271
- %attr(0644,root,root) /etc/collectd.d/email.conf
266
+ %config % attr(0644,root,root) /etc/collectd.d/email.conf
272
267
273
268
%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
269
+ %config %attr(0644,root,root) /etc/collectd.d/mysql.conf
270
+ %plugin_macro mysql
277
271
278
272
%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
273
+ %config %attr(0644,root,root) /etc/collectd.d/nginx.conf
274
+ %plugin_macro nginx
282
275
283
276
%files sensors
284
277
%attr(0644,root,root) %{_libdir }/%{name }/sensors.so*
285
278
%attr(0644,root,root) %{_libdir }/%{name }/sensors.la
286
- %attr(0644,root,root) /etc/collectd.d/sensors.conf
279
+ %config % attr(0644,root,root) /etc/collectd.d/sensors.conf
287
280
288
281
%files snmp
289
- %attr(0644,root,root) %{_libdir }/%{name }/snmp.so*
290
- %attr(0644,root,root) %{_libdir }/%{name }/snmp.la
291
282
%attr(0644,root,root) /etc/collectd.d/snmp.conf
283
+ %plugin_macro snmp
292
284
293
285
%changelog
286
+ *
Tue Jan 04 2010 Rackspace <[email protected] > 4.9.0
287
+ - New upstream version
288
+ - Changes to support 4.9.0
289
+ - Added support for Java/GenericJMX plugin
290
+
294
291
*
Mon Mar 17 2008 RightScale <[email protected] > 4.3.1
295
292
- New upstream version
296
293
- Changes to support 4.3.1
0 commit comments