source: packages/utils/collectd/Makefile @ 16363

Last change on this file since 16363 was 16363, checked in by jow, 7 years ago

[packages] collectd: remove redundant build dependencies

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 16.3 KB
Line 
1#
2# Copyright (C) 2006 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=collectd
11PKG_VERSION:=4.4.4
12PKG_RELEASE:=2
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15PKG_SOURCE_URL:=http://collectd.org/files/
16PKG_MD5SUM:=9e0e89150b1ff28fc0fdd8a198c9ac5e
17
18PKG_FIXUP=libtool
19
20include $(INCLUDE_DIR)/package.mk
21include $(INCLUDE_DIR)/kernel.mk
22
23define Package/collectd/common_info
24  SECTION:=utils
25  CATEGORY:=Utilities
26  TITLE:=Lightweight system statistics collection daemon
27  URL:=http://verplant.org/collectd/
28endef
29
30define Package/collectd/description
31        collectd is a small daemon which collects system information periodically
32        and provides mechanismns to store the values in a variety of ways.
33endef
34
35define Package/collectd
36        $(call Package/collectd/common_info)
37        DEPENDS:=+libgcc +libpthread +libz
38        MENU:=1
39endef
40
41
42#
43# output plugins
44#
45define Package/collectd-mod-csv
46        $(call Package/collectd/common_info)
47        TITLE:=collectd - csv output plugin
48        DEPENDS:=collectd
49endef
50
51define Package/collectd-mod-email
52        $(call Package/collectd/common_info)
53        TITLE:=collectd - email output plugin
54        DEPENDS:=collectd
55endef
56
57define Package/collectd-mod-logfile
58        $(call Package/collectd/common_info)
59        TITLE:=collectd - logfile output plugin
60        DEPENDS:=collectd
61endef
62
63define Package/collectd-mod-network
64        $(call Package/collectd/common_info)
65        TITLE:=collectd - network input/output plugin
66        DEPENDS:=collectd
67endef
68
69define Package/collectd-mod-syslog
70        $(call Package/collectd/common_info)
71        TITLE:=collectd - syslog output plugin
72        DEPENDS:=collectd
73endef
74
75define Package/collectd-mod-unixsock
76        $(call Package/collectd/common_info)
77        TITLE:=collectd - unix socket output plugin
78        DEPENDS:=collectd
79endef
80
81
82#
83# input plugins
84#
85define Package/collectd-mod-apache
86        $(call Package/collectd/common_info)
87        TITLE:=collectd - apache status input plugin
88        DEPENDS:=collectd +libcurl
89endef
90
91define Package/collectd-mod-apcups
92        $(call Package/collectd/common_info)
93        TITLE:=collectd - apcups status input plugin
94        DEPENDS:=collectd
95endef
96
97define Package/collectd-mod-ascent
98        $(call Package/collectd/common_info)
99        TITLE:=collectd - ascent status input plugin
100        DEPENDS:=collectd +libcurl +libxml2
101endef
102
103define Package/collectd-mod-cpu
104        $(call Package/collectd/common_info)
105        TITLE:=collectd - cpu input plugin
106        DEPENDS:=collectd
107endef
108
109define Package/collectd-mod-df
110        $(call Package/collectd/common_info)
111        TITLE:=collectd - disk space input plugin
112        DEPENDS:=collectd
113endef
114
115define Package/collectd-mod-disk
116        $(call Package/collectd/common_info)
117        TITLE:=collectd - disk usage/timing input plugin
118        DEPENDS:=collectd
119endef
120
121define Package/collectd-mod-dns
122        $(call Package/collectd/common_info)
123        TITLE:=collectd - dns traffic input plugin
124        DEPENDS:=collectd +libpcap
125endef
126
127define Package/collectd-mod-exec
128        $(call Package/collectd/common_info)
129        TITLE:=collectd - process exec input plugin
130        DEPENDS:=collectd
131endef
132
133define Package/collectd-mod-interface
134        $(call Package/collectd/common_info)
135        TITLE:=collectd - network interfaces input plugin
136        DEPENDS:=collectd
137endef
138
139define Package/collectd-mod-iptables
140        $(call Package/collectd/common_info)
141        TITLE:=collectd - iptables status input plugin
142        DEPENDS:=collectd +iptables
143endef
144
145define Package/collectd-mod-irq
146        $(call Package/collectd/common_info)
147        TITLE:=collectd - interrupt usage input plugin
148        DEPENDS:=collectd
149endef
150
151define Package/collectd-mod-load
152        $(call Package/collectd/common_info)
153        TITLE:=collectd - system load input plugin
154        DEPENDS:=collectd
155endef
156
157define Package/collectd-mod-netlink
158        $(call Package/collectd/common_info)
159        TITLE:=collectd - netlink input plugin (uses iproute2)
160        DEPENDS:=collectd +ip
161endef
162
163define Package/collectd-mod-nginx
164        $(call Package/collectd/common_info)
165        TITLE:=collectd - nginx status input plugin
166        DEPENDS:=collectd +libcurl
167endef
168
169define Package/collectd-mod-ntpd
170        $(call Package/collectd/common_info)
171        TITLE:=collectd - ntp daemon status input plugin
172        DEPENDS:=collectd
173endef
174
175define Package/collectd-mod-nut
176        $(call Package/collectd/common_info)
177        TITLE:=collectd - UPS monitoring input plugin
178        DEPENDS:=collectd @BROKEN
179endef
180
181define Package/collectd-mod-ping
182        $(call Package/collectd/common_info)
183        TITLE:=collectd - ping status input plugin
184        DEPENDS:=collectd
185endef
186
187define Package/collectd-mod-powerdns
188        $(call Package/collectd/common_info)
189        TITLE:=collectd - powerdns server status input plugin
190        DEPENDS:=collectd
191endef
192
193define Package/collectd-mod-processes
194        $(call Package/collectd/common_info)
195        TITLE:=collectd - process status plugin
196        DEPENDS:=collectd
197endef
198
199
200define Package/collectd-mod-rrdtool1
201        $(call Package/collectd/common_info)
202        TITLE:=collectd - rrdtool 1.0.x output plugin
203        DEPENDS:=collectd +librrd1
204endef
205
206define Package/collectd-mod-sensors
207        $(call Package/collectd/common_info)
208        TITLE:=collectd - lm_sensors input plugin
209        DEPENDS:=collectd +libsensors @BROKEN
210endef
211
212define Package/collectd-mod-snmp
213        $(call Package/collectd/common_info)
214        TITLE:=collectd - snmp input plugin
215        DEPENDS:=collectd +libnetsnmp
216endef
217
218define Package/collectd-mod-tail
219        $(call Package/collectd/common_info)
220        TITLE:=collectd - tail input plugin
221        DEPENDS:=collectd
222endef
223
224define Package/collectd-mod-teamspeak2
225        $(call Package/collectd/common_info)
226        TITLE:=collectd - teamspeak2 input plugin
227        DEPENDS:=collectd
228endef
229
230define Package/collectd-mod-tcpconns
231        $(call Package/collectd/common_info)
232        TITLE:=collectd - tcp connection tracking input plugin
233        DEPENDS:=collectd
234endef
235
236define Package/collectd-mod-users
237        $(call Package/collectd/common_info)
238        TITLE:=collectd - user login status input plugin
239        DEPENDS:=collectd
240endef
241
242define Package/collectd-mod-vmem
243        $(call Package/collectd/common_info)
244        TITLE:=collectd - virtual memory usage input plugin
245        DEPENDS:=collectd
246endef
247
248define Package/collectd-mod-wireless
249        $(call Package/collectd/common_info)
250        TITLE:=collectd - wireless status input plugin
251        DEPENDS:=collectd
252endef
253
254
255define Package/collectd/conffiles
256/etc/collectd.conf
257endef
258
259define Build/Configure
260endef
261
262define Build/Compile
263        -$(MAKE) -C $(PKG_BUILD_DIR) clean
264        $(call Build/Configure/Default, $(PKG_CONFIGURE_OPTS))
265        $(call Build/Compile/Default)
266endef
267
268
269#
270# Build PKG_CONFIGURE_OPTS
271#
272
273# common configure args
274PKG_CONFIGURE_OPTS:= \
275        --disable-debug \
276        --enable-daemon \
277        --enable-getifaddrs \
278        --with-nan-emulation \
279        --with-fp-layout=nothing
280
281CONFIGURE_VARS+= \
282        CPPFLAGS="-I$(STAGING_DIR)/usr/include/libxml2 $$$$CPPFLAGS $(FPIC)" \
283        KERNEL_DIR="$(LINUX_DIR)"
284
285# list of permanently disabled plugins
286disabled_plugins := apple_sensors battery cpufreq entropy hddtemp ipmi ipvs libvirt mbmon memcached \
287                        multimeter mysql nfs perl serial swap tape uuid vserver xmms
288
289# list of selectable plugins
290selectable_plugins := apache apcups ascent cpu csv df disk dns email exec interface iptables irq load \
291                        logfile memory netlink network nginx ntpd nut ping powerdns processes sensors \
292                        snmp syslog tail tcpconns teamspeak2 unixsock users vmem wireless
293
294# makro to enable / disable plugin
295define enable_plugin
296        ifneq ($$(CONFIG_PACKAGE_collectd-mod-$(1)),)
297                PKG_CONFIGURE_OPTS += --enable-$(1)
298        else
299                PKG_CONFIGURE_OPTS += --disable-$(1)
300        endif
301endef
302
303# build args for permanently disabled plugins
304PKG_CONFIGURE_OPTS += $(foreach plugin,$(disabled_plugins),--disable-$(plugin))
305
306# build args for selectable plugins
307$(foreach plugin,$(selectable_plugins),$(eval $(call enable_plugin,$(plugin))))
308
309# exception: mod-netlink needs iproute2
310ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
311        PKG_CONFIGURE_OPTS += --with-libnetlink=$(wildcard $(BUILD_DIR)/iproute2-*)
312endif
313
314# exception: mod-rrdtool(1) needs rrdtool
315ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool1),)
316        PKG_CONFIGURE_OPTS += --with-rrdtool=$(wildcard $(BUILD_DIR)/rrdtool-1.0.*)
317        TARGET_LDFLAGS := -L$(wildcard $(BUILD_DIR)/rrdtool-1.0.*)/src/.libs -lz -lm $(TARGET_LDFLAGS)
318endif
319
320
321MAKE_FLAGS += \
322        DESTDIR="$(PKG_INSTALL_DIR)" \
323        all install
324
325define Package/collectd/install
326        $(INSTALL_DIR) $(1)/usr/sbin
327        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
328        $(INSTALL_DIR) $(1)/usr/lib/collectd
329        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/lib/collectd/types.db $(1)/usr/lib/collectd/
330        $(INSTALL_DIR) $(1)/etc
331        $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/
332        $(INSTALL_DIR) $(1)/etc/init.d
333        $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd
334endef
335
336define Package/collectd-mod-apache/install
337        $(INSTALL_DIR) $(1)/usr/lib/collectd
338        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/apache.so $(1)/usr/lib/collectd/
339endef
340
341define Package/collectd-mod-apcups/install
342        $(INSTALL_DIR) $(1)/usr/lib/collectd
343        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/apcups.so $(1)/usr/lib/collectd/
344endef
345
346define Package/collectd-mod-ascent/install
347        $(INSTALL_DIR) $(1)/usr/lib/collectd
348        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/ascent.so $(1)/usr/lib/collectd/
349endef
350
351define Package/collectd-mod-cpu/install
352        $(INSTALL_DIR) $(1)/usr/lib/collectd
353        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/cpu.so $(1)/usr/lib/collectd/
354endef
355
356define Package/collectd-mod-csv/install
357        $(INSTALL_DIR) $(1)/usr/lib/collectd
358        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/csv.so $(1)/usr/lib/collectd/
359endef
360
361define Package/collectd-mod-df/install
362        $(INSTALL_DIR) $(1)/usr/lib/collectd
363        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/df.so $(1)/usr/lib/collectd/
364endef
365
366define Package/collectd-mod-disk/install
367        $(INSTALL_DIR) $(1)/usr/lib/collectd
368        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/disk.so $(1)/usr/lib/collectd/
369endef
370
371define Package/collectd-mod-dns/install
372        $(INSTALL_DIR) $(1)/usr/lib/collectd
373        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/dns.so $(1)/usr/lib/collectd/
374endef
375
376define Package/collectd-mod-email/install
377        $(INSTALL_DIR) $(1)/usr/lib/collectd
378        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/email.so $(1)/usr/lib/collectd/
379endef
380
381define Package/collectd-mod-exec/install
382        $(INSTALL_DIR) $(1)/usr/lib/collectd
383        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/exec.so $(1)/usr/lib/collectd/
384endef
385
386define Package/collectd-mod-interface/install
387        $(INSTALL_DIR) $(1)/usr/lib/collectd
388        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/interface.so $(1)/usr/lib/collectd/
389endef
390
391define Package/collectd-mod-iptables/install
392        $(INSTALL_DIR) $(1)/usr/lib/collectd
393        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/iptables.so $(1)/usr/lib/collectd/
394endef
395
396define Package/collectd-mod-irq/install
397        $(INSTALL_DIR) $(1)/usr/lib/collectd
398        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/irq.so $(1)/usr/lib/collectd/
399endef
400
401define Package/collectd-mod-load/install
402        $(INSTALL_DIR) $(1)/usr/lib/collectd
403        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/load.so $(1)/usr/lib/collectd/
404endef
405
406define Package/collectd-mod-logfile/install
407        $(INSTALL_DIR) $(1)/usr/lib/collectd
408        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/logfile.so $(1)/usr/lib/collectd/
409endef
410
411define Package/collectd-mod-netlink/install
412        $(INSTALL_DIR) $(1)/usr/lib/collectd
413        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/netlink.so $(1)/usr/lib/collectd/
414endef
415
416define Package/collectd-mod-network/install
417        $(INSTALL_DIR) $(1)/usr/lib/collectd
418        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/network.so $(1)/usr/lib/collectd/
419endef
420
421define Package/collectd-mod-nginx/install
422        $(INSTALL_DIR) $(1)/usr/lib/collectd
423        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/nginx.so $(1)/usr/lib/collectd/
424endef
425
426define Package/collectd-mod-ntpd/install
427        $(INSTALL_DIR) $(1)/usr/lib/collectd
428        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/ntpd.so $(1)/usr/lib/collectd/
429endef
430
431define Package/collectd-mod-nut/install
432        $(INSTALL_DIR) $(1)/usr/lib/collectd
433        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/nut.so $(1)/usr/lib/collectd/
434endef
435
436define Package/collectd-mod-ping/install
437        $(INSTALL_DIR) $(1)/usr/lib/collectd
438        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/ping.so $(1)/usr/lib/collectd/
439endef
440
441define Package/collectd-mod-powerdns/install
442        $(INSTALL_DIR) $(1)/usr/lib/collectd
443        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/powerdns.so $(1)/usr/lib/collectd/
444endef
445
446define Package/collectd-mod-processes/install
447        $(INSTALL_DIR) $(1)/usr/lib/collectd
448        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/processes.so $(1)/usr/lib/collectd/
449endef
450
451define Package/collectd-mod-rrdtool1/install
452        $(INSTALL_DIR) $(1)/usr/lib/collectd
453        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/rrdtool.so $(1)/usr/lib/collectd/
454endef
455
456define Package/collectd-mod-sensors/install
457        $(INSTALL_DIR) $(1)/usr/lib/collectd
458        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/sensors.so $(1)/usr/lib/collectd/
459endef
460
461define Package/collectd-mod-snmp/install
462        $(INSTALL_DIR) $(1)/usr/lib/collectd
463        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/snmp.so $(1)/usr/lib/collectd/
464endef
465
466define Package/collectd-mod-syslog/install
467        $(INSTALL_DIR) $(1)/usr/lib/collectd
468        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/syslog.so $(1)/usr/lib/collectd/
469endef
470
471define Package/collectd-mod-tail/install
472        $(INSTALL_DIR) $(1)/usr/lib/collectd
473        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/tail.so $(1)/usr/lib/collectd/
474endef
475
476define Package/collectd-mod-teamspeak2/install
477        $(INSTALL_DIR) $(1)/usr/lib/collectd
478        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/teamspeak2.so $(1)/usr/lib/collectd/
479endef
480
481define Package/collectd-mod-tcpconns/install
482        $(INSTALL_DIR) $(1)/usr/lib/collectd
483        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/tcpconns.so $(1)/usr/lib/collectd/
484endef
485
486define Package/collectd-mod-unixsock/install
487        $(INSTALL_DIR) $(1)/usr/lib/collectd
488        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/unixsock.so $(1)/usr/lib/collectd/
489endef
490
491define Package/collectd-mod-users/install
492        $(INSTALL_DIR) $(1)/usr/lib/collectd
493        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/users.so $(1)/usr/lib/collectd/
494endef
495
496define Package/collectd-mod-vmem/install
497        $(INSTALL_DIR) $(1)/usr/lib/collectd
498        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/vmem.so $(1)/usr/lib/collectd/
499endef
500
501define Package/collectd-mod-wireless/install
502        $(INSTALL_DIR) $(1)/usr/lib/collectd
503        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/collectd/wireless.so $(1)/usr/lib/collectd/
504endef
505
506
507$(eval $(call BuildPackage,collectd))
508$(eval $(call BuildPackage,collectd-mod-apache))
509$(eval $(call BuildPackage,collectd-mod-apcups))
510$(eval $(call BuildPackage,collectd-mod-ascent))
511$(eval $(call BuildPackage,collectd-mod-cpu))
512$(eval $(call BuildPackage,collectd-mod-csv))
513$(eval $(call BuildPackage,collectd-mod-df))
514$(eval $(call BuildPackage,collectd-mod-disk))
515$(eval $(call BuildPackage,collectd-mod-dns))
516$(eval $(call BuildPackage,collectd-mod-email))
517$(eval $(call BuildPackage,collectd-mod-exec))
518$(eval $(call BuildPackage,collectd-mod-interface))
519$(eval $(call BuildPackage,collectd-mod-iptables))
520$(eval $(call BuildPackage,collectd-mod-irq))
521$(eval $(call BuildPackage,collectd-mod-load))
522$(eval $(call BuildPackage,collectd-mod-logfile))
523$(eval $(call BuildPackage,collectd-mod-netlink))
524$(eval $(call BuildPackage,collectd-mod-network))
525$(eval $(call BuildPackage,collectd-mod-nginx))
526$(eval $(call BuildPackage,collectd-mod-ntpd))
527$(eval $(call BuildPackage,collectd-mod-nut))
528$(eval $(call BuildPackage,collectd-mod-ping))
529$(eval $(call BuildPackage,collectd-mod-powerdns))
530$(eval $(call BuildPackage,collectd-mod-processes))
531$(eval $(call BuildPackage,collectd-mod-rrdtool1))
532$(eval $(call BuildPackage,collectd-mod-sensors))
533$(eval $(call BuildPackage,collectd-mod-snmp))
534$(eval $(call BuildPackage,collectd-mod-syslog))
535$(eval $(call BuildPackage,collectd-mod-tail))
536$(eval $(call BuildPackage,collectd-mod-teamspeak2))
537$(eval $(call BuildPackage,collectd-mod-tcpconns))
538$(eval $(call BuildPackage,collectd-mod-unixsock))
539$(eval $(call BuildPackage,collectd-mod-users))
540$(eval $(call BuildPackage,collectd-mod-vmem))
541$(eval $(call BuildPackage,collectd-mod-wireless))
Note: See TracBrowser for help on using the repository browser.