[OpenWrt-Devel] [PATCH] [packages] wview/radlib: new package, automated weather station software

2012-07-29 Thread Paul Fertser
Signed-off-by: Paul Fertser fercer...@gmail.com
---
This patch might be a bit problematic to apply with git because some of
the new patches are amending wview sources that use the DOS line-endings
convention. It applies and works fine with patch -p1 though. Please
advice me how to proceed if that's unacceptable.

The proper integration of this wview software is complicated due to some
strange flaws in the sources, i workaround them with symlinks and provide
an appropriate init script to allow user to use a nice big storage for the
generated data. This package is runtime-tested on a DIR-620 system. 

 libs/radlib/Makefile   |   44 +-
 .../patches/001-cross_compile_link_bug.patch   |   71 +++
 libs/radlib/patches/001-cross_link_bug.patch   |   44 --
 utils/wview/Makefile   |  170 +++
 utils/wview/files/etc/init.d/wview |   55 +++
 utils/wview/patches/010-fix-cross-compile.patch|  499 
 utils/wview/patches/020-use-standard-awk.patch |   22 +
 7 files changed, 851 insertions(+), 54 deletions(-)
 create mode 100644 libs/radlib/patches/001-cross_compile_link_bug.patch
 delete mode 100644 libs/radlib/patches/001-cross_link_bug.patch
 create mode 100644 utils/wview/Makefile
 create mode 100644 utils/wview/files/etc/init.d/wview
 create mode 100644 utils/wview/patches/010-fix-cross-compile.patch
 create mode 100644 utils/wview/patches/020-use-standard-awk.patch

diff --git a/libs/radlib/Makefile b/libs/radlib/Makefile
index 1ac860a..c5c580f 100644
--- a/libs/radlib/Makefile
+++ b/libs/radlib/Makefile
@@ -8,18 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=radlib
-PKG_VERSION:=2.8.5
-PKG_RELEASE:=2
+PKG_VERSION:=2.12.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/radlib
-PKG_MD5SUM:=82ab0c702e55a860b69ad76e2aac748f
-
-ifeq ($(CONFIG_EXTERNAL_KERNEL_TREE),)
-PATCH_DIR:=
-else
-PATCH_DIR:=./patches
-endif
+PKG_SHA1SUM:=1b3feace6d0361436c9e4ce9b06856195a5ac1b1
 
 PKG_FIXUP:=autoreconf
 
@@ -36,13 +30,43 @@ define Package/radlib/description
radlib is a rapid application development library for unix 
multi-process applications
 endef
 
+define Package/radlib-sqlite
+  $(call Package/radlib)
+  VARIANT:=sqlite
+  DEPENDS+=+libsqlite3
+  TITLE+= (sqlite)
+endef
+
+define Package/radlib-sqlite/description
+  $(call Package/radlib/description)
+  This package comes with sqlite support
+endef
+
 CONFIGURE_ARGS += \
  --prefix=$(TOOLCHAIN_DIR)/usr
 
+ifeq ($(BUILD_VARIANT),sqlite)
+CONFIGURE_ARGS += \
+--enable-sqlite
+endif
+
+define Build/InstallDev
+   $(INSTALL_DIR) $(1)/usr/include
+   $(CP) $(PKG_BUILD_DIR)/h/rad*.h $(1)/usr/include/
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/src/.libs/librad.so* $(1)/usr/lib/
+endef
+
 define Package/radlib/install
$(INSTALL_DIR) $(1)/usr/lib
-   $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/.libs/librad.so $(1)/usr/lib/
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/.libs/librad.so* $(1)/usr/lib/
+   $(INSTALL_DIR) $(1)/usr/bin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/msgRouter/.libs/radmrouted $(1)/usr/bin/
 endef
 
+define Package/radlib-sqlite/install
+   $(call Package/radlib/install,$(1))
+endef
 
 $(eval $(call BuildPackage,radlib))
