[packages] utils/collectd: Build fixes
authorSteven Barth <cyrus@openwrt.org>
Mon, 26 May 2008 19:51:00 +0000 (19:51 +0000)
committerSteven Barth <cyrus@openwrt.org>
Mon, 26 May 2008 19:51:00 +0000 (19:51 +0000)
Fixed Makefile to handle conflicting rrdtool packages
Added missing linking option to zlib for mod-rrdtool
Added compatibility code for brcm2.4 to mod-wireless

SVN-Revision: 11270

utils/collectd/Makefile
utils/collectd/patches/010-rrdtool-link-zlib.patch [new file with mode: 0644]
utils/collectd/patches/200-wireless-brcm2.4-compat.patch [new file with mode: 0644]

index 571eb96a778d2f186c57b94b6470235d4cca2076..69dada1461f3c31595b4e1cc2fd89866f1dd63ef 100644 (file)
@@ -305,6 +305,11 @@ endif
 # exception: mod-rrdtool(1) needs rrdtool
 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool1)$(CONFIG_PACKAGE_collectd-mod-rrdtool),)
        PKG_CONFIGURE_OPTS += --enable-rrdtool
+       ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool1),)
+               PKG_CONFIGURE_OPTS += --with-rrdtool=$(wildcard $(BUILD_DIR)/rrdtool-1.0.*)
+       else
+               PKG_CONFIGURE_OPTS += --with-rrdtool=$(wildcard $(BUILD_DIR)/rrdtool-1.2.*)
+       endif
 endif
 
 
diff --git a/utils/collectd/patches/010-rrdtool-link-zlib.patch b/utils/collectd/patches/010-rrdtool-link-zlib.patch
new file mode 100644 (file)
index 0000000..771f3ae
--- /dev/null
@@ -0,0 +1,11 @@
+--- collectd-4.4.0.orig/configure      2008-05-26 17:54:07.000000000 +0200
++++ collectd-4.4.0/configure   2008-05-26 19:10:23.000000000 +0200
+@@ -31551,7 +31551,7 @@
+   withval=$with_rrdtool;      if test "x$withval" != "xno" && test "x$withval" != "xyes"
+       then
+               librrd_cflags="-I$withval/include"
+-              librrd_ldflags="-L$withval/lib"
++              librrd_ldflags="-L$withval/lib -lz"
+               with_rrdtool="yes"
+       else
+               with_rrdtool="$withval"
diff --git a/utils/collectd/patches/200-wireless-brcm2.4-compat.patch b/utils/collectd/patches/200-wireless-brcm2.4-compat.patch
new file mode 100644 (file)
index 0000000..064b75d
--- /dev/null
@@ -0,0 +1,24 @@
+--- collectd-4.4.0.orig/src/wireless.c 2008-05-26 20:13:05.000000000 +0200
++++ collectd-4.4.0/src/wireless.c      2008-05-26 20:15:16.000000000 +0200
+@@ -128,7 +128,9 @@
+                       power = 1.0; /* invalid */
+               else if ((power >= 0.0) && (power <= 100.0))
+                       power = wireless_percent_to_power (power);
+-              else if (power > 100.0)
++              else if ((power > 100.0) && (power <= 256.0))
++                      power = power - 256.0;
++              else
+                       power = 1.0; /* invalid */
+               /* noise [dBm] < 0.0 */
+@@ -137,7 +139,9 @@
+                       noise = 1.0; /* invalid */
+               else if ((noise >= 0.0) && (noise <= 100.0))
+                       noise = wireless_percent_to_power (noise);
+-              else if (noise > 100.0)
++              else if ((noise > 100.0) && (noise <= 256.0))
++                      noise = noise - 256.0;
++              else
+                       noise = 1.0; /* invalid */
+               wireless_submit (device, "signal_quality", quality);