Browse Source

Merge pull request #714 from tru7/net-linknx

linknx: new package
Steven Barth 10 years ago
parent
commit
2993533747

+ 62
- 0
net/linknx/Makefile View File

@@ -0,0 +1,62 @@
1
+#
2
+# Copyright (C) 2008-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=linknx
11
+PKG_VERSION:=0.0.1.32
12
+PKG_RELEASE:=1
13
+PKG_MD5SUM:=7ecc1208f59bceb05068c752b2250b63
14
+
15
+PKG_MAINTAINER:=Othmar Truniger <tru7@users.noreply.github.com>
16
+PKG_LICENSE:=GPL-2.0+
17
+
18
+PKG_SOURCE_URL:=@SF/linknx
19
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
20
+PKG_CAT:=zcat
21
+PKG_BUILD_DEPENDS:=pthsem curl libesmtp
22
+
23
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
24
+include $(INCLUDE_DIR)/package.mk
25
+
26
+define Package/linknx
27
+  SECTION:=net
28
+  CATEGORY:=Network
29
+  TITLE:=KNX home automation platform
30
+  URL:=http://sourceforge.net/projects/linknx/
31
+  DEPENDS:=pthsem +lua +luac +libstdcpp +libcurl +libesmtp
32
+endef
33
+
34
+define Build/Configure
35
+        (cd $(PKG_BUILD_DIR); touch aclocal.m4 Makefile.in config.h.in configure; \
36
+        $(SED) 's,\"2.0.4\",\"2.0.4\"\n_pth_version=\"2.0.8\",g' $(PKG_BUILD_DIR)/configure )
37
+        $(call Build/Configure/Default,--verbose --without-pth-test --with-pth=$(STAGING_DIR) --without-log4cpp --with-lua --with-libcurl --without-mysql, \
38
+        CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -lcrypt" \
39
+        )
40
+endef
41
+
42
+define Build/Compile
43
+        $(MAKE) -C $(PKG_BUILD_DIR)/ \
44
+                LIBDIR="$(TARGET_LDFLAGS)" \
45
+                CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) " \
46
+                LD="$(TARGET_CROSS)ld -shared" \
47
+                LUA="$(STAGING_DIR_HOST)/bin/lua" \
48
+                LUAC="$(STAGING_DIR_HOST)/bin/luac" \
49
+                CFLAGS="$(TARGET_CFLAGS) -nodefaultlibs" all
50
+endef
51
+
52
+define Package/linknx/install
53
+        mkdir -p $(1)/usr/bin
54
+        $(CP) $(PKG_BUILD_DIR)/src/linknx $(1)/usr/bin/
55
+        mkdir -p $(1)/etc/init.d
56
+        $(CP) ./files/linknx.init $(1)/etc/init.d/linknx
57
+        mkdir -p $(1)/etc/config
58
+        $(CP) ./files/linknx.config $(1)/etc/config/linknx
59
+        $(CP) ./files/linknx.xml.dist $(1)/etc/linknx.xml.dist
60
+endef
61
+
62
+$(eval $(call BuildPackage,linknx))

+ 8
- 0
net/linknx/files/linknx.config View File

@@ -0,0 +1,8 @@
1
+config daemon args
2
+        # daemon is started as 'linknx --config=$conf $options'
3
+        # use 'linknx --help' to get all possible options'
4
+        #
5
+        # typical example
6
+        option conf '/etc/linknx.xml'
7
+        option options '-w --daemon=/var/lib/linknx/linknx.log --pid-file=/var/run/linknx.log'
8
+

+ 22
- 0
net/linknx/files/linknx.init View File

@@ -0,0 +1,22 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2006 OpenWrt.org
3
+
4
+START=98
5
+STOP=10
6
+NAME=linknx
7
+PROG=/usr/bin/$NAME
8
+
9
+. /lib/functions.sh
10
+
11
+start() {
12
+        local conf options
13
+        config_load "$NAME"
14
+        config_get conf args conf '/etc/linknx.xml'
15
+        config_get options args options ''
16
+        test -f $conf || cp -p /etc/linknx.xml.dist $conf
17
+        service_start $PROG --config=$conf $options
18
+}
19
+
20
+stop() {
21
+        service_stop $PROG
22
+}

+ 16
- 0
net/linknx/files/linknx.xml.dist View File

@@ -0,0 +1,16 @@
1
+<config>
2
+  <objects>
3
+  </objects>
4
+
5
+  <rules>
6
+  </rules>
7
+
8
+  <services>
9
+    <xmlserver type="inet" port="1028"/>
10
+    <knxconnection url="ip:localhost"/>
11
+    <persistence type="file" path="/var/lib/linknx/persist"/>
12
+    <emailserver type="smtp" host="localhost:25" from="linknx@local.local" />
13
+  </services>
14
+  <logging format="basic" level="INFO" />
15
+
16
+</config>