include $(TOPDIR)/rules.mk
PKG_NAME:=dump1090
-PKG_VERSION:=2014-08-22
+PKG_VERSION:=2014-10-25
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://github.com/MalcolmRobb/dump1090.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=a82df07c0c0a750d58610bf3c3ece77482f3a58c
+PKG_SOURCE_VERSION:=65751ed6e9e20dcd6ab4e693cc5c80c698664da8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_CONFIG_DEPENDS:= \
CONFIG_DUMP1090_DUMP \
CONFIG_DUMP1090_WWW \
- CONFIG_DUMP1090_VIEW \
+ CONFIG_DUMP1090_VIEW
include $(INCLUDE_DIR)/package.mk
$(INSTALL_DIR) $(1)/usr/bin
ifneq ($(CONFIG_DUMP1090_DUMP),)
- $(CP) $(PKG_BUILD_DIR)/dump1090 $(1)/usr/bin
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) files/dump1090.init $(1)/etc/init.d/dump1090
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) files/dump1090.config $(1)/etc/config/dump1090
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/dump1090 $(1)/usr/bin
ifneq ($(CONFIG_DUMP1090_WWW),)
$(INSTALL_DIR) $(1)/usr/share/dump1090
$(CP) $(PKG_BUILD_DIR)/public_html/* $(1)/usr/share/dump1090
endif
endif
ifneq ($(CONFIG_DUMP1090_VIEW),)
- $(CP) $(PKG_BUILD_DIR)/view1090 $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/view1090 $(1)/usr/bin
endif
endef
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=90
+STOP=10
+USE_PROCD=1
+
+append_arg() {
+ local cfg="$1"
+ local var="$2"
+ local opt="$3"
+ local def="$4"
+ local val
+
+ config_get val "$cfg" "$var"
+ [ -n "$val" -o -n "$def" ] && procd_append_param command $opt "${val:-$def}"
+}
+
+append_bool() {
+ local cfg="$1"
+ local var="$2"
+ local opt="$3"
+ local def="$4"
+ local val
+
+ config_get_bool val "$cfg" "$var" "$def"
+ [ "$val" = 1 ] && procd_append_param command "$opt"
+}
+
+start_instance() {
+ local cfg="$1"
+
+ config_get_bool disabled "$cfg" 'disabled' '0'
+ [ "$disabled" = 1 ] && return 1
+
+ procd_open_instance
+
+ procd_set_param command /usr/bin/dump1090
+
+ append_arg "$cfg" device_index "--device-index"
+ append_arg "$cfg" gain "--gain"
+ append_bool "$cfg" enable_agc "--enable-agc"
+ append_arg "$cfg" freq "--freq"
+ append_arg "$cfg" ifile "--ifile"
+ append_bool "$cfg" interactive "--interactive"
+ append_arg "$cfg" interactive_rows "--interactive-rows"
+ append_arg "$cfg" interactive_ttl "--interactive-ttl"
+ append_bool "$cfg" interactive_rtl1090 "--interactive-rtl1090"
+ append_bool "$cfg" raw "--raw"
+ append_bool "$cfg" net "--net"
+ append_bool "$cfg" modeac "--modeac"
+ append_bool "$cfg" net_beast "--net-beast"
+ append_bool "$cfg" net_only "--net-only"
+ append_arg "$cfg" net_http_port "--net-http-port"
+ append_arg "$cfg" net_ri_port "--net-ri-port"
+ append_arg "$cfg" net_ro_port "--net-ro-port"
+ append_arg "$cfg" net_sbs_port "--net-sbs-port"
+ append_arg "$cfg" net_bi_port "--net-bi-port"
+ append_arg "$cfg" net_bo_port "--net-bo-port"
+ append_arg "$cfg" net_ro_size "--net-ro-size"
+ append_arg "$cfg" net_ro_rate "--net-ro-rate"
+ append_arg "$cfg" net_heartbeat "--net-heartbeat"
+ append_arg "$cfg" net_buffer "--net-buffer"
+ append_arg "$cfg" lat "--lat"
+ append_arg "$cfg" lon "--lon"
+ append_bool "$cfg" fix "--fix"
+ append_bool "$cfg" no_fix "--no-fix"
+ append_bool "$cfg" no_crc_check "--no-crc-check"
+ append_bool "$cfg" phase_enhance "--phase-enhance"
+ append_bool "$cfg" agressive "--agressive"
+ append_bool "$cfg" mlat "--mlat"
+ append_bool "$cfg" stats "--stats"
+ append_arg "$cfg" stats_every "--stats-every"
+ append_bool "$cfg" onlyaddr "--onlyaddr"
+ append_bool "$cfg" metric "--metric"
+ append_arg "$cfg" snip "--snip"
+ append_arg "$cfg" debug "--debug"
+ append_bool "$cfg" quiet "--quiet"
+ append_arg "$cfg" ppm "--ppm"
+
+ procd_close_instance
+}
+
+service_triggers() {
+ procd_add_reload_trigger "dump1090"
+}
+
+start_service() {
+ config_load dump1090
+ config_foreach start_instance dump1090
+}