diff --git a/net/knxd/Makefile b/net/knxd/Makefile new file mode 100644 index 000000000..4fe4710d6 --- /dev/null +++ b/net/knxd/Makefile @@ -0,0 +1,156 @@ +# +# Copyright (C) 2008-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +### Remarks +### 'python pascal ruby lua' need to be deleted in src/clients/Makefile.am +### USB stays disabled as long as official libusb-1.0 remains on version 1.0.9 +### you need to build libusb-1.0 >= 1.0.10 yourself if you want to add USB support + +include $(TOPDIR)/rules.mk + +PKG_NAME:=knxd +PKG_REV:=b01d99c6748cc565f1be69b68cf2b9d3115e8ce5 +PKG_VERSION:=2014-12-20 + +PKG_MAINTAINER:=Othmar Truniger +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=LICENSE + + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/Makki1/knxd.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +PKG_BUILD_DEPENDS:=pthsem argp-standalone + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/knxd + SECTION:=net + CATEGORY:=Network + TITLE:=Eib KNX deamon + URL:=https://github.com/Makki1/knxd + DEPENDS:=pthsem +endef +# use this if you want to support USB +# DEPENDS:=pthsem libusb-1.0 + +define Package/knxd/description +EIB KNX Daemon +endef + +define Package/knxd-tools + SECTION:=net + CATEGORY:=Network + TITLE:=Eib KNX Utils + URL:=https://github.com/Makki1/knxd + DEPENDS:=pthsem +endef +# use this if you want to support USB +# DEPENDS:=pthsem libusb-1.0 + +define Package/knxd-tools/description +EIB KNX Tools +endef +define Build/Prepare + $(call Build/Prepare/Default) +endef + + +define Build/Configure + $(call Build/Configure/Default,\ + --disable-ft12 \ + --enable-eibnetip \ + --enable-eibnetiptunnel \ + --enable-eibnetipserver \ + --disable-usb \ + --enable-tpuart \ + --enable-tpuarts \ + --disable-pei16 \ + --disable-pei16s \ + --enable-groupcache \ + --without-pth-test \ + --without-libstdc ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC=$(TARGET_CC) \ + LIBS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib -fno-builtin -nostdinc++ -nodefaultlibs -lc -lm -lgcc -largp -lpthsem" \ + CPPFLAGS="-I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include" +endef + +define Package/knxd/install + mkdir -p $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/src/server/knxd $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/tools/bcu/bcuaddrtab $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/tools/bcu/bcuread $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/tools/eibnet/eibnetsearch $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/tools/eibnet/eibnetdescribe $(1)/usr/bin/ + mkdir -p $(1)/etc/init.d + $(CP) ./files/knxd.init $(1)/etc/init.d/knxd + mkdir -p $(1)/etc/config + $(CP) ./files/knxd.config $(1)/etc/config/knxd +endef +# add this line above to support USB +# $(CP) $(PKG_BUILD_DIR)/src/usb/findknxusb $(1)/usr/bin/ + +define Package/knxd-tools/install + mkdir -p $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/src/client/c/.libs/libeibclient.so.0.0.0 $(1)/usr/lib/ + ln -s libeibclient.so.0.0.0 $(1)/usr/lib/libeibclient.so + ln -s libeibclient.so.0.0.0 $(1)/usr/lib/libeibclient.so.0 + mkdir -p $(1)/usr/bin + -rm -f $(1)/usr/bin/knxread + -rm -f $(1)/usr/bin/knxreadtemp + -rm -f $(1)/usr/bin/knxwrite + -rm -f $(1)/usr/bin/knxlog + -rm -f $(1)/usr/bin/knxon + -rm -f $(1)/usr/bin/knxoff + -rm -f $(1)/usr/bin/knxif + -rm -f $(1)/usr/bin/knxswrite + -rm -f $(1)/usr/bin/knxbool + -rm -f $(1)/usr/bin/knxdimup + ln -s knxtool $(1)/usr/bin/knxread + ln -s knxtool $(1)/usr/bin/knxreadtemp + ln -s knxtool $(1)/usr/bin/knxwrite + ln -s knxtool $(1)/usr/bin/knxlog + ln -s knxtool $(1)/usr/bin/knxon + ln -s knxtool $(1)/usr/bin/knxoff + ln -s knxtool $(1)/usr/bin/knxif + ln -s knxtool $(1)/usr/bin/knxswrite + ln -s knxtool $(1)/usr/bin/knxbool + ln -s knxtool $(1)/usr/bin/knxdimup + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/knxtool $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/busmonitor1 $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/busmonitor2 $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/busmonitor3 $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/eibread-cgi $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/eibwrite-cgi $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/vbusmonitor1 $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/vbusmonitor2 $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/vbusmonitor3 $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupwrite $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupswrite $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/grouplisten $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupread $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupresponse $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupreadresponse $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketlisten $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketread $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketwrite $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/examples/.libs/groupsocketswrite $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,knxd)) +$(eval $(call BuildPackage,knxd-tools)) diff --git a/net/knxd/files/knxd.config b/net/knxd/files/knxd.config new file mode 100644 index 000000000..cd86a62af --- /dev/null +++ b/net/knxd/files/knxd.config @@ -0,0 +1,12 @@ +config daemon args + # daemon is started as 'knxd $options $url' + # use 'knxd --help' to get all possible options' + # + # typical example for options for tunnel mode + option options '-D -T -S -d/tmp/knxd.log -i -p/var/run/knxd.pid' + # add '-t1023' or '--trace=1023' for full log trace + + # example with tpuarts interface + # option url 'tpuarts:/dev/ttyAMA0' + # example with IP interface in tunnel mode + option url 'ipt:192.168.1.20' diff --git a/net/knxd/files/knxd.init b/net/knxd/files/knxd.init new file mode 100644 index 000000000..df4dc80bd --- /dev/null +++ b/net/knxd/files/knxd.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +START=90 +STOP=20 +NAME=knxd +PROG=/usr/bin/$NAME + +. /lib/functions.sh + +start() { + local options url + config_load "$NAME" + config_get options args options '' + config_get url args url + service_start $PROG $options $url +} + +stop() { + service_stop $PROG +} + diff --git a/net/knxd/patches/0099-openwrt.patch b/net/knxd/patches/0099-openwrt.patch new file mode 100644 index 000000000..fd73c0555 --- /dev/null +++ b/net/knxd/patches/0099-openwrt.patch @@ -0,0 +1,8 @@ +--- knxd/src/client/Makefile.am.orig 2014-12-21 20:17:14.000000000 +0100 ++++ knxd/src/client/Makefile.am 2014-12-21 20:18:50.639995000 +0100 +@@ -4,5 +4,5 @@ + BUILDJAVA = + endif + +-SUBDIRS=def c $(BUILDJAVA) php perl cs python pascal ruby lua . ++SUBDIRS=def c $(BUILDJAVA) php perl cs .