From 40ea8d9880612007a2166f03560a0a22c81b3849 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 12 Jan 2014 22:35:00 +0100 Subject: [PATCH] Clean up gluon-alfred * Merge gluon-alfred-ffmap into gluon-alfred * Use gluon-crond instead of alfred's "facter" mechanism based on the broken busybox crond --- gluon/gluon-alfred-ffmap/Makefile | 32 ------------------- gluon/gluon-alfred/Makefile | 6 ++-- .../files/lib/gluon/alfred/announce.sh} | 5 +-- .../gluon-alfred/files/lib/gluon/cron/alfred | 1 + .../alfred/invariant/010-enable-alfred | 17 ++++++++-- 5 files changed, 21 insertions(+), 40 deletions(-) delete mode 100644 gluon/gluon-alfred-ffmap/Makefile rename gluon/{gluon-alfred-ffmap/files/etc/alfred/ffmap.sh => gluon-alfred/files/lib/gluon/alfred/announce.sh} (79%) create mode 100644 gluon/gluon-alfred/files/lib/gluon/cron/alfred diff --git a/gluon/gluon-alfred-ffmap/Makefile b/gluon/gluon-alfred-ffmap/Makefile deleted file mode 100644 index cc3bbc3..0000000 --- a/gluon/gluon-alfred-ffmap/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=gluon-alfred-ffmap -PKG_VERSION:=0.1 -PKG_RELEASE:=1.$(GLUON_CONFIG_VERSION) - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk - -define Package/gluon-alfred-ffmap - SECTION:=gluon - CATEGORY:=Gluon - DEPENDS:=+gluon-alfred +gluon-location - TITLE:=Distribute data for ffmap via alfred -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/gluon-alfred-ffmap/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-alfred-ffmap)) diff --git a/gluon/gluon-alfred/Makefile b/gluon/gluon-alfred/Makefile index c67d920..8290ad8 100644 --- a/gluon/gluon-alfred/Makefile +++ b/gluon/gluon-alfred/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gluon-alfred -PKG_VERSION:=0.1 -PKG_RELEASE:=1.$(GLUON_CONFIG_VERSION) +PKG_VERSION:=1 +PKG_RELEASE:=1 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk define Package/gluon-alfred SECTION:=gluon CATEGORY:=Gluon - DEPENDS:=+alfred +gluon-cron + DEPENDS:=+gluon-core +gluon-location +gluon-cron +alfred TITLE:=Configure alfred endef diff --git a/gluon/gluon-alfred-ffmap/files/etc/alfred/ffmap.sh b/gluon/gluon-alfred/files/lib/gluon/alfred/announce.sh similarity index 79% rename from gluon/gluon-alfred-ffmap/files/etc/alfred/ffmap.sh rename to gluon/gluon-alfred/files/lib/gluon/alfred/announce.sh index a79addd..6b890a7 100755 --- a/gluon/gluon-alfred-ffmap/files/etc/alfred/ffmap.sh +++ b/gluon/gluon-alfred/files/lib/gluon/alfred/announce.sh @@ -16,6 +16,7 @@ set -e json_init json_add_string "name" "$(uci get 'system.@system[0].hostname')" if [ "$(uci get 'system.@system[0].share_location')" = 1 ]; then - json_add_string "gps" "$(uci get 'system.@system[0].latitude') $(uci get 'system.@system[0].longitude')" -fi + json_add_string "location" "$(uci get 'system.@system[0].latitude') $(uci get 'system.@system[0].longitude')" +fi + json_dump | tr -d '\n' | alfred -s "$ALFRED_DATA_TYPE" diff --git a/gluon/gluon-alfred/files/lib/gluon/cron/alfred b/gluon/gluon-alfred/files/lib/gluon/cron/alfred new file mode 100644 index 0000000..98cc382 --- /dev/null +++ b/gluon/gluon-alfred/files/lib/gluon/cron/alfred @@ -0,0 +1 @@ +*/5 * * * * /lib/gluon/alfred/announce.sh diff --git a/gluon/gluon-alfred/files/lib/gluon/upgrade/alfred/invariant/010-enable-alfred b/gluon/gluon-alfred/files/lib/gluon/upgrade/alfred/invariant/010-enable-alfred index 20ff5df..755fff3 100755 --- a/gluon/gluon-alfred/files/lib/gluon/upgrade/alfred/invariant/010-enable-alfred +++ b/gluon/gluon-alfred/files/lib/gluon/upgrade/alfred/invariant/010-enable-alfred @@ -1,5 +1,16 @@ #!/bin/sh -uci set alfred.alfred.interface=br-client -uci set alfred.alfred.mode=slave -uci delete alfred.alfred.disabled +. /lib/functions.sh + +uci_remove alfred alfred + +uci_add alfred alfred alfred +uci_set alfred alfred interface 'br-client' +uci_set alfred alfred mode 'slave' +uci_set alfred alfred batmanif 'bat0' +uci_set alfred alfred start_vis '1' +uci_set alfred alfred run_facters '0' + +uci_commit alfred + +/etc/init.d/alfred enable