collectd: disable mips16 support, some code gets miscompiled
[packages.git] / utils / collectd / Makefile
1 #
2 # Copyright (C) 2006-2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=collectd
11 PKG_VERSION:=4.10.8
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://collectd.org/files/
16 PKG_MD5SUM:=7a60495208b9383225493c6dd6abb2f0
17
18 PKG_FIXUP:=autoreconf
19 PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
20
21 PKG_INSTALL:=1
22 PKG_BUILD_PARALLEL:=1
23 PKG_USE_MIPS16:=0
24
25 COLLECTD_PLUGINS_DISABLED:= \
26         apple_sensors \
27         battery \
28         cpufreq \
29         curl_json \
30         entropy \
31         genericjmx \
32         gmond \
33         hddtemp \
34         ipmi \
35         ipvs \
36         java \
37         libvirt \
38         mbmon \
39         memcachec \
40         memcached \
41         monitorus \
42         multimeter \
43         netapp \
44         nfs \
45         notify_desktop \
46         notify_email \
47         openvz \
48         oracle \
49         perl \
50         pinba \
51         python \
52         routeros \
53         rrdcached \
54         serial \
55         swap \
56         tape \
57         tokyotyrant \
58         uuid \
59         vserver \
60         xmms \
61         zfs_arc \
62
63 COLLECTD_PLUGINS_SELECTED:= \
64         apache \
65         apcups \
66         ascent \
67         bind \
68         conntrack \
69         contextswitch \
70         cpu \
71         csv \
72         curl \
73         dbi \
74         df \
75         disk \
76         dns \
77         email \
78         exec \
79         filecount \
80         fscache \
81         interface \
82         iptables \
83         irq \
84         iwinfo \
85         load \
86         logfile \
87         madwifi \
88         memory \
89         modbus \
90         mysql \
91         netlink \
92         network \
93         nginx \
94         ntpd \
95         nut \
96         olsrd \
97         onewire \
98         openvpn \
99         ping \
100         postgresql \
101         powerdns \
102         processes \
103         protocols \
104         rrdtool \
105         sensors \
106         snmp \
107         syslog \
108         tail \
109         table \
110         ted \
111         tcpconns \
112         teamspeak2 \
113         thermal \
114         unixsock \
115         uptime \
116         users \
117         vmem \
118         wireless \
119         write_http \
120
121 PKG_CONFIG_DEPENDS:= \
122         $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \
123
124 include $(INCLUDE_DIR)/package.mk
125 include $(INCLUDE_DIR)/kernel.mk
126
127 define Package/collectd/Default
128   SECTION:=utils
129   CATEGORY:=Utilities
130   TITLE:=Lightweight system statistics collection daemon
131   URL:=http://verplant.org/collectd/
132 endef
133
134 define Package/collectd
135 $(call Package/collectd/Default)
136   DEPENDS:= +libpthread +zlib +libltdl +libip4tc
137   MENU:=1
138 endef
139
140 define Package/collectd/description
141  collectd is a small daemon which collects system information periodically
142  and provides mechanismns to store the values in a variety of ways.
143 endef
144
145 ifneq ($(CONFIG_avr32),)
146   TARGET_CFLAGS += -fsigned-char
147 endif
148
149 # common configure args
150 CONFIGURE_ARGS+= \
151         --disable-debug \
152         --enable-daemon \
153         --enable-getifaddrs \
154         --with-nan-emulation \
155         --without-libgcrypt
156
157 CONFIGURE_VARS+= \
158         CFLAGS="$$$$CFLAGS $(FPIC)" \
159         LDFLAGS="$$$$LDFLAGS -lm -lz" \
160         KERNEL_DIR="$(LINUX_DIR)" \
161
162 CONFIGURE_PLUGIN= \
163         $(foreach m, $(1), \
164                 $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \
165         )
166
167 CONFIGURE_ARGS+= \
168         $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_SELECTED)) \
169         $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_DISABLED)) \
170
171 # exception: mod-ascent needs libxml2
172 ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),)
173   CONFIGURE_VARS+= \
174         CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
175 endif
176
177 ifneq ($(CONFIG_BIG_ENDIAN),)
178   CONFIGURE_ARGS+= --with-fp-layout=endianflip
179 else
180   CONFIGURE_ARGS+= --with-fp-layout=nothing
181 endif
182
183 ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),)
184   CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/"
185 endif
186
187 ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),)
188   CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/"
189 endif
190
191 # exception: mod-netlink needs libnetlink from iproute
192 ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
193   CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr"
194 endif
195
196 # exception: mod-modbus needs libmodbus
197 ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),)
198   CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr"
199 endif
200
201 # exception: mod-onewire needs libow-capi
202 ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),)
203   CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr"
204 endif
205
206 # exception: mod-rrdtool needs rrdtool-1.0.x
207 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),)
208   CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
209 endif
210
211 define Package/collectd/conffiles
212 /etc/collectd.conf
213 endef
214
215 define Package/collectd/install
216         $(INSTALL_DIR) $(1)/usr/sbin
217         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
218         $(INSTALL_DIR) $(1)/usr/share/collectd
219         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/collectd/types.db $(1)/usr/share/collectd/
220         $(INSTALL_DIR) $(1)/etc
221         $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/
222         $(INSTALL_DIR) $(1)/etc/init.d
223         $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd
224 endef
225
226 # 1: plugin name
227 # 2: plugin title/description
228 # 3: files
229 # 4: extra dependency
230 define BuildPlugin
231
232   PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_collectd-mod-$(1)
233
234   define Package/collectd-mod-$(1)
235   $$(call Package/collectd/Default)
236     TITLE:=$(2) plugin
237     DEPENDS:= collectd $(4)
238   endef
239
240   define Package/collectd-mod-$(1)/install
241         $(INSTALL_DIR) $$(1)/usr/lib/collectd
242         for m in $(3); do \
243                 $(CP) \
244                         $(PKG_INSTALL_DIR)/usr/lib/collectd/$$$$$$$${m}.so \
245                         $$(1)/usr/lib/collectd/ ; \
246         done
247   endef
248
249   $$(eval $$(call BuildPackage,collectd-mod-$(1)))
250
251 endef
252
253 $(eval $(call BuildPackage,collectd))
254
255 #$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES))
256 $(eval $(call BuildPlugin,apache,apache status input,apache,+PACKAGE_collectd-mod-apache:libcurl))
257 $(eval $(call BuildPlugin,apcups,apcups status input,apcups,))
258 $(eval $(call BuildPlugin,ascent,ascent status input,ascent,+PACKAGE_collectd-mod-ascent:libcurl +PACKAGE_collectd-mod-ascent:libxml2))
259 $(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod-bind:libcurl +PACKAGE_collectd-mod-bind:libxml2))
260 $(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,))
261 $(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,))
262 $(eval $(call BuildPlugin,cpu,CPU input,cpu,))
263 $(eval $(call BuildPlugin,csv,CSV output,csv,))
264 $(eval $(call BuildPlugin,curl,cURL input,curl,+PACKAGE_collectd-mod-curl:libcurl))
265 $(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
266 $(eval $(call BuildPlugin,df,disk space input,df,))
267 $(eval $(call BuildPlugin,disk,disk usage/timing input,disk,))
268 $(eval $(call BuildPlugin,dns,DNS traffic input,dns,+PACKAGE_collectd-mod-dns:libpcap))
269 $(eval $(call BuildPlugin,email,email output,email,))
270 $(eval $(call BuildPlugin,exec,process exec input,exec,))
271 $(eval $(call BuildPlugin,filecount,file count input,filecount,))
272 $(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,))
273 $(eval $(call BuildPlugin,interface,network interfaces input,interface,))
274 $(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables +libiptc))
275 $(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
276 $(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo))
277 $(eval $(call BuildPlugin,load,system load input,load,))
278 $(eval $(call BuildPlugin,logfile,log files output,logfile,))
279 $(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,))
280 $(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
281 $(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
282 $(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus @BROKEN))
283 $(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:ip @BROKEN))
284 $(eval $(call BuildPlugin,network,network input/output,network))
285 $(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl))
286 $(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,))
287 $(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut))
288 $(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,))
289 $(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN))
290 $(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,))
291 $(eval $(call BuildPlugin,ping,ping status input,ping,+PACKAGE_collectd-mod-ping:liboping))
292 $(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+PACKAGE_collectd-mod-postgresql:libpq))
293 $(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,))
294 $(eval $(call BuildPlugin,processes,process status input,processes,))
295 $(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
296 $(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1))
297 $(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors @BROKEN))
298 $(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp))
299 $(eval $(call BuildPlugin,syslog,syslog output,syslog,))
300 $(eval $(call BuildPlugin,tail,tail input,tail,))
301 $(eval $(call BuildPlugin,table,table-like structured file input,table,))
302 $(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,))
303 $(eval $(call BuildPlugin,ted,The Energy Detective input,ted,@((!TARGET_avr32)||BROKEN))) # fails on avr32 because of warnings treated as errors
304 $(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,))
305 $(eval $(call BuildPlugin,thermal,system temperatures input,thermal,))
306 $(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,))
307 $(eval $(call BuildPlugin,uptime,uptime status input,uptime,))
308 $(eval $(call BuildPlugin,users,user logged in status input,users,))
309 $(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,))
310 $(eval $(call BuildPlugin,wireless,wireless status input,wireless,))
311 $(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl))