Revert package feed back
[librecmc/package-feed.git] / utils / collectd / Makefile
1 #
2 # Copyright (C) 2006-2016 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:=5.5.3
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:=6f10633d0f73f99ef61472a8e377d4a058de161e80f3353b4b17d394c68f2f44
17
18 PKG_FIXUP:=autoreconf
19 PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
20 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>, Hannu Nyman <hannu.nyman@iki.fi>
21
22 PKG_INSTALL:=1
23 PKG_BUILD_PARALLEL:=1
24 PKG_USE_MIPS16:=0
25
26 COLLECTD_PLUGINS_DISABLED:= \
27         amqp \
28         apple_sensors \
29         aquaero \
30         barometer \
31         battery \
32         ceph \
33         cgroups \
34         curl_json \
35         curl_xml \
36         dbi \
37         drbd \
38         ethstat \
39         fhcount \
40         genericjmx \
41         gmond \
42         hddtemp \
43         ipc \
44         ipmi \
45         ipvs \
46         java \
47         log_logstash \
48         lvm \
49         lpar \
50         mbmon \
51         md \
52         memcachec \
53         memcached \
54         mic \
55         monitorus \
56         multimeter \
57         netapp \
58         nfs \
59         notify_desktop \
60         notify_email \
61         numa \
62         openldap \
63         openvz \
64         oracle \
65         perl \
66         pf \
67         pinba \
68         python \
69         redis \
70         routeros \
71         rrdcached \
72         serial \
73         sigrok \
74         smart \
75         statsd \
76         swap \
77         tape \
78         tokyotyrant \
79         turbostat \
80         uuid \
81         varnish \
82         virt \
83         vserver \
84         write_kafka \
85         write_log \
86         write_mongodb \
87         write_redis \
88         write_riemann \
89         write_sensu \
90         write_tsdb \
91         xmms \
92         zfs_arc \
93         zookeeper
94
95 COLLECTD_PLUGINS_SELECTED:= \
96         apache \
97         apcups \
98         ascent \
99         bind \
100         conntrack \
101         contextswitch \
102         cpu \
103         cpufreq \
104         csv \
105         curl \
106         df \
107         disk \
108         dns \
109         email \
110         entropy \
111         exec \
112         filecount \
113         fscache \
114         interface \
115         iptables \
116         irq \
117         iwinfo \
118         load \
119         logfile \
120         madwifi \
121         memory \
122         modbus \
123         mysql \
124         netlink \
125         network \
126         nginx \
127         ntpd \
128         nut \
129         olsrd \
130         onewire \
131         openvpn \
132         ping \
133         postgresql \
134         powerdns \
135         processes \
136         protocols \
137         rrdtool \
138         sensors \
139         snmp \
140         syslog \
141         table \
142         tail \
143         tail_csv \
144         tcpconns \
145         teamspeak2 \
146         ted \
147         thermal \
148         unixsock \
149         uptime \
150         users \
151         vmem \
152         wireless \
153         write_graphite \
154         write_http \
155
156 PKG_CONFIG_DEPENDS:= \
157         $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \
158
159 include $(INCLUDE_DIR)/package.mk
160 include $(INCLUDE_DIR)/kernel.mk
161
162 define Package/collectd/Default
163   SECTION:=utils
164   CATEGORY:=Utilities
165   TITLE:=Lightweight system statistics collection daemon
166   URL:=http://verplant.org/collectd/
167 endef
168
169 define Package/collectd
170 $(call Package/collectd/Default)
171   DEPENDS:= +libpthread +zlib +libltdl +libip4tc
172   MENU:=1
173 endef
174
175 define Package/collectd/description
176  collectd is a small daemon which collects system information periodically
177  and provides mechanismns to store the values in a variety of ways.
178 endef
179
180 define Package/collectd/config
181         config PACKAGE_COLLECTD_ENCRYPTED_NETWORK
182         bool "Enable ability to use encrypted networking"
183         default n
184         depends on PACKAGE_collectd
185         select PACKAGE_collectd-mod-network
186 endef
187
188 ifneq ($(CONFIG_avr32),)
189   TARGET_CFLAGS += -fsigned-char
190 endif
191
192 # common configure args
193 CONFIGURE_ARGS+= \
194         --disable-debug \
195         --enable-daemon \
196         --with-nan-emulation \
197         --without-perl-bindings \
198         --without-libudev
199
200 ifneq ($(CONFIG_PACKAGE_COLLECTD_ENCRYPTED_NETWORK),)
201 CONFIGURE_ARGS+= \
202         --with-libgcrypt=$(STAGING_DIR)/usr/include
203 else
204 CONFIGURE_ARGS+= \
205         --without-libgcrypt
206 endif
207
208 CONFIGURE_VARS+= \
209         CFLAGS="$$$$CFLAGS $(FPIC)" \
210         LDFLAGS="$$$$LDFLAGS -lm -lz" \
211         KERNEL_DIR="$(LINUX_DIR)" \
212
213 CONFIGURE_PLUGIN= \
214         $(foreach m, $(1), \
215                 $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \
216         )
217
218 CONFIGURE_ARGS+= \
219         $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_SELECTED)) \
220         $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_DISABLED)) \
221
222 # exception: mod-ascent needs libxml2
223 ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),)
224   CONFIGURE_VARS+= \
225         CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
226 endif
227
228 ifneq ($(CONFIG_BIG_ENDIAN),)
229   CONFIGURE_ARGS+= --with-fp-layout=endianflip
230 else
231   CONFIGURE_ARGS+= --with-fp-layout=nothing
232 endif
233
234 ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),)
235   CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/"
236 endif
237
238 ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),)
239   CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/"
240 endif
241
242 # exception: mod-netlink needs libnetlink from iproute
243 ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
244   CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr"
245 endif
246
247 # exception: mod-modbus needs libmodbus
248 ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),)
249   CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr"
250 endif
251
252 # exception: mod-onewire needs libow-capi
253 ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),)
254   CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr"
255 endif
256
257 # exception: mod-rrdtool needs rrdtool-1.0.x
258 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),)
259   CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
260 endif
261
262 define Package/collectd/conffiles
263 /etc/collectd.conf
264 endef
265
266 define Package/collectd/install
267         $(INSTALL_DIR) $(1)/usr/sbin
268         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
269         $(INSTALL_DIR) $(1)/usr/share/collectd
270         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/collectd/types.db $(1)/usr/share/collectd/
271         $(INSTALL_DIR) $(1)/etc
272         $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/
273         $(INSTALL_DIR) $(1)/etc/init.d
274         $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd
275         $(INSTALL_DIR) $(1)/etc/collectd/conf.d
276 endef
277
278 # 1: plugin name
279 # 2: plugin title/description
280 # 3: files
281 # 4: extra dependency
282 define BuildPlugin
283
284   PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_collectd-mod-$(1)
285
286   define Package/collectd-mod-$(1)
287   $$(call Package/collectd/Default)
288     TITLE:=$(2) plugin
289     DEPENDS:= collectd $(4)
290   endef
291
292   define Package/collectd-mod-$(1)/install
293         $(INSTALL_DIR) $$(1)/usr/lib/collectd
294         for m in $(3); do \
295                 $(CP) \
296                         $(PKG_INSTALL_DIR)/usr/lib/collectd/$$$$$$$${m}.so \
297                         $$(1)/usr/lib/collectd/ ; \
298         done
299   endef
300
301   $$(eval $$(call BuildPackage,collectd-mod-$(1)))
302
303 endef
304
305 $(eval $(call BuildPackage,collectd))
306
307 #$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES))
308 $(eval $(call BuildPlugin,apache,apache status input,apache,+PACKAGE_collectd-mod-apache:libcurl))
309 $(eval $(call BuildPlugin,apcups,apcups status input,apcups,))
310 $(eval $(call BuildPlugin,ascent,ascent status input,ascent,+PACKAGE_collectd-mod-ascent:libcurl +PACKAGE_collectd-mod-ascent:libxml2))
311 $(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod-bind:libcurl +PACKAGE_collectd-mod-bind:libxml2))
312 $(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,))
313 $(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,))
314 $(eval $(call BuildPlugin,cpu,CPU input,cpu,))
315 $(eval $(call BuildPlugin,cpufreq,CPU Freq input,cpufreq,@(TARGET_x86||TARGET_x86_64||TARGET_mvebu||TARGET_ipq806x||TARGET_armvirt))) # Only enable on x86 mvebu ipq806x armvirt
316 $(eval $(call BuildPlugin,csv,CSV output,csv,))
317 $(eval $(call BuildPlugin,curl,cURL input,curl,+PACKAGE_collectd-mod-curl:libcurl))
318 #$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
319 $(eval $(call BuildPlugin,df,disk space input,df,))
320 $(eval $(call BuildPlugin,disk,disk usage/timing input,disk,))
321 $(eval $(call BuildPlugin,dns,DNS traffic input,dns,+PACKAGE_collectd-mod-dns:libpcap))
322 $(eval $(call BuildPlugin,email,email output,email,))
323 $(eval $(call BuildPlugin,entropy,Entropy amount input,entropy,))
324 $(eval $(call BuildPlugin,exec,process exec input,exec,))
325 $(eval $(call BuildPlugin,filecount,file count input,filecount,))
326 $(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,))
327 $(eval $(call BuildPlugin,interface,network interfaces input,interface,))
328 $(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables +libiptc))
329 $(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
330 $(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo))
331 $(eval $(call BuildPlugin,load,system load input,load,))
332 $(eval $(call BuildPlugin,logfile,log files output,logfile,))
333 $(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,))
334 #$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
335 $(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
336 $(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus))
337 $(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:libmnl))
338 $(eval $(call BuildPlugin,network,network input/output,network,+PACKAGE_COLLECTD_ENCRYPTED_NETWORK:libgcrypt))
339 $(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl))
340 $(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,))
341 $(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut))
342 $(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,))
343 $(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN))
344 $(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,))
345 $(eval $(call BuildPlugin,ping,ping status input,ping,+PACKAGE_collectd-mod-ping:liboping))
346 $(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+PACKAGE_collectd-mod-postgresql:libpq))
347 $(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,))
348 $(eval $(call BuildPlugin,processes,process status input,processes,))
349 $(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
350 $(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1))
351 $(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors))
352 $(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp))
353 $(eval $(call BuildPlugin,syslog,syslog output,syslog,))
354 $(eval $(call BuildPlugin,tail,tail input,tail,))
355 $(eval $(call BuildPlugin,tail-csv,tail CSV input,tail_csv,))
356 $(eval $(call BuildPlugin,table,table-like structured file input,table,))
357 $(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,))
358 $(eval $(call BuildPlugin,ted,The Energy Detective input,ted,@((!TARGET_avr32)||BROKEN))) # fails on avr32 because of warnings treated as errors
359 $(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,))
360 $(eval $(call BuildPlugin,thermal,system temperatures input,thermal,))
361 $(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,))
362 $(eval $(call BuildPlugin,uptime,uptime status input,uptime,))
363 $(eval $(call BuildPlugin,users,user logged in status input,users,))
364 $(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,))
365 $(eval $(call BuildPlugin,wireless,wireless status input,wireless,))
366 $(eval $(call BuildPlugin,write-graphite,Carbon/Graphite output,write_graphite,+PACKAGE_collectd-mod-write-graphite:libpthread))
367 $(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl))