1 ################################################################################
5 ################################################################################
7 COLLECTD_VERSION
= 5.7.1
8 COLLECTD_SITE
= http
://collectd.org
/files
9 COLLECTD_SOURCE
= collectd-
$(COLLECTD_VERSION
).
tar.bz2
10 COLLECTD_CONF_ENV
= ac_cv_lib_yajl_yajl_alloc
=yes
11 COLLECTD_INSTALL_STAGING
= YES
12 COLLECTD_LICENSE
= GPLv2
, LGPLv2.1
13 COLLECTD_LICENSE_FILES
= COPYING
15 # These require unmet dependencies, are fringe, pointless or deprecated
16 COLLECTD_PLUGINS_DISABLE
= \
17 amqp apple_sensors aquaero ascent barometer dbi dpdkstat email \
18 gmond grpc hddtemp intel_rdt ipmi java libvirt lpar lvm \
19 madwifi mbmon mic multimeter netapp notify_desktop numa \
20 nut onewire oracle perl pf pinba powerdns python redis routeros \
21 rrdcached sigrok tape target_v5upgrade teamspeak2 ted \
22 tokyotyrant turbostat uuid varnish virt vserver write_kafka \
23 write_mongodb write_redis xencpu xmms zfs_arc zone
25 COLLECTD_CONF_ENV
+= LIBS
="-lm"
27 COLLECTD_CONF_OPTS
+= \
28 --with-nan-emulation \
29 --with-fp-layout
=nothing \
30 --with-perl-bindings
=no \
31 $(foreach p
, $(COLLECTD_PLUGINS_DISABLE
), --disable-
$(p
)) \
32 $(if
$(BR2_PACKAGE_COLLECTD_AGGREGATION
),--enable-aggregation
,--disable-aggregation
) \
33 $(if
$(BR2_PACKAGE_COLLECTD_APACHE
),--enable-apache
,--disable-apache
) \
34 $(if
$(BR2_PACKAGE_COLLECTD_APCUPS
),--enable-apcups
,--disable-apcups
) \
35 $(if
$(BR2_PACKAGE_COLLECTD_BATTERY
),--enable-battery
,--disable-battery
) \
36 $(if
$(BR2_PACKAGE_COLLECTD_BIND
),--enable-bind
,--disable-bind
) \
37 $(if
$(BR2_PACKAGE_COLLECTD_CEPH
),--enable-ceph
,--disable-ceph
) \
38 $(if
$(BR2_PACKAGE_COLLECTD_CHRONY
),--enable-chrony
,--disable-chrony
) \
39 $(if
$(BR2_PACKAGE_COLLECTD_CGROUPS
),--enable-cgroups
,--disable-cgroups
) \
40 $(if
$(BR2_PACKAGE_COLLECTD_CONNTRACK
),--enable-conntrack
,--disable-conntrack
) \
41 $(if
$(BR2_PACKAGE_COLLECTD_CONTEXTSWITCH
),--enable-contextswitch
,--disable-contextswitch
) \
42 $(if
$(BR2_PACKAGE_COLLECTD_CPU
),--enable-cpu
,--disable-cpu
) \
43 $(if
$(BR2_PACKAGE_COLLECTD_CPUFREQ
),--enable-cpufreq
,--disable-cpufreq
) \
44 $(if
$(BR2_PACKAGE_COLLECTD_CPUSLEEP
),--enable-cpusleep
,--disable-cpusleep
) \
45 $(if
$(BR2_PACKAGE_COLLECTD_CSV
),--enable-csv
,--disable-csv
) \
46 $(if
$(BR2_PACKAGE_COLLECTD_CURL
),--enable-curl
,--disable-curl
) \
47 $(if
$(BR2_PACKAGE_COLLECTD_CURL_JSON
),--enable-curl_json
,--disable-curl_json
) \
48 $(if
$(BR2_PACKAGE_COLLECTD_CURL_XML
),--enable-curl_xml
,--disable-curl_xml
) \
49 $(if
$(BR2_PACKAGE_COLLECTD_DF
),--enable-df
,--disable-df
) \
50 $(if
$(BR2_PACKAGE_COLLECTD_DISK
),--enable-disk
,--disable-disk
) \
51 $(if
$(BR2_PACKAGE_COLLECTD_DNS
),--enable-dns
,--disable-dns
) \
52 $(if
$(BR2_PACKAGE_COLLECTD_DRBD
),--enable-drbd
,--disable-drbd
) \
53 $(if
$(BR2_PACKAGE_COLLECTD_EMPTY_COUNTER
),--enable-match_empty_counter
,--disable-match_empty_counter
) \
54 $(if
$(BR2_PACKAGE_COLLECTD_ENTROPY
),--enable-entropy
,--disable-entropy
) \
55 $(if
$(BR2_PACKAGE_COLLECTD_ETHSTAT
),--enable-ethstat
,--disable-ethstat
) \
56 $(if
$(BR2_PACKAGE_COLLECTD_EXEC
),--enable-exec
,--disable-exec
) \
57 $(if
$(BR2_PACKAGE_COLLECTD_FHCOUNT
),--enable-fhcount
,--disable-fhcount
) \
58 $(if
$(BR2_PACKAGE_COLLECTD_FILECOUNT
),--enable-filecount
,--disable-filecount
) \
59 $(if
$(BR2_PACKAGE_COLLECTD_FSCACHE
),--enable-fscache
,--disable-fscache
) \
60 $(if
$(BR2_PACKAGE_COLLECTD_GPS
),--enable-gps
,--disable-gps
) \
61 $(if
$(BR2_PACKAGE_COLLECTD_GRAPHITE
),--enable-write_graphite
,--disable-write_graphite
) \
62 $(if
$(BR2_PACKAGE_COLLECTD_HASHED
),--enable-match_hashed
,--disable-match_hashed
) \
63 $(if
$(BR2_PACKAGE_COLLECTD_HUGEPAGES
),--enable-hugepages
,--disable-hugepages
) \
64 $(if
$(BR2_PACKAGE_COLLECTD_INTERFACE
),--enable-interface
,--disable-interface
) \
65 $(if
$(BR2_PACKAGE_COLLECTD_IPC
),--enable-ipc
,--disable-ipc
) \
66 $(if
$(BR2_PACKAGE_COLLECTD_IPTABLES
),--enable-iptables
,--disable-iptables
) \
67 $(if
$(BR2_PACKAGE_COLLECTD_IPVS
),--enable-ipvs
,--disable-ipvs
) \
68 $(if
$(BR2_PACKAGE_COLLECTD_IRQ
),--enable-irq
,--disable-irq
) \
69 $(if
$(BR2_PACKAGE_COLLECTD_LOAD
),--enable-load
,--disable-load
) \
70 $(if
$(BR2_PACKAGE_COLLECTD_LOGFILE
),--enable-logfile
,--disable-logfile
) \
71 $(if
$(BR2_PACKAGE_COLLECTD_LOGSTASH
),--enable-log_logstash
,--disable-log_logstash
) \
72 $(if
$(BR2_PACKAGE_COLLECTD_MD
),--enable-md
,--disable-md
) \
73 $(if
$(BR2_PACKAGE_COLLECTD_MEMCACHEC
),--enable-memcachec
,--disable-memcachec
) \
74 $(if
$(BR2_PACKAGE_COLLECTD_MEMCACHED
),--enable-memcached
,--disable-memcached
) \
75 $(if
$(BR2_PACKAGE_COLLECTD_MEMORY
),--enable-memory
,--disable-memory
) \
76 $(if
$(BR2_PACKAGE_COLLECTD_MODBUS
),--enable-modbus
,--disable-modbus
) \
77 $(if
$(BR2_PACKAGE_COLLECTD_MQTT
),--enable-mqtt
,--disable-mqtt
) \
78 $(if
$(BR2_PACKAGE_COLLECTD_MYSQL
),--enable-mysql
,--disable-mysql
) \
79 $(if
$(BR2_PACKAGE_COLLECTD_NETLINK
),--enable-netlink
,--disable-netlink
) \
80 $(if
$(BR2_PACKAGE_COLLECTD_NETWORK
),--enable-network
,--disable-network
) \
81 $(if
$(BR2_PACKAGE_COLLECTD_NFS
),--enable-nfs
,--disable-nfs
) \
82 $(if
$(BR2_PACKAGE_COLLECTD_NGINX
),--enable-nginx
,--disable-nginx
) \
83 $(if
$(BR2_PACKAGE_COLLECTD_NOTIFICATION
),--enable-target_notification
,--disable-target_notification
) \
84 $(if
$(BR2_PACKAGE_COLLECTD_NOTIFY_EMAIL
),--enable-notify_email
,--disable-notify_email
) \
85 $(if
$(BR2_PACKAGE_COLLECTD_NOTIFY_NAGIOS
),--enable-notify_nagios
,--disable-notify_nagios
) \
86 $(if
$(BR2_PACKAGE_COLLECTD_NTPD
),--enable-ntpd
,--disable-ntpd
) \
87 $(if
$(BR2_PACKAGE_COLLECTD_OLSRD
),--enable-olsrd
,--disable-olsrd
) \
88 $(if
$(BR2_PACKAGE_COLLECTD_OPENLDAP
),--enable-openldap
,--disable-openldap
) \
89 $(if
$(BR2_PACKAGE_COLLECTD_OPENVPN
),--enable-openvpn
,--disable-openvpn
) \
90 $(if
$(BR2_PACKAGE_COLLECTD_PING
),--enable-ping
,--disable-ping
) \
91 $(if
$(BR2_PACKAGE_COLLECTD_POSTGRESQL
),--enable-postgresql
,--disable-postgresql
) \
92 $(if
$(BR2_PACKAGE_COLLECTD_PROCESSES
),--enable-processes
,--disable-processes
) \
93 $(if
$(BR2_PACKAGE_COLLECTD_PROTOCOLS
),--enable-protocols
,--disable-protocols
) \
94 $(if
$(BR2_PACKAGE_COLLECTD_REGEX
),--enable-match_regex
,--disable-match-regex
) \
95 $(if
$(BR2_PACKAGE_COLLECTD_REPLACE
),--enable-target_replace
,--disable-target_replace
) \
96 $(if
$(BR2_PACKAGE_COLLECTD_RIEMANN
),--enable-write_riemann
,--disable-write_riemann
) \
97 $(if
$(BR2_PACKAGE_COLLECTD_RRDTOOL
),--enable-rrdtool
,--disable-rrdtool
) \
98 $(if
$(BR2_PACKAGE_COLLECTD_SCALE
),--enable-target_scale
,--disable-target_scale
) \
99 $(if
$(BR2_PACKAGE_COLLECTD_SENSORS
),--enable-sensors
,--disable-sensors
) \
100 $(if
$(BR2_PACKAGE_COLLECTD_SERIAL
),--enable-serial
,--disable-serial
) \
101 $(if
$(BR2_PACKAGE_COLLECTD_STATSD
),--enable-statsd
,--disable-statsd
) \
102 $(if
$(BR2_PACKAGE_COLLECTD_SET
),--enable-target_set
,--disable-target_set
) \
103 $(if
$(BR2_PACKAGE_COLLECTD_SMART
),--enable-smart
,--disable-smart
) \
104 $(if
$(BR2_PACKAGE_COLLECTD_SNMP
),--enable-snmp
,--disable-snmp
) \
105 $(if
$(BR2_PACKAGE_COLLECTD_SWAP
),--enable-swap
,--disable-swap
) \
106 $(if
$(BR2_PACKAGE_COLLECTD_SYSLOG
),--enable-syslog
,--disable-syslog
) \
107 $(if
$(BR2_PACKAGE_COLLECTD_TABLE
),--enable-table
,--disable-table
) \
108 $(if
$(BR2_PACKAGE_COLLECTD_TAIL
),--enable-tail
,--disable-tail
) \
109 $(if
$(BR2_PACKAGE_COLLECTD_TAIL_CSV
),--enable-tail_csv
,--disable-tail_csv
) \
110 $(if
$(BR2_PACKAGE_COLLECTD_TCPCONNS
),--enable-tcpconns
,--disable-tcpconns
) \
111 $(if
$(BR2_PACKAGE_COLLECTD_THERMAL
),--enable-thermal
,--disable-thermal
) \
112 $(if
$(BR2_PACKAGE_COLLECTD_THRESHOLD
),--enable-threshold
,--disable-threshold
) \
113 $(if
$(BR2_PACKAGE_COLLECTD_TIMEDIFF
),--enable-match_timediff
,--disable-match_timediff
) \
114 $(if
$(BR2_PACKAGE_COLLECTD_UNIXSOCK
),--enable-unixsock
,--disable-unixsock
) \
115 $(if
$(BR2_PACKAGE_COLLECTD_UPTIME
),--enable-uptime
,--disable-uptime
) \
116 $(if
$(BR2_PACKAGE_COLLECTD_USERS
),--enable-users
,--disable-users
) \
117 $(if
$(BR2_PACKAGE_COLLECTD_VALUE
),--enable-match_value
,--disable-match_value
) \
118 $(if
$(BR2_PACKAGE_COLLECTD_VMEM
),--enable-vmem
,--disable-vmem
) \
119 $(if
$(BR2_PACKAGE_COLLECTD_WIRELESS
),--enable-wireless
,--disable-wireless
) \
120 $(if
$(BR2_PACKAGE_COLLECTD_WRITEHTTP
),--enable-write_http
,--disable-write_http
) \
121 $(if
$(BR2_PACKAGE_COLLECTD_WRITELOG
),--enable-write_log
,--disable-write_log
) \
122 $(if
$(BR2_PACKAGE_COLLECTD_WRITEPROMETHEUS
),--enable-write_prometheus
,--disable-write_prometheus
) \
123 $(if
$(BR2_PACKAGE_COLLECTD_WRITESENSU
),--enable-write_sensu
,--disable-write_sensu
) \
124 $(if
$(BR2_PACKAGE_COLLECTD_WRITETSDB
),--enable-write_tsdb
,--disable-write_tsdb
) \
125 $(if
$(BR2_PACKAGE_COLLECTD_ZOOKEEPER
),--enable-zookeeper
,--disable-zookeeper
)
127 COLLECTD_DEPENDENCIES
= \
129 $(if
$(BR2_PACKAGE_COLLECTD_APACHE
),libcurl
) \
130 $(if
$(BR2_PACKAGE_COLLECTD_BIND
),libcurl libxml2
) \
131 $(if
$(BR2_PACKAGE_COLLECTD_CEPH
),yajl
) \
132 $(if
$(BR2_PACKAGE_COLLECTD_CURL
),libcurl
) \
133 $(if
$(BR2_PACKAGE_COLLECTD_CURL_JSON
),libcurl yajl
) \
134 $(if
$(BR2_PACKAGE_COLLECTD_CURL_XML
),libcurl libxml2
) \
135 $(if
$(BR2_PACKAGE_COLLECTD_DNS
),libpcap
) \
136 $(if
$(BR2_PACKAGE_COLLECTD_GPS
),gpsd
) \
137 $(if
$(BR2_PACKAGE_COLLECTD_IPTABLES
),iptables
) \
138 $(if
$(BR2_PACKAGE_COLLECTD_LOGSTASH
),yajl
) \
139 $(if
$(BR2_PACKAGE_COLLECTD_MEMCACHEC
),libmemcached
) \
140 $(if
$(BR2_PACKAGE_COLLECTD_MODBUS
),libmodbus
) \
141 $(if
$(BR2_PACKAGE_COLLECTD_MQTT
),mosquitto
) \
142 $(if
$(BR2_PACKAGE_COLLECTD_MYSQL
),mysql
) \
143 $(if
$(BR2_PACKAGE_COLLECTD_NETLINK
),libmnl
) \
144 $(if
$(BR2_PACKAGE_COLLECTD_NGINX
),libcurl
) \
145 $(if
$(BR2_PACKAGE_COLLECTD_NOTIFY_EMAIL
),libesmtp
) \
146 $(if
$(BR2_PACKAGE_COLLECTD_OPENLDAP
),openldap
) \
147 $(if
$(BR2_PACKAGE_COLLECTD_PING
),liboping
) \
148 $(if
$(BR2_PACKAGE_COLLECTD_POSTGRESQL
),postgresql
) \
149 $(if
$(BR2_PACKAGE_COLLECTD_RIEMANN
),libtool riemann-c-client
) \
150 $(if
$(BR2_PACKAGE_COLLECTD_RRDTOOL
),rrdtool
) \
151 $(if
$(BR2_PACKAGE_COLLECTD_SENSORS
),lm-sensors
) \
152 $(if
$(BR2_PACKAGE_COLLECTD_SMART
),libatasmart
) \
153 $(if
$(BR2_PACKAGE_COLLECTD_SNMP
),netsnmp
) \
154 $(if
$(BR2_PACKAGE_COLLECTD_WRITEHTTP
),libcurl
) \
155 $(if
$(BR2_PACKAGE_COLLECTD_WRITEPROMETHEUS
),libmicrohttpd protobuf-c
)
157 # include/library fixups
158 ifeq ($(BR2_PACKAGE_LIBCURL
),y
)
159 COLLECTD_CONF_OPTS
+= --with-libcurl
=$(STAGING_DIR
)/usr
161 ifeq ($(BR2_PACKAGE_MYSQL
),y
)
162 COLLECTD_CONF_OPTS
+= --with-libmysql
=$(STAGING_DIR
)/usr
164 ifeq ($(BR2_PACKAGE_NETSNMP
),y
)
165 COLLECTD_CONF_OPTS
+= --with-libnetsnmp
=$(STAGING_DIR
)/usr
167 ifeq ($(BR2_PACKAGE_POSTGRESQL
),y
)
168 COLLECTD_CONF_OPTS
+= --with-libpq
=$(STAGING_DIR
)/usr
/bin
/pg_config
169 COLLECTD_CONF_ENV
+= LIBS
="-lpthread -lm"
171 ifeq ($(BR2_PACKAGE_YAJL
),y
)
172 COLLECTD_CONF_OPTS
+= --with-yajl
=$(STAGING_DIR
)/usr
175 # network can use libgcrypt
176 ifeq ($(BR2_PACKAGE_LIBGCRYPT
),y
)
177 COLLECTD_DEPENDENCIES
+= libgcrypt
178 COLLECTD_CONF_OPTS
+= --with-libgcrypt
=$(STAGING_DIR
)/usr
/bin
/libgcrypt-config
180 COLLECTD_CONF_OPTS
+= --with-libgcrypt
=no
183 # released software should not break on minor warnings
184 define COLLECTD_DROP_WERROR
185 $(SED
) 's/-Werror//' \
186 $(@D
)/src
/Makefile.in
$(@D
)/src
/libcollectdclient
/Makefile.in
189 COLLECTD_POST_PATCH_HOOKS
+= COLLECTD_DROP_WERROR
191 define COLLECTD_INSTALL_TARGET_CMDS
192 $(TARGET_MAKE_ENV
) $(MAKE
) DESTDIR
=$(TARGET_DIR
) -C
$(@D
) install
193 rm -f
$(TARGET_DIR
)/usr
/bin
/collectd-nagios
194 rm -f
$(TARGET_DIR
)/usr
/share
/collectd
/postgresql_default.conf
197 define COLLECTD_INSTALL_INIT_SYSTEMD
198 $(INSTALL
) -D
-m
644 package
/collectd
/collectd.service \
199 $(TARGET_DIR
)/usr
/lib
/systemd
/system
/collectd.service
200 mkdir
-p
$(TARGET_DIR
)/etc
/systemd
/system
/multi-user.target.wants
201 ln
-fs ..
/..
/..
/..
/usr
/lib
/systemd
/system
/collectd.service \
202 $(TARGET_DIR
)/etc
/systemd
/system
/multi-user.target.wants
/collectd.service
205 $(eval
$(autotools-package
))