Repository : ssh://git@open-mesh.org/openwrt-feed-alfred
On branch : master
commit 00299e5be718211b2dc8112a32a324e0962b6b2f Author: Simon Wunderlich siwu@hrz.tu-chemnitz.de Date: Sun May 5 01:35:34 2013 +0200
alfred: add vis server functionality
* bump alfred version to the commit id which contains vis * add init scripts and configuration options for vis * add compile option for vis, turn on by default
Signed-off-by: Simon Wunderlich siwu@hrz.tu-chemnitz.de
00299e5be718211b2dc8112a32a324e0962b6b2f alfred/Config.in | 7 +++++++ alfred/Makefile | 14 +++++++++++--- alfred/files/alfred.config | 1 + alfred/files/alfred.init | 34 ++++++++++++++++++++++++++-------- 4 files changed, 45 insertions(+), 11 deletions(-)
diff --git a/alfred/Config.in b/alfred/Config.in new file mode 100644 index 0000000..fd664ca --- /dev/null +++ b/alfred/Config.in @@ -0,0 +1,7 @@ + +config PACKAGE_ALFRED_VIS + bool "enable vis server for alfred" + depends on PACKAGE_alfred + default y + + diff --git a/alfred/Makefile b/alfred/Makefile index c28f2f3..4578c3b 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -12,8 +12,8 @@ include $(TOPDIR)/rules.mk # PKG_NAME:=alfred PKG_VERSION:=2012.0.0 -PKG_RELEASE:=2 -PKG_REV:=27aee5246d49ea2d08565a35fdc2e59f3ab7b5df +PKG_RELEASE:=3 +PKG_REV:=f2d20ccd0bce4c393566755411d4a19ed9063bee
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=git://git.open-mesh.org/alfred.git @@ -37,15 +37,23 @@ define Package/alfred/conffiles /etc/config/alfred endef
+define Package/alfred/config + source "$(SOURCE)/Config.in" +endef + +MAKE_ALFRED_FLAGS=\ + CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n) + define Build/Compile CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ - $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) all + $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) $(MAKE_ALFRED_FLAGS) all endef
define Package/alfred/install $(INSTALL_DIR) $(1)/usr/sbin cp -fpR $(PKG_BUILD_DIR)/alfred $(1)/usr/sbin/ + [ "x$(CONFIG_PACKAGE_ALFRED_VIS)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/vis/vis $(1)/usr/sbin/ ; true $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/alfred.init $(1)/etc/init.d/alfred $(INSTALL_DIR) $(1)/etc/config diff --git a/alfred/files/alfred.config b/alfred/files/alfred.config index 50ecd9c..b8fa9b2 100644 --- a/alfred/files/alfred.config +++ b/alfred/files/alfred.config @@ -2,5 +2,6 @@ config 'alfred' 'alfred' option interface 'br-lan' option mode 'master' option batmanif 'bat0' + option start_vis '1' # REMOVE THIS LINE TO ENABLE ALFRED option disabled '1' diff --git a/alfred/files/alfred.init b/alfred/files/alfred.init index 46c0f3f..56818d8 100755 --- a/alfred/files/alfred.init +++ b/alfred/files/alfred.init @@ -7,16 +7,16 @@ # See /LICENSE for more information. #
-NAME=alfred -PROG=alfred START=99 STOP=99 alfred_args="" -pid_file="/var/run/${NAME}.pid" +vis_args="" +pid_file_alfred="/var/run/alfred.pid" +pid_file_vis="/var/run/vis.pid" enable=0 +vis_enable=0 SERVICE_DAEMONIZE=1 SERVICE_WRITE_PID=1 -SERVICE_PID_FILE="$pid_file"
alfred_start() { @@ -42,22 +42,40 @@ alfred_start() append alfred_args "$args" enable=1
+ config_get_bool start_vis "$section" start_vis 0 + if [ "$start_vis" = 1 ] && [ -x /usr/sbin/vis ]; then + vis_enable=1 + append vis_args "-i $batmanif -s" + fi + return 0 }
start() { - config_load "${NAME}" + config_load "alfred" config_foreach alfred_start alfred
if [ "$enable" = "0" ]; then exit 0 fi - echo "${initscript}: starting ${PROG}" - service_start /usr/sbin/${PROG} ${alfred_args} + echo "${initscript}: starting alfred" + SERVICE_PID_FILE="$pid_file_alfred" + service_start /usr/sbin/alfred ${alfred_args} + + if [ "$vis_enable" = "0" ]; then + exit 0 + fi + echo "${initscript}: starting vis" + SERVICE_PID_FILE="$pid_file_vis" + service_start /usr/sbin/vis ${vis_args} }
stop() { - service_stop /usr/sbin/${PROG} + SERVICE_PID_FILE="$pid_file_alfred" + service_stop /usr/sbin/alfred + SERVICE_PID_FILE="$pid_file_vis" + [ -x /usr/sbin/vis ] && service_stop /usr/sbin/vis + }