+$(eval $(call BuildPackage,radlib-sqlite))
diff --git a/libs/radlib/patches/001-cross_compile_link_bug.patch 
b/libs/radlib/patches/001-cross_compile_link_bug.patch
new file mode 100644
index 000..2c943bd
--- /dev/null
+++ b/libs/radlib/patches/001-cross_compile_link_bug.patch
@@ -0,0 +1,71 @@
+--- a/debug/Makefile.am
 b/debug/Makefile.am
+@@ -27,8 +27,8 @@ raddebug_LDADD   += -lsqlite3
+ endif
+ 
+ # define library directories
+-raddebug_LDFLAGS = -L../src/.libs -L$(prefix)/lib -L/usr/lib
+-INCLUDES += -I$(prefix)/include -I/usr/include
++raddebug_LDFLAGS = -L../src/.libs -L$(prefix)/lib
++INCLUDES += -I$(prefix)/include
+ 
+ if MYSQL
+ raddebug_LDFLAGS += -L$(prefix)/lib64/mysql -L$(prefix)/lib/mysql 
-L/usr/lib64/mysql -L/usr/lib/mysql
+@@ -39,6 +39,6 @@ INCLUDES += -I$(prefix)/pgsql/in
+ endif
+ endif
+ 
+-if CROSSCOMPILE
+-raddebug_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o 
$(prefix)/lib/crtn.o
+-endif
++#if CROSSCOMPILE
++#raddebug_LDFLAGS += $(prefix)/lib/crt1.o $(prefix)/lib/crti.o 
$(prefix)/lib/crtn.o
++#endif
+--- a/msgRouter/Makefile.am
 b/msgRouter/Makefile.am
+@@ -27,8 +27,8 @@ radmrouted_LDADD   += -lsqlite3
+ endif
+ 
+ # define library directories
+-radmrouted_LDFLAGS = -L../src/.libs -L$(prefix)/lib -L/usr/lib
+-INCLUDES   += -I$(prefix)/include -I/usr/include
++radmrouted_LDFLAGS = -L../src/.libs -L$(prefix)/lib
++INCLUDES   += -I$(prefix)/include
+ 
+ if MYSQL
+ radmrouted_LDFLAGS += -L$(prefix)/lib64/mysql -L$(prefix)/lib/mysql 
-L/usr/lib64/mysql -L/usr/lib/mysql
+@@ -39,6 +39,6 @@ INCLUDES   += -I$(prefix)/pgsql/
+ endif
+ endif
+ 

Re: [OpenWrt-Devel] [PATCH] [packages] wview/radlib: new package, automated weather station software

2012-07-29 Thread John Crispin
On 29/07/12 19:49, Paul Fertser wrote:
 Signed-off-by: Paul Fertser fercer...@gmail.com
 ---
 This patch might be a bit problematic to apply with git because some of
 the new patches are amending wview sources that use the DOS line-endings
 convention. It applies and works fine with patch -p1 though. Please
 advice me how to proceed if that's unacceptable.
 
 The proper integration of this wview software is complicated due to some
 strange flaws in the sources, i workaround them with symlinks and provide
 an appropriate init script to allow user to use a nice big storage for the
 generated data. This package is runtime-tested on a DIR-620 system. 
 
  libs/radlib/Makefile   |   44 +-
  .../patches/001-cross_compile_link_bug.patch   |   71 +++
  libs/radlib/patches/001-cross_link_bug.patch   |   44 --
  utils/wview/Makefile   |  170 +++
  utils/wview/files/etc/init.d/wview |   55 +++
  utils/wview/patches/010-fix-cross-compile.patch|  499 
 
  utils/wview/patches/020-use-standard-awk.patch |   22 +
  7 files changed, 851 insertions(+), 54 deletions(-)
  create mode 100644 libs/radlib/patches/001-cross_compile_link_bug.patch
  delete mode 100644 libs/radlib/patches/001-cross_link_bug.patch
  create mode 100644 utils/wview/Makefile
  create mode 100644 utils/wview/files/etc/init.d/wview
  create mode 100644 utils/wview/patches/010-fix-cross-compile.patch
  create mode 100644 utils/wview/patches/020-use-standard-awk.patch
 


Hi,

please split this into 2 patches. one for libs/radlib/ and one for
utils/wview/

John
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel