mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-02 23:13:56 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=airconnect
|
||||
PKG_VERSION:=1.9.3
|
||||
PKG_RELEASE=1
|
||||
|
||||
PKG_SOURCE:=AirConnect-$(PKG_VERSION).zip
|
||||
PKG_SOURCE_URL:=https://github.com/philippe44/AirConnect/releases/download/$(PKG_VERSION)/
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/airconnect-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=sbwml <admin@cooluc.com>
|
||||
|
||||
ifeq ($(ARCH),arm)
|
||||
ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
|
||||
ifeq ($(ARM_CPU_FEATURES),)
|
||||
ARCH:=armv6
|
||||
endif
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=AirConnect
|
||||
URL:=https://github.com/philippe44/AirConnect
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Use AirPlay to stream to UPnP/Sonos & Chromecast devices
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/airconnect
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
unzip -q -d $(PKG_BUILD_DIR) $(DL_DIR)/AirConnect-$(PKG_VERSION).zip
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/config $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/airconnect.init $(1)/etc/init.d/airconnect
|
||||
$(INSTALL_CONF) ./files/airconnect.config $(1)/etc/config/airconnect
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/aircast-linux-$(ARCH)-static $(1)/usr/bin/aircast
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/airupnp-linux-$(ARCH)-static $(1)/usr/bin/airupnp
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
config airconnect 'config'
|
||||
option 'enabled' '0'
|
||||
option 'interface' 'br-lan'
|
||||
option 'aircast' '1'
|
||||
option 'airupnp' '1'
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
PROG_AIRCAST=/usr/bin/aircast
|
||||
PROG_AIRUPNP=/usr/bin/airupnp
|
||||
|
||||
get_config() {
|
||||
config_get enabled $1 enabled "0"
|
||||
config_get interface $1 interface "br-lan"
|
||||
config_get aircast $1 aircast "1"
|
||||
config_get airupnp $1 airupnp "1"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load "airconnect"
|
||||
config_foreach get_config "airconnect"
|
||||
[ $enabled -eq 0 ] && return 0
|
||||
|
||||
# UPnP/Sonos
|
||||
if [ "$airupnp" -eq 1 ]; then
|
||||
procd_open_instance airupnp
|
||||
procd_set_param command $PROG_AIRUPNP
|
||||
procd_append_param command -l 1000:2000
|
||||
procd_append_param command -Z
|
||||
procd_append_param command -b $interface
|
||||
procd_set_param stdout 0
|
||||
procd_set_param stderr 0
|
||||
procd_set_param respawn
|
||||
procd_close_instance airupnp
|
||||
fi
|
||||
|
||||
# Chromecast
|
||||
if [ "$aircast" -eq 1 ]; then
|
||||
procd_open_instance aircast
|
||||
procd_set_param command $PROG_AIRCAST
|
||||
procd_append_param command -l 1000:2000
|
||||
procd_append_param command -Z
|
||||
procd_append_param command -b $interface
|
||||
procd_set_param stdout 0
|
||||
procd_set_param stderr 0
|
||||
procd_set_param respawn
|
||||
procd_close_instance aircast
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "airconnect"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
Reference in new issue
Block a user