horst: Update to version 5.1 and add init script 4898/head
authorBruno Randolf <br1@einfach.org>
Tue, 3 Oct 2017 13:55:18 +0000 (14:55 +0100)
committerBruno Randolf <br1@einfach.org>
Wed, 4 Oct 2017 20:40:16 +0000 (21:40 +0100)
Update to latest stable version and add init script and config file to start
horst in server mode as a service.

Signed-off-by: Bruno Randolf <br1@einfach.org>
net/horst/Makefile
net/horst/horst.config [new file with mode: 0644]
net/horst/horst.init [new file with mode: 0755]
net/horst/patches/0001-Remove-_GNU_SOURCE-from-ccan-config.patch [deleted file]

index 381878c384dc64a5aaec68b8d4256483b4406013..63e2f55ec6fc692f2507a2de8b1e1311e4404820 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=horst
-PKG_VERSION:=5.0
+PKG_VERSION:=5.1
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-git.tar.gz
-PKG_MIRROR_HASH:=3a677e504e8a1f27c899dfbf39da8c94412b24b08bb2eab0de7807cef07d078b
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=git://github.com/br101/horst.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=version-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+PKG_MIRROR_HASH:=22f4be94e839c58ac85ebdc2359b813fd5f68dfd71e1b0c9ed9545020d1abc7d
 
 PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
 PKG_LICENSE:=GPL-2.0+
@@ -43,10 +43,18 @@ define Package/horst/description
        and especially IBSS (ad-hoc) mode and mesh networks (OLSR).
 endef
 
+define Package/horst/conffiles
+/etc/config/horst
+endef
+
 define Package/horst/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/horst $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/horst.sh $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./horst.init $(1)/etc/init.d/horst
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./horst.config $(1)/etc/config/horst
 endef
 
 $(eval $(call BuildPackage,horst))
diff --git a/net/horst/horst.config b/net/horst/horst.config
new file mode 100644 (file)
index 0000000..17c0097
--- /dev/null
@@ -0,0 +1,4 @@
+config init 'init'
+       option disabled 1
+       option interface 'mon0'
+       option scan 1
diff --git a/net/horst/horst.init b/net/horst/horst.init
new file mode 100755 (executable)
index 0000000..bba67a2
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+
+START=94
+
+USE_PROCD=1
+PROG=/usr/sbin/horst
+
+start_service() {
+       config_load horst
+       config_get dis "init" 'disabled' '0'
+       [ "$dis" == "0" ] || exit
+
+       config_get intf "init" 'interface' 'wlan0'
+       config_get scan "init" 'scan' '0'
+       [ "$scan" == "0" ] && scan='' || scan="-s"
+
+       procd_open_instance
+       procd_set_param command $PROG -q -i $intf $scan -N
+       procd_set_param netdev $intf
+       procd_set_param respawn
+       procd_close_instance
+}
diff --git a/net/horst/patches/0001-Remove-_GNU_SOURCE-from-ccan-config.patch b/net/horst/patches/0001-Remove-_GNU_SOURCE-from-ccan-config.patch
deleted file mode 100644 (file)
index eeab738..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From c91e2f6d72823938052044eef858c3c675617ae4 Mon Sep 17 00:00:00 2001
-From: Bruno Randolf <br1@einfach.org>
-Date: Wed, 15 Mar 2017 21:22:48 +0000
-Subject: [PATCH] Remove _GNU_SOURCE from ccan config
-
-It creates problems with LEDEs FORTIFY and is not needed
----
- config.h | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/config.h b/config.h
-index 5c398c4..7e1027a 100644
---- a/config.h
-+++ b/config.h
-@@ -1,8 +1,5 @@
- /* Generated by CCAN configurator */
- #ifndef CCAN_CONFIG_H
- #define CCAN_CONFIG_H
--#ifndef _GNU_SOURCE
--#define _GNU_SOURCE /* Always use GNU extensions. */
--#endif
- #define HAVE_TYPEOF 1
- #endif /* CCAN_CONFIG_H */
--- 
-2.7.4
-