[packages_10.03.1] collectd: backport r29404
[openwrt/svn-archive/archive.git] / utils / collectd / Makefile
index 6119572b7776f64380f6685b75f006b9139381f3..06710cc006fcce168f83b461a746c609244aed20 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,15 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=collectd
-PKG_VERSION:=4.9.1
-PKG_RELEASE:=2
+PKG_VERSION:=4.10.2
+PKG_RELEASE:=2.1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://collectd.org/files/
-PKG_MD5SUM:=5753496651c8c84afaea1fe290876bfc
+PKG_MD5SUM:=85d9d8d0a1327782661e3c89800aa70e
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
 
-PKG_FIXUP:=libtool
 PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
 
 COLLECTD_PLUGINS_DISABLED:= \
        apple_sensors \
@@ -43,6 +46,7 @@ COLLECTD_PLUGINS_DISABLED:= \
        openvz \
        oracle \
        perl \
+       pinba \
        python \
        routeros \
        rrdcached \
@@ -76,10 +80,12 @@ COLLECTD_PLUGINS_SELECTED:= \
        interface \
        iptables \
        irq \
+       iwinfo \
        load \
        logfile \
        madwifi \
        memory \
+       modbus \
        mysql \
        netlink \
        network \
@@ -126,7 +132,7 @@ endef
 
 define Package/collectd
 $(call Package/collectd/Default)
-  DEPENDS:= +libpthread +zlib
+  DEPENDS:= +libpthread +zlib +libltdl
   MENU:=1
 endef
 
@@ -135,6 +141,8 @@ define Package/collectd/description
  and provides mechanismns to store the values in a variety of ways.
 endef
 
+TARGET_CFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
 ifneq ($(CONFIG_avr32),)
   TARGET_CFLAGS += -fsigned-char
 endif
@@ -145,7 +153,6 @@ CONFIGURE_ARGS+= \
        --enable-daemon \
        --enable-getifaddrs \
        --with-nan-emulation \
-       --with-fp-layout=nothing
 
 CONFIGURE_VARS+= \
        CFLAGS="$$$$CFLAGS $(FPIC)" \
@@ -167,6 +174,16 @@ ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),)
        CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
 endif
 
+ifneq ($(CONFIG_BIG_ENDIAN),)
+  CONFIGURE_ARGS+= --with-fp-layout=endianflip
+else
+  CONFIGURE_ARGS+= --with-fp-layout=nothing
+endif
+
+ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),)
+  CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/"
+endif
+
 ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),)
   CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/"
 endif
@@ -176,6 +193,11 @@ ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
   CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr"
 endif
 
+# exception: mod-modbus needs libmodbus
+ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),)
+  CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr"
+endif
+
 # exception: mod-onewire needs libow-capi
 ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),)
   CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr"
@@ -251,11 +273,13 @@ $(eval $(call BuildPlugin,fscache,file-system based caching framework input,fsca
 $(eval $(call BuildPlugin,interface,network interfaces input,interface,))
 $(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables @(!LINUX_2_4||BROKEN)))
 $(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
+$(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo))
 $(eval $(call BuildPlugin,load,system load input,load,))
 $(eval $(call BuildPlugin,logfile,log files output,logfile,))
 $(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,))
 $(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient))
 $(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
+$(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus))
 $(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:ip @(!LINUX_2_4||BROKEN)))
 $(eval $(call BuildPlugin,network,network input/output,network))
 $(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl))