Browse Source

upmpdcli: Add UPnP icon. Use procd for start/stop. Add uci config support for multiple instances

Signed-off-by: Ted Hess <thess@kitschensync.net>
lilik-openwrt-22.03
Ted Hess 10 years ago
parent
commit
4eb1e3aea4
5 changed files with 72 additions and 12 deletions
  1. +7
    -4
      multimedia/upmpdcli/Makefile
  2. +15
    -0
      multimedia/upmpdcli/files/upmpdcli.config
  3. +41
    -8
      multimedia/upmpdcli/files/upmpdcli.init
  4. BIN
      multimedia/upmpdcli/files/upmpdcli.png
  5. +9
    -0
      multimedia/upmpdcli/patches/010-Add_icon_config.patch

+ 7
- 4
multimedia/upmpdcli/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=upmpdcli
PKG_VERSION:=0.9.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@ -39,10 +39,13 @@ endef
define Package/upmpdcli/install
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/upmpdcli.conf $(1)/etc/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/upmpdcli.config $(1)/etc/config/upmpdcli
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/upmpdcli $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/share
$(CP) $(PKG_INSTALL_DIR)/usr/share/upmpdcli $(1)/usr/share/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upmpdcli $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/share/upmpdcli
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/upmpdcli/* $(1)/usr/share/upmpdcli/
$(INSTALL_DATA) ./files/upmpdcli.png $(1)/usr/share/upmpdcli/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/upmpdcli.init $(1)/etc/init.d/upmpdcli
endef


+ 15
- 0
multimedia/upmpdcli/files/upmpdcli.config View File

@ -0,0 +1,15 @@
config upmpdcli lan
option interface 'br-lan'
# option friendly_name 'upmpdcli'
# option mpd_host '127.0.0.1'
# option mpd_port '6600'
# option upmpd_port '0'
# option config '/etc/upmpdcli.conf'
# Add additional interfaces
#
#config upmpdcli wifi
# option interface 'wlan0'
#config upmpdcli wan
# option interface 'eth0'

+ 41
- 8
multimedia/upmpdcli/files/upmpdcli.init View File

@ -1,18 +1,51 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2014 OpenWrt.org
NAME=upmpdcli
START=95
create_user() {
group_exists upmpdcli || group_add upmpdcli 89
user_exists upmpdcli || user_add upmpdcli 89
UPMPD_BIN=/usr/bin/${NAME}
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}"
}
start_instance() {
local cfg="$1"
local interface
procd_open_instance
procd_set_param command "${UPMPD_BIN}"
# config_get interface "$cfg" interface
# procd_add_reload_interface_trigger $interface
append_arg "$cfg" interface "-i"
append_arg "$cfg" mpd_host "-h"
append_arg "$cfg" mpd_port "-p"
append_arg "$cfg" upmpd_port "-P"
append_arg "$cfg" config "-c"
append_arg "$cfg" friendly_name "-f"
procd_close_instance
}
start() {
create_user
service_start /usr/bin/upmpdcli -D
service_triggers() {
procd_add_reload_trigger "${NAME}"
}
stop() {
service_stop /usr/bin/upmpdcli
start_service() {
config_load ${NAME}
config_foreach start_instance ${NAME}
}

BIN
multimedia/upmpdcli/files/upmpdcli.png View File

Before After
Width: 64  |  Height: 64  |  Size: 1.6 KiB

+ 9
- 0
multimedia/upmpdcli/patches/010-Add_icon_config.patch View File

@ -0,0 +1,9 @@
--- a/src/upmpdcli.conf
+++ b/src/upmpdcli.conf
@@ -53,3 +53,6 @@ ohmetapersist = 1
# Path to the sc2mpd if it is not in /usr/bin and the location is not in
# the PATH for the init scripts.
#sc2mpd = /usr/bin/sc2mpd
+
+# Icon for MPD UPnP interface
+iconpath = /usr/share/upmpdcli/upmpdcli.png

Loading…
Cancel
Save