From d2c7bf32ae0700d6530c11c31281f2459e0e90fa Mon Sep 17 00:00:00 2001 From: Othmar Truniger Date: Wed, 31 Dec 2014 10:18:51 +0100 Subject: [PATCH 1/4] linknx: add Makefile for new package Signed-off-by: Othmar Truniger --- net/linknx/Makefile | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 net/linknx/Makefile diff --git a/net/linknx/Makefile b/net/linknx/Makefile new file mode 100644 index 000000000..3c188580d --- /dev/null +++ b/net/linknx/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2008-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=linknx +PKG_VERSION:=0.0.1.32 +PKG_RELEASE:=1 +PKG_MD5SUM:=7ecc1208f59bceb05068c752b2250b63 + +PKG_MAINTAINER:=Othmar Truniger +PKG_LICENSE:=GPL-2.0+ + +PKG_SOURCE_URL:=@SF/linknx +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat +PKG_BUILD_DEPENDS:=pthsem curl libesmtp + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +include $(INCLUDE_DIR)/package.mk + +define Package/linknx + SECTION:=net + CATEGORY:=Network + TITLE:=KNX home automation platform + URL:=http://sourceforge.net/projects/linknx/ + DEPENDS:=pthsem +lua +luac +libstdcpp +libcurl +libesmtp +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch aclocal.m4 Makefile.in config.h.in configure; \ + $(SED) 's,\"2.0.4\",\"2.0.4\"\n_pth_version=\"2.0.8\",g' $(PKG_BUILD_DIR)/configure ) + $(call Build/Configure/Default,--verbose --without-pth-test --with-pth=$(STAGING_DIR) --without-log4cpp --with-lua --with-libcurl --without-mysql, \ + CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -lcrypt" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/ \ + LIBDIR="$(TARGET_LDFLAGS)" \ + CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) " \ + LD="$(TARGET_CROSS)ld -shared" \ + LUA="$(STAGING_DIR_HOST)/bin/lua" \ + LUAC="$(STAGING_DIR_HOST)/bin/luac" \ + CFLAGS="$(TARGET_CFLAGS) -nodefaultlibs" all +endef + +define Package/linknx/install + mkdir -p $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/src/linknx $(1)/usr/bin/ + mkdir -p $(1)/etc/init.d + $(CP) ./files/linknx.init $(1)/etc/init.d/linknx + mkdir -p $(1)/etc/config + $(CP) ./files/linknx.config $(1)/etc/config/linknx + $(CP) ./files/linknx.xml.dist $(1)/etc/linknx.xml.dist +endef + +$(eval $(call BuildPackage,linknx)) From c7e53198aefd9e659e3406980e6f68a21b2d946a Mon Sep 17 00:00:00 2001 From: Othmar Truniger Date: Wed, 31 Dec 2014 10:20:11 +0100 Subject: [PATCH 2/4] linknx: add init file Signed-off-by: Othmar Truniger --- net/linknx/files/linknx.init | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 net/linknx/files/linknx.init diff --git a/net/linknx/files/linknx.init b/net/linknx/files/linknx.init new file mode 100644 index 000000000..574bf4197 --- /dev/null +++ b/net/linknx/files/linknx.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=98 +STOP=10 +NAME=linknx +PROG=/usr/bin/$NAME + +. /lib/functions.sh + +start() { + local conf options + config_load "$NAME" + config_get conf args conf '/etc/linknx.xml' + config_get options args options '' + test -f $conf || cp -p /etc/linknx.xml.dist $conf + service_start $PROG --config=$conf $options +} + +stop() { + service_stop $PROG +} From 934d7f249e4fc995da3187be3c96993f87a39345 Mon Sep 17 00:00:00 2001 From: Othmar Truniger Date: Wed, 31 Dec 2014 10:21:03 +0100 Subject: [PATCH 3/4] linknx: add config file Signed-off-by: Othmar Truniger --- net/linknx/files/linknx.config | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 net/linknx/files/linknx.config diff --git a/net/linknx/files/linknx.config b/net/linknx/files/linknx.config new file mode 100644 index 000000000..be1161946 --- /dev/null +++ b/net/linknx/files/linknx.config @@ -0,0 +1,8 @@ +config daemon args + # daemon is started as 'linknx --config=$conf $options' + # use 'linknx --help' to get all possible options' + # + # typical example + option conf '/etc/linknx.xml' + option options '-w --daemon=/var/lib/linknx/linknx.log --pid-file=/var/run/linknx.log' + From 1a9bc1c43a78ec4c8cce1449f26d434a6aaf7b35 Mon Sep 17 00:00:00 2001 From: Othmar Truniger Date: Wed, 31 Dec 2014 10:22:57 +0100 Subject: [PATCH 4/4] linknx: add dist xml conf file Signed-off-by: Othmar Truniger --- net/linknx/files/linknx.xml.dist | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 net/linknx/files/linknx.xml.dist diff --git a/net/linknx/files/linknx.xml.dist b/net/linknx/files/linknx.xml.dist new file mode 100644 index 000000000..cb5073d9d --- /dev/null +++ b/net/linknx/files/linknx.xml.dist @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + +