2 # Copyright (C) 2006-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
15 PKG_SOURCE_URL
:=https
://collectd.org
/files
/ \
16 https
://github.com
/collectd
/collectd
/releases
/download
/collectd-
$(PKG_VERSION
)
17 PKG_HASH
:=7edd3643c0842215553b2421d5456f4e9a8a58b07e216b40a7e8e91026d8e501
20 PKG_REMOVE_FILES
:=aclocal.m4 libltdl
/aclocal.m4
21 PKG_MAINTAINER
:=Jo-Philipp Wich
<jo@mein.io
>, Hannu Nyman
<hannu.nyman@iki.fi
>
27 COLLECTD_PLUGINS_DISABLED
:= \
109 COLLECTD_PLUGINS_SELECTED
:= \
135 match_empty_counter \
175 PKG_CONFIG_DEPENDS
:= \
176 $(patsubst %,CONFIG_PACKAGE_collectd-mod-
%,$(subst _
,-,$(COLLECTD_PLUGINS_SELECTED
))) \
178 include $(INCLUDE_DIR
)/package.mk
179 include $(INCLUDE_DIR
)/kernel.mk
181 define Package
/collectd
/Default
184 TITLE
:=Lightweight system statistics collection daemon
185 URL
:=https
://collectd.org
/
188 define Package
/collectd
189 $(call Package
/collectd
/Default
)
190 DEPENDS
:= +libpthread
+zlib
+libltdl
+libip4tc
194 define Package
/collectd
/description
195 collectd is a small daemon which collects system information periodically
196 and provides mechanismns to store the values in a variety of ways.
199 ifneq ($(CONFIG_avr32
),)
200 TARGET_CFLAGS
+= -fsigned-char
203 # common configure args
208 --with-nan-emulation \
210 --without-libgcrypt \
211 --without-perl-bindings \
215 CFLAGS
="$$$$CFLAGS $(FPIC)" \
216 LDFLAGS
="$$$$LDFLAGS -lm -lz" \
217 KERNEL_DIR
="$(LINUX_DIR)" \
221 $(if
$(CONFIG_PACKAGE_collectd-mod-
$(subst _
,-,$(m
))),--enable-
$(m
),--disable-
$(m
)) \
225 $(call CONFIGURE_PLUGIN
,$(COLLECTD_PLUGINS_SELECTED
)) \
226 $(call CONFIGURE_PLUGIN
,$(COLLECTD_PLUGINS_DISABLED
)) \
228 # exception: mod-ascent needs libxml2
229 ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent
),)
231 CPPFLAGS
="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
234 ifneq ($(CONFIG_BIG_ENDIAN
),)
235 CONFIGURE_ARGS
+= --with-fp-layout
=endianflip
237 CONFIGURE_ARGS
+= --with-fp-layout
=nothing
240 ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql
),)
241 CONFIGURE_ARGS
+= --with-libpq
="$(STAGING_DIR)/usr/"
244 ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql
),)
245 CONFIGURE_ARGS
+= --with-libmysql
="$(STAGING_DIR)/usr/"
248 # exception: mod-netlink needs libnetlink from iproute
249 ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink
),)
250 CONFIGURE_ARGS
+= --with-libnetlink
="$(STAGING_DIR)/usr"
253 # exception: mod-modbus needs libmodbus
254 ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus
),)
255 CONFIGURE_ARGS
+= --with-libmodbus
="$(STAGING_DIR)/usr"
258 # exception: mod-onewire needs libow-capi
259 ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire
),)
260 CONFIGURE_ARGS
+= --with-libowcapi
="$(STAGING_DIR)/usr"
263 # exception: mod-rrdtool needs rrdtool-1.0.x
264 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool
),)
265 CONFIGURE_ARGS
+= --with-librrd
="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
268 define Package
/collectd
/conffiles
272 define Package
/collectd
/install
273 $(INSTALL_DIR
) $(1)/usr
/sbin
274 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/collectd
$(1)/usr
/sbin
/
275 $(INSTALL_DIR
) $(1)/usr
/share
/collectd
276 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/share
/collectd
/types.db
$(1)/usr
/share
/collectd
/
277 $(INSTALL_DIR
) $(1)/etc
278 $(INSTALL_CONF
) .
/files
/collectd.conf
$(1)/etc
/
279 $(INSTALL_DIR
) $(1)/etc
/init.d
280 $(INSTALL_BIN
) .
/files
/collectd.init
$(1)/etc
/init.d
/collectd
281 $(INSTALL_DIR
) $(1)/etc
/collectd
/conf.d
285 # 2: plugin title/description
287 # 4: extra dependency
290 PKG_CONFIG_DEPENDS
+= CONFIG_PACKAGE_collectd-mod-
$(1)
292 define Package
/collectd-mod-
$(1)
293 $$(call Package
/collectd
/Default
)
295 DEPENDS
:= collectd
$(4)
298 define Package
/collectd-mod-
$(1)/install
299 $(INSTALL_DIR
) $$(1)/usr
/lib
/collectd
302 $(PKG_INSTALL_DIR
)/usr
/lib
/collectd
/$$$$$$$${m}.so \
303 $$(1)/usr
/lib
/collectd
/ ; \
307 $$(eval
$$(call BuildPackage
,collectd-mod-
$(1)))
311 $(eval
$(call BuildPackage
,collectd
))
313 #$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES))
314 $(eval
$(call BuildPlugin
,apache
,apache status input
,apache
,+PACKAGE_collectd-mod-apache
:libcurl
))
315 $(eval
$(call BuildPlugin
,apcups
,apcups status input
,apcups
,))
316 $(eval
$(call BuildPlugin
,ascent
,ascent status input
,ascent
,+PACKAGE_collectd-mod-ascent
:libcurl
+PACKAGE_collectd-mod-ascent
:libxml2
))
317 $(eval
$(call BuildPlugin
,bind
,BIND server
/zone input
,bind
,+PACKAGE_collectd-mod-bind
:libcurl
+PACKAGE_collectd-mod-bind
:libxml2
))
318 $(eval
$(call BuildPlugin
,chrony
,chrony status input
,chrony
,))
319 $(eval
$(call BuildPlugin
,conntrack
,connection tracking table size input
,conntrack
,))
320 $(eval
$(call BuildPlugin
,contextswitch
,context switch input
,contextswitch
,))
321 $(eval
$(call BuildPlugin
,cpu
,CPU input
,cpu
,))
322 $(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
323 $(eval
$(call BuildPlugin
,csv
,CSV output
,csv
,))
324 $(eval
$(call BuildPlugin
,curl
,cURL input
,curl
,+PACKAGE_collectd-mod-curl
:libcurl
))
325 #$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
326 $(eval
$(call BuildPlugin
,df
,disk space input
,df
,))
327 $(eval
$(call BuildPlugin
,disk
,disk usage
/timing input
,disk
,))
328 $(eval
$(call BuildPlugin
,dns
,DNS traffic input
,dns
,+PACKAGE_collectd-mod-dns
:libpcap
))
329 $(eval
$(call BuildPlugin
,email
,email output
,email
,))
330 $(eval
$(call BuildPlugin
,entropy
,Entropy amount input
,entropy
,))
331 $(eval
$(call BuildPlugin
,exec
,process exec input
,exec
,))
332 $(eval
$(call BuildPlugin
,filecount
,file count input
,filecount
,))
333 $(eval
$(call BuildPlugin
,fscache
,file-system based caching framework input
,fscache
,))
334 $(eval
$(call BuildPlugin
,interface
,network interfaces input
,interface
,))
335 $(eval
$(call BuildPlugin
,iptables
,iptables status input
,iptables
,+PACKAGE_collectd-mod-iptables
:iptables
+libiptc
))
336 $(eval
$(call BuildPlugin
,irq
,interrupt usage input
,irq
,))
337 $(eval
$(call BuildPlugin
,iwinfo
,libiwinfo wireless statistics
,iwinfo
,+PACKAGE_collectd-mod-iwinfo
:libiwinfo
))
338 $(eval
$(call BuildPlugin
,load
,system load input
,load
,))
339 $(eval
$(call BuildPlugin
,logfile
,log files output
,logfile
,))
340 $(eval
$(call BuildPlugin
,match-empty-counter
,empty-counter match
,match_empty_counter
,))
341 $(eval
$(call BuildPlugin
,match-hashed
,hashed match
,match_hashed
,))
342 $(eval
$(call BuildPlugin
,match-regex
,regex match
,match_regex
,))
343 $(eval
$(call BuildPlugin
,match-timediff
,timediff match
,match_timediff
,))
344 $(eval
$(call BuildPlugin
,match-value
,value match
,match_value
,))
345 #$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
346 $(eval
$(call BuildPlugin
,memory
,physical memory usage input
,memory
,))
347 $(eval
$(call BuildPlugin
,modbus
,read variables through libmodbus
,modbus
,+PACKAGE_collectd-mod-modbus
:libmodbus
))
348 $(eval
$(call BuildPlugin
,netlink
,netlink input
,netlink
,+PACKAGE_collectd-mod-netlink
:libmnl
))
349 $(eval
$(call BuildPlugin
,network
,network input
/output
,network
,))
350 $(eval
$(call BuildPlugin
,nginx
,nginx status input
,nginx
,+PACKAGE_collectd-mod-nginx
:libcurl
))
351 $(eval
$(call BuildPlugin
,ntpd
,NTP daemon status input
,ntpd
,))
352 $(eval
$(call BuildPlugin
,nut
,UPS monitoring input
,nut
,+PACKAGE_collectd-mod-nut
:nut-common
))
353 $(eval
$(call BuildPlugin
,olsrd
,OLSRd status input
,olsrd
,))
354 $(eval
$(call BuildPlugin
,onewire
,onewire sensor input
,onewire
,+PACKAGE_collectd-mod-onewire
:libow-capi @BROKEN
))
355 $(eval
$(call BuildPlugin
,openvpn
,OpenVPN traffic
/compression input
,openvpn
,))
356 $(eval
$(call BuildPlugin
,ping
,ping status input
,ping
,+PACKAGE_collectd-mod-ping
:liboping
))
357 $(eval
$(call BuildPlugin
,postgresql
,PostgreSQL status input
,postgresql
,+PACKAGE_collectd-mod-postgresql
:libpq
))
358 $(eval
$(call BuildPlugin
,powerdns
,PowerDNS server status input
,powerdns
,))
359 $(eval
$(call BuildPlugin
,processes
,process status input
,processes
,))
360 $(eval
$(call BuildPlugin
,protocols
,network protocols input
,protocols
,))
361 $(eval
$(call BuildPlugin
,rrdtool
,RRDtool output
,rrdtool
,+PACKAGE_collectd-mod-rrdtool
:librrd1
))
362 $(eval
$(call BuildPlugin
,sensors
,lm_sensors input
,sensors
,+PACKAGE_collectd-mod-sensors
:libsensors
))
363 $(eval
$(call BuildPlugin
,snmp
,SNMP input
,snmp
,+PACKAGE_collectd-mod-snmp
:libnetsnmp
))
364 $(eval
$(call BuildPlugin
,syslog
,syslog output
,syslog
,))
365 $(eval
$(call BuildPlugin
,tail
,tail input
,tail
,))
366 $(eval
$(call BuildPlugin
,tail-csv
,tail CSV input
,tail_csv
,))
367 $(eval
$(call BuildPlugin
,table
,table-like structured file input
,table
,))
368 $(eval
$(call BuildPlugin
,teamspeak2
,TeamSpeak2 input
,teamspeak2
,))
369 $(eval
$(call BuildPlugin
,ted
,The Energy Detective input
,ted
,@
((!TARGET_avr32
)||BROKEN
))) # fails on avr32 because of warnings treated as errors
370 $(eval
$(call BuildPlugin
,tcpconns
,TCP connection tracking input
,tcpconns
,))
371 $(eval
$(call BuildPlugin
,thermal
,system temperatures input
,thermal
,))
372 $(eval
$(call BuildPlugin
,unixsock
,unix socket output
,unixsock
,))
373 $(eval
$(call BuildPlugin
,uptime
,uptime status input
,uptime
,))
374 $(eval
$(call BuildPlugin
,users
,user logged in status input
,users
,))
375 $(eval
$(call BuildPlugin
,vmem
,virtual memory usage input
,vmem
,))
376 $(eval
$(call BuildPlugin
,wireless
,wireless status input
,wireless
,))
377 $(eval
$(call BuildPlugin
,write-graphite
,Carbon
/Graphite output
,write_graphite
,+PACKAGE_collectd-mod-write-graphite
:libpthread
))
378 $(eval
$(call BuildPlugin
,write-http
,HTTP POST output
,write_http
,+PACKAGE_collectd-mod-write-http
:libcurl
))