Changeset 40785


Ignore:
Timestamp:
2014-05-20T06:51:19+02:00 (4 years ago)
Author:
florian
Message:

shairport: Update to latest version and switch to procd

Signed-off-by: Álvaro Fernández Rojas <noltari@…>
[florian: fix subject and message]
Signed-off-by: Florian Fainelli <florian@…>

Location:
packages/multimedia/shairport
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • packages/multimedia/shairport/Makefile

    r40720 r40785  
    99 
    1010PKG_NAME:=shairport 
    11 PKG_VERSION:=2013-10-26 
     11PKG_VERSION:=2014-05-08 
    1212PKG_RELEASE:=$(PKG_SOURCE_VERSION) 
    1313 
     
    1515PKG_SOURCE_URL:=git://github.com/abrasive/shairport.git 
    1616PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) 
    17 PKG_SOURCE_VERSION:=b2c7bf111c1446739af9411d8a35acd9b6581b06 
     17PKG_SOURCE_VERSION:=078b21043cdcef6ffad7452db27f036770b23b0c 
    1818PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz 
    1919 
     
    5252        $(INSTALL_BIN) files/shairport.init $(1)/etc/init.d/shairport 
    5353        $(INSTALL_DIR) $(1)/etc/config 
    54         $(INSTALL_DATA) files/shairport.config $(1)/etc/config/shairport 
     54        $(INSTALL_CONF) files/shairport.config $(1)/etc/config/shairport 
    5555endef 
    5656 
  • packages/multimedia/shairport/files/shairport.config

    r35746 r40785  
    11config shairport 
    2         option name     'AirPort' 
    3         option buffer   '256' 
     2        option name 'AirPort' 
     3        option password '' 
     4        option port '5002' 
     5        option buffer '256' 
     6        option log '/var/log/shairport' 
     7        option cmd_start '' 
     8        option cmd_stop '' 
     9        option cmd_wait '0' 
     10        option audio_output '' 
     11        option mdns '' 
  • packages/multimedia/shairport/files/shairport.init

    r40720 r40785  
    11#!/bin/sh /etc/rc.common 
    2 START=80 
     2# Copyright (C) 2013-2014 OpenWrt.org 
    33 
    4 DAEMON="/usr/sbin/shairport" 
     4START=50 
     5USE_PROCD=1 
    56 
    67config_shairport() { 
    78        local cfg="$1" 
    8         local args="" 
    99 
    10         config_get name "$cfg" name 
    11         config_get port "$cfg" port 
    12         config_get buffer "$cfg" buffer 
     10        local cfg_name 
     11        local cfg_password 
     12        local cfg_port 
     13        local cfg_buffer 
     14        local cfg_log 
     15        local cfg_cmd_start 
     16        local cfg_cmd_stop 
     17        local cfg_cmd_wait 
     18        local cfg_audio_output 
     19        local cfg_mdns 
    1320 
    14         [ -z $name ] && name="AirPort" 
    15         args="$args -a $name" 
     21        config_get cfg_name $cfg 'name' 'AirPort' 
     22        config_get cfg_password $cfg 'password' '' 
     23        config_get cfg_port $cfg 'port' '5002' 
     24        config_get cfg_buffer $cfg 'buffer' '256' 
     25        config_get cfg_log $cfg 'log' '/var/log/shairport' 
     26        config_get cfg_cmd_start $cfg 'cmd_start' '' 
     27        config_get cfg_cmd_stop $cfg 'cmd_stop' '' 
     28        config_get_bool cfg_cmd_wait $cfg 'cmd_wait' '0' 
     29        config_get cfg_audio_output $cfg 'audio_output' '' 
     30        config_get cfg_mdns $cfg 'mdns' '' 
    1631 
    17         [ ! -z "$port" ] && args="$args -p $port" 
     32        procd_open_instance 
    1833 
    19         [ -z $buffer ] && buffer="256" 
    20         args="$args -b $buffer" 
     34        procd_set_param command /usr/sbin/shairport 
     35        procd_append_param command -a "$cfg_name" 
     36        [ ! -z "$cfg_password" ] && procd_append_param command -k "$cfg_password" 
     37        procd_append_param command -p $cfg_port 
     38        procd_append_param command -b $cfg_buffer 
     39        procd_append_param command -l $cfg_log 
     40        [ ! -z "$cfg_cmd_start" ] && procd_append_param command -B "$cfg_cmd_start" 
     41        [ ! -z "$cfg_cmd_stop" ] && procd_append_param command -E "$cfg_cmd_stop" 
     42        [ "$cfg_cmd_wait" -eq 1 ] && procd_append_param command -w 
     43        [ ! -z "$cfg_audio_output" ] && procd_append_param command -o "$cfg_audio_output" 
     44        [ ! -z "$cfg_mdns" ] && procd_append_param command -m "$cfg_mdns" 
    2145 
    22         args="$args -d" 
    23  
    24         service_start $DAEMON $args 
     46        procd_set_param respawn 
     47        procd_close_instance 
    2548} 
    2649 
    27 start() { 
     50start_service() { 
    2851        config_load shairport 
    2952        config_foreach config_shairport shairport 
    3053} 
    31  
    32 stop() { 
    33         service_stop $DAEMON 
    34 } 
Note: See TracChangeset for help on using the changeset viewer.