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
:= \
170 PKG_CONFIG_DEPENDS
:= \
171 $(patsubst %,CONFIG_PACKAGE_collectd-mod-
%,$(subst _
,-,$(COLLECTD_PLUGINS_SELECTED
))) \
173 include $(INCLUDE_DIR
)/package.mk
174 include $(INCLUDE_DIR
)/kernel.mk
176 define Package
/collectd
/Default
179 TITLE
:=Lightweight system statistics collection daemon
180 URL
:=https
://collectd.org
/
183 define Package
/collectd
184 $(call Package
/collectd
/Default
)
185 DEPENDS
:= +libpthread
+zlib
+libltdl
+libip4tc
189 define Package
/collectd
/description
190 collectd is a small daemon which collects system information periodically
191 and provides mechanismns to store the values in a variety of ways.
194 ifneq ($(CONFIG_avr32
),)
195 TARGET_CFLAGS
+= -fsigned-char
198 # common configure args
203 --with-nan-emulation \
205 --without-libgcrypt \
206 --without-perl-bindings \
210 CFLAGS
="$$$$CFLAGS $(FPIC)" \
211 LDFLAGS
="$$$$LDFLAGS -lm -lz" \
212 KERNEL_DIR
="$(LINUX_DIR)" \
216 $(if
$(CONFIG_PACKAGE_collectd-mod-
$(subst _
,-,$(m
))),--enable-
$(m
),--disable-
$(m
)) \
220 $(call CONFIGURE_PLUGIN
,$(COLLECTD_PLUGINS_SELECTED
)) \
221 $(call CONFIGURE_PLUGIN
,$(COLLECTD_PLUGINS_DISABLED
)) \
223 # exception: mod-ascent needs libxml2
224 ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent
),)
226 CPPFLAGS
="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
229 ifneq ($(CONFIG_BIG_ENDIAN
),)
230 CONFIGURE_ARGS
+= --with-fp-layout
=endianflip
232 CONFIGURE_ARGS
+= --with-fp-layout
=nothing
235 ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql
),)
236 CONFIGURE_ARGS
+= --with-libpq
="$(STAGING_DIR)/usr/"
239 ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql
),)
240 CONFIGURE_ARGS
+= --with-libmysql
="$(STAGING_DIR)/usr/"
243 # exception: mod-netlink needs libnetlink from iproute
244 ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink
),)
245 CONFIGURE_ARGS
+= --with-libnetlink
="$(STAGING_DIR)/usr"
248 # exception: mod-modbus needs libmodbus
249 ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus
),)
250 CONFIGURE_ARGS
+= --with-libmodbus
="$(STAGING_DIR)/usr"
253 # exception: mod-onewire needs libow-capi
254 ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire
),)
255 CONFIGURE_ARGS
+= --with-libowcapi
="$(STAGING_DIR)/usr"
258 # exception: mod-rrdtool needs rrdtool-1.0.x
259 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool
),)
260 CONFIGURE_ARGS
+= --with-librrd
="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
263 define Package
/collectd
/conffiles
267 define Package
/collectd
/install
268 $(INSTALL_DIR
) $(1)/usr
/sbin
269 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/collectd
$(1)/usr
/sbin
/
270 $(INSTALL_DIR
) $(1)/usr
/share
/collectd
271 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/share
/collectd
/types.db
$(1)/usr
/share
/collectd
/
272 $(INSTALL_DIR
) $(1)/etc
273 $(INSTALL_CONF
) .
/files
/collectd.conf
$(1)/etc
/
274 $(INSTALL_DIR
) $(1)/etc
/init.d
275 $(INSTALL_BIN
) .
/files
/collectd.init
$(1)/etc
/init.d
/collectd
276 $(INSTALL_DIR
) $(1)/etc
/collectd
/conf.d
280 # 2: plugin title/description
282 # 4: extra dependency
285 PKG_CONFIG_DEPENDS
+= CONFIG_PACKAGE_collectd-mod-
$(1)
287 define Package
/collectd-mod-
$(1)
288 $$(call Package
/collectd
/Default
)
290 DEPENDS
:= collectd
$(4)
293 define Package
/collectd-mod-
$(1)/install
294 $(INSTALL_DIR
) $$(1)/usr
/lib
/collectd
297 $(PKG_INSTALL_DIR
)/usr
/lib
/collectd
/$$$$$$$${m}.so \
298 $$(1)/usr
/lib
/collectd
/ ; \
302 $$(eval
$$(call BuildPackage
,collectd-mod-
$(1)))
306 $(eval
$(call BuildPackage
,collectd
))
308 #$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES))
309 $(eval
$(call BuildPlugin
,apache
,apache status input
,apache
,+PACKAGE_collectd-mod-apache
:libcurl
))
310 $(eval
$(call BuildPlugin
,apcups
,apcups status input
,apcups
,))
311 $(eval
$(call BuildPlugin
,ascent
,ascent status input
,ascent
,+PACKAGE_collectd-mod-ascent
:libcurl
+PACKAGE_collectd-mod-ascent
:libxml2
))
312 $(eval
$(call BuildPlugin
,bind
,BIND server
/zone input
,bind
,+PACKAGE_collectd-mod-bind
:libcurl
+PACKAGE_collectd-mod-bind
:libxml2
))
313 $(eval
$(call BuildPlugin
,conntrack
,connection tracking table size input
,conntrack
,))
314 $(eval
$(call BuildPlugin
,contextswitch
,context switch input
,contextswitch
,))
315 $(eval
$(call BuildPlugin
,cpu
,CPU input
,cpu
,))
316 $(eval
$(call BuildPlugin
,cpufreq
,CPU Freq input
,cpufreq
,@
(TARGET_x86||TARGET_x86_64||TARGET_mvebu||TARGET_ipq806x
))) # Only enable on x86 mvebu and ipq806x
317 $(eval
$(call BuildPlugin
,csv
,CSV output
,csv
,))
318 $(eval
$(call BuildPlugin
,curl
,cURL input
,curl
,+PACKAGE_collectd-mod-curl
:libcurl
))
319 #$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
320 $(eval
$(call BuildPlugin
,df
,disk space input
,df
,))
321 $(eval
$(call BuildPlugin
,disk
,disk usage
/timing input
,disk
,))
322 $(eval
$(call BuildPlugin
,dns
,DNS traffic input
,dns
,+PACKAGE_collectd-mod-dns
:libpcap
))
323 $(eval
$(call BuildPlugin
,email
,email output
,email
,))
324 $(eval
$(call BuildPlugin
,entropy
,Entropy amount input
,entropy
,))
325 $(eval
$(call BuildPlugin
,exec
,process exec input
,exec
,))
326 $(eval
$(call BuildPlugin
,filecount
,file count input
,filecount
,))
327 $(eval
$(call BuildPlugin
,fscache
,file-system based caching framework input
,fscache
,))
328 $(eval
$(call BuildPlugin
,interface
,network interfaces input
,interface
,))
329 $(eval
$(call BuildPlugin
,iptables
,iptables status input
,iptables
,+PACKAGE_collectd-mod-iptables
:iptables
+libiptc
))
330 $(eval
$(call BuildPlugin
,irq
,interrupt usage input
,irq
,))
331 $(eval
$(call BuildPlugin
,iwinfo
,libiwinfo wireless statistics
,iwinfo
,+PACKAGE_collectd-mod-iwinfo
:libiwinfo
))
332 $(eval
$(call BuildPlugin
,load
,system load input
,load
,))
333 $(eval
$(call BuildPlugin
,logfile
,log files output
,logfile
,))
334 $(eval
$(call BuildPlugin
,madwifi
,MadWifi status input
,madwifi
,))
335 #$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
336 $(eval
$(call BuildPlugin
,memory
,physical memory usage input
,memory
,))
337 $(eval
$(call BuildPlugin
,modbus
,read variables through libmodbus
,modbus
,+PACKAGE_collectd-mod-modbus
:libmodbus
))
338 $(eval
$(call BuildPlugin
,netlink
,netlink input
,netlink
,+PACKAGE_collectd-mod-netlink
:libmnl
))
339 $(eval
$(call BuildPlugin
,network
,network input
/output
,network
,))
340 $(eval
$(call BuildPlugin
,nginx
,nginx status input
,nginx
,+PACKAGE_collectd-mod-nginx
:libcurl
))
341 $(eval
$(call BuildPlugin
,ntpd
,NTP daemon status input
,ntpd
,))
342 $(eval
$(call BuildPlugin
,nut
,UPS monitoring input
,nut
,+PACKAGE_collectd-mod-nut
:nut-common
))
343 $(eval
$(call BuildPlugin
,olsrd
,OLSRd status input
,olsrd
,))
344 $(eval
$(call BuildPlugin
,onewire
,onewire sensor input
,onewire
,+PACKAGE_collectd-mod-onewire
:libow-capi @BROKEN
))
345 $(eval
$(call BuildPlugin
,openvpn
,OpenVPN traffic
/compression input
,openvpn
,))
346 $(eval
$(call BuildPlugin
,ping
,ping status input
,ping
,+PACKAGE_collectd-mod-ping
:liboping
))
347 $(eval
$(call BuildPlugin
,postgresql
,PostgreSQL status input
,postgresql
,+PACKAGE_collectd-mod-postgresql
:libpq
))
348 $(eval
$(call BuildPlugin
,powerdns
,PowerDNS server status input
,powerdns
,))
349 $(eval
$(call BuildPlugin
,processes
,process status input
,processes
,))
350 $(eval
$(call BuildPlugin
,protocols
,network protocols input
,protocols
,))
351 $(eval
$(call BuildPlugin
,rrdtool
,RRDtool output
,rrdtool
,+PACKAGE_collectd-mod-rrdtool
:librrd1
))
352 $(eval
$(call BuildPlugin
,sensors
,lm_sensors input
,sensors
,+PACKAGE_collectd-mod-sensors
:libsensors
))
353 $(eval
$(call BuildPlugin
,snmp
,SNMP input
,snmp
,+PACKAGE_collectd-mod-snmp
:libnetsnmp
))
354 $(eval
$(call BuildPlugin
,syslog
,syslog output
,syslog
,))
355 $(eval
$(call BuildPlugin
,tail
,tail input
,tail
,))
356 $(eval
$(call BuildPlugin
,tail-csv
,tail CSV input
,tail_csv
,))
357 $(eval
$(call BuildPlugin
,table
,table-like structured file input
,table
,))
358 $(eval
$(call BuildPlugin
,teamspeak2
,TeamSpeak2 input
,teamspeak2
,))
359 $(eval
$(call BuildPlugin
,ted
,The Energy Detective input
,ted
,@
((!TARGET_avr32
)||BROKEN
))) # fails on avr32 because of warnings treated as errors
360 $(eval
$(call BuildPlugin
,tcpconns
,TCP connection tracking input
,tcpconns
,))
361 $(eval
$(call BuildPlugin
,thermal
,system temperatures input
,thermal
,))
362 $(eval
$(call BuildPlugin
,unixsock
,unix socket output
,unixsock
,))
363 $(eval
$(call BuildPlugin
,uptime
,uptime status input
,uptime
,))
364 $(eval
$(call BuildPlugin
,users
,user logged in status input
,users
,))
365 $(eval
$(call BuildPlugin
,vmem
,virtual memory usage input
,vmem
,))
366 $(eval
$(call BuildPlugin
,wireless
,wireless status input
,wireless
,))
367 $(eval
$(call BuildPlugin
,write-graphite
,Carbon
/Graphite output
,write_graphite
,+PACKAGE_collectd-mod-write-graphite
:libpthread
))
368 $(eval
$(call BuildPlugin
,write-http
,HTTP POST output
,write_http
,+PACKAGE_collectd-mod-write-http
:libcurl
))