lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

Makefile (11317B)


      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.7.1
     12 PKG_RELEASE:=4
     13 
     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
     18 
     19 PKG_FIXUP:=autoreconf
     20 PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
     21 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>, Hannu Nyman <hannu.nyman@iki.fi>
     22 
     23 PKG_INSTALL:=1
     24 PKG_BUILD_PARALLEL:=1
     25 PKG_USE_MIPS16:=0
     26 
     27 COLLECTD_PLUGINS_DISABLED:= \
     28 	amqp \
     29 	apple_sensors \
     30 	aquaero \
     31 	barometer \
     32 	battery \
     33 	ceph \
     34 	cgroups \
     35 	cpusleep \
     36 	curl_json \
     37 	curl_xml \
     38 	dbi \
     39 	dpdkstat \
     40 	drbd \
     41 	ethstat \
     42 	fhcount \
     43 	genericjmx \
     44 	gmond \
     45 	gps \
     46 	grpc \
     47 	hddtemp \
     48 	hugepages \
     49 	intel_rdt \
     50 	ipc \
     51 	ipmi \
     52 	ipvs \
     53 	java \
     54 	log_logstash \
     55 	lua \
     56 	lvm \
     57 	lpar \
     58 	madwifi \
     59 	mbmon \
     60 	md \
     61 	memcachec \
     62 	memcached \
     63 	mic \
     64 	monitorus \
     65 	mqtt \
     66 	multimeter \
     67 	netapp \
     68 	nfs \
     69 	notify_desktop \
     70 	notify_email \
     71 	notify_nagios \
     72 	numa \
     73 	openldap \
     74 	openvz \
     75 	oracle \
     76 	perl \
     77 	pf \
     78 	pinba \
     79 	python \
     80 	redis \
     81 	routeros \
     82 	rrdcached \
     83 	serial \
     84 	sigrok \
     85 	smart \
     86 	statsd \
     87 	swap \
     88 	tape \
     89 	tokyotyrant \
     90 	turbostat \
     91 	uuid \
     92 	varnish \
     93 	virt \
     94 	vserver \
     95 	write_kafka \
     96 	write_log \
     97 	write_mongodb \
     98 	write_prometheus \
     99 	write_redis \
    100 	write_riemann \
    101 	write_sensu \
    102 	write_tsdb \
    103 	xencpu \
    104 	xmms \
    105 	zfs_arc \
    106 	zone \
    107 	zookeeper
    108 
    109 COLLECTD_PLUGINS_SELECTED:= \
    110 	apache \
    111 	apcups \
    112 	ascent \
    113 	bind \
    114 	chrony \
    115 	conntrack \
    116 	contextswitch \
    117 	cpu \
    118 	cpufreq \
    119 	csv \
    120 	curl \
    121 	df \
    122 	disk \
    123 	dns \
    124 	email \
    125 	entropy \
    126 	exec \
    127 	filecount \
    128 	fscache \
    129 	interface \
    130 	iptables \
    131 	irq \
    132 	iwinfo \
    133 	load \
    134 	logfile \
    135 	match_empty_counter \
    136 	match_hashed \
    137 	match_regex \
    138 	match_timediff \
    139 	match_value \
    140 	memory \
    141 	modbus \
    142 	mysql \
    143 	netlink \
    144 	network \
    145 	nginx \
    146 	ntpd \
    147 	nut \
    148 	olsrd \
    149 	onewire \
    150 	openvpn \
    151 	ping \
    152 	postgresql \
    153 	powerdns \
    154 	processes \
    155 	protocols \
    156 	rrdtool \
    157 	sensors \
    158 	snmp \
    159 	syslog \
    160 	table \
    161 	tail \
    162 	tail_csv \
    163 	tcpconns \
    164 	teamspeak2 \
    165 	ted \
    166 	thermal \
    167 	unixsock \
    168 	uptime \
    169 	users \
    170 	vmem \
    171 	wireless \
    172 	write_graphite \
    173 	write_http \
    174 
    175 PKG_CONFIG_DEPENDS:= \
    176 	$(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \
    177 
    178 include $(INCLUDE_DIR)/package.mk
    179 include $(INCLUDE_DIR)/kernel.mk
    180 
    181 define Package/collectd/Default
    182   SECTION:=utils
    183   CATEGORY:=Utilities
    184   TITLE:=Lightweight system statistics collection daemon
    185   URL:=https://collectd.org/
    186 endef
    187 
    188 define Package/collectd
    189 $(call Package/collectd/Default)
    190   DEPENDS:= +libpthread +zlib +libltdl +libip4tc
    191   MENU:=1
    192 endef
    193 
    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.
    197 endef
    198 
    199 ifneq ($(CONFIG_avr32),)
    200   TARGET_CFLAGS += -fsigned-char
    201 endif
    202 
    203 # common configure args
    204 CONFIGURE_ARGS+= \
    205 	--disable-werror \
    206 	--disable-debug \
    207 	--enable-daemon \
    208 	--with-nan-emulation \
    209 	--with-libyajl=no \
    210 	--without-libgcrypt \
    211 	--without-perl-bindings \
    212 	--without-libudev
    213 
    214 CONFIGURE_VARS+= \
    215 	CFLAGS="$$$$CFLAGS $(FPIC)" \
    216 	LDFLAGS="$$$$LDFLAGS -lm -lz" \
    217 	KERNEL_DIR="$(LINUX_DIR)" \
    218 
    219 CONFIGURE_PLUGIN= \
    220 	$(foreach m, $(1), \
    221 		$(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \
    222 	)
    223 
    224 CONFIGURE_ARGS+= \
    225 	$(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_SELECTED)) \
    226 	$(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_DISABLED)) \
    227 
    228 # exception: mod-ascent needs libxml2
    229 ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),)
    230   CONFIGURE_VARS+= \
    231 	CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
    232 endif
    233 
    234 ifneq ($(CONFIG_BIG_ENDIAN),)
    235   CONFIGURE_ARGS+= --with-fp-layout=endianflip
    236 else
    237   CONFIGURE_ARGS+= --with-fp-layout=nothing
    238 endif
    239 
    240 ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),)
    241   CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/"
    242 endif
    243 
    244 ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),)
    245   CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/"
    246 endif
    247 
    248 # exception: mod-netlink needs libnetlink from iproute
    249 ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
    250   CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr"
    251 endif
    252 
    253 # exception: mod-modbus needs libmodbus
    254 ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),)
    255   CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr"
    256 endif
    257 
    258 # exception: mod-onewire needs libow-capi
    259 ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),)
    260   CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr"
    261 endif
    262 
    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"
    266 endif
    267 
    268 define Package/collectd/conffiles
    269 /etc/collectd.conf
    270 endef
    271 
    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
    282 endef
    283 
    284 # 1: plugin name
    285 # 2: plugin title/description
    286 # 3: files
    287 # 4: extra dependency
    288 define BuildPlugin
    289 
    290   PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_collectd-mod-$(1)
    291 
    292   define Package/collectd-mod-$(1)
    293   $$(call Package/collectd/Default)
    294     TITLE:=$(2) plugin
    295     DEPENDS:= collectd $(4)
    296   endef
    297 
    298   define Package/collectd-mod-$(1)/install
    299 	$(INSTALL_DIR) $$(1)/usr/lib/collectd
    300 	for m in $(3); do \
    301 		$(CP) \
    302 			$(PKG_INSTALL_DIR)/usr/lib/collectd/$$$$$$$${m}.so \
    303 			$$(1)/usr/lib/collectd/ ; \
    304 	done
    305   endef
    306 
    307   $$(eval $$(call BuildPackage,collectd-mod-$(1)))
    308 
    309 endef
    310 
    311 $(eval $(call BuildPackage,collectd))
    312 
    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))) # Only enable on x86 mvebu and ipq806x
    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))