@ -0,0 +1,57 @@ | |||||
# | |||||
# Copyright (C) 2013 OpenWrt.org | |||||
# | |||||
# This is free software, licensed under the GNU General Public License v2. | |||||
# See /LICENSE for more information. | |||||
# | |||||
include $(TOPDIR)/rules.mk | |||||
PKG_NAME:=shairport | |||||
PKG_VERSION:=2014-05-08 | |||||
PKG_RELEASE:=$(PKG_SOURCE_VERSION) | |||||
PKG_SOURCE_PROTO:=git | |||||
PKG_SOURCE_URL:=git://github.com/abrasive/shairport.git | |||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) | |||||
PKG_SOURCE_VERSION:=078b21043cdcef6ffad7452db27f036770b23b0c | |||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz | |||||
include $(INCLUDE_DIR)/package.mk | |||||
define Package/shairport | |||||
SECTION:=multimedia | |||||
CATEGORY:=Multimedia | |||||
DEPENDS:=+libpthread +avahi-utils +libopenssl +libao +libavahi-client \ | |||||
+alsa-utils | |||||
TITLE:=ShairPort AirPort Express emulator | |||||
endef | |||||
define Package/shairport/description | |||||
This program emulates an AirPort Express for the purpose of streaming | |||||
music from iTunes and compatible iPods. It implements a server for the | |||||
Apple RAOP protocol. | |||||
ShairPort does not support AirPlay v2 (video and photo streaming). | |||||
It supports multiple simultaneous streams, if your audio output chain | |||||
(as detected by libao) does so. | |||||
endef | |||||
TARGET_CFLAGS += $(FPIC) | |||||
LIBS:=-lao -lm -lcrypto -lpthread -lavahi-common -lavahi-client -lasound | |||||
MAKE_FLAGS += \ | |||||
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ | |||||
LDFLAGS="$(TARGET_LDFLAGS) $(LIBS)" | |||||
define Package/shairport/install | |||||
$(INSTALL_DIR) $(1)/usr/sbin | |||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/shairport $(1)/usr/sbin/ | |||||
$(INSTALL_DIR) $(1)/etc/init.d/ | |||||
$(INSTALL_BIN) files/shairport.init $(1)/etc/init.d/shairport | |||||
$(INSTALL_DIR) $(1)/etc/config | |||||
$(INSTALL_CONF) files/shairport.config $(1)/etc/config/shairport | |||||
endef | |||||
$(eval $(call BuildPackage,shairport)) |
@ -0,0 +1,11 @@ | |||||
config shairport | |||||
option name 'AirPort' | |||||
option password '' | |||||
option port '5002' | |||||
option buffer '256' | |||||
option log '/var/log/shairport' | |||||
option cmd_start '' | |||||
option cmd_stop '' | |||||
option cmd_wait '0' | |||||
option audio_output '' | |||||
option mdns '' |
@ -0,0 +1,53 @@ | |||||
#!/bin/sh /etc/rc.common | |||||
# Copyright (C) 2013-2014 OpenWrt.org | |||||
START=50 | |||||
USE_PROCD=1 | |||||
config_shairport() { | |||||
local cfg="$1" | |||||
local cfg_name | |||||
local cfg_password | |||||
local cfg_port | |||||
local cfg_buffer | |||||
local cfg_log | |||||
local cfg_cmd_start | |||||
local cfg_cmd_stop | |||||
local cfg_cmd_wait | |||||
local cfg_audio_output | |||||
local cfg_mdns | |||||
config_get cfg_name $cfg 'name' 'AirPort' | |||||
config_get cfg_password $cfg 'password' '' | |||||
config_get cfg_port $cfg 'port' '5002' | |||||
config_get cfg_buffer $cfg 'buffer' '256' | |||||
config_get cfg_log $cfg 'log' '/var/log/shairport' | |||||
config_get cfg_cmd_start $cfg 'cmd_start' '' | |||||
config_get cfg_cmd_stop $cfg 'cmd_stop' '' | |||||
config_get_bool cfg_cmd_wait $cfg 'cmd_wait' '0' | |||||
config_get cfg_audio_output $cfg 'audio_output' '' | |||||
config_get cfg_mdns $cfg 'mdns' '' | |||||
procd_open_instance | |||||
procd_set_param command /usr/sbin/shairport | |||||
procd_append_param command -a "$cfg_name" | |||||
[ ! -z "$cfg_password" ] && procd_append_param command -k "$cfg_password" | |||||
procd_append_param command -p $cfg_port | |||||
procd_append_param command -b $cfg_buffer | |||||
procd_append_param command -l $cfg_log | |||||
[ ! -z "$cfg_cmd_start" ] && procd_append_param command -B "$cfg_cmd_start" | |||||
[ ! -z "$cfg_cmd_stop" ] && procd_append_param command -E "$cfg_cmd_stop" | |||||
[ "$cfg_cmd_wait" -eq 1 ] && procd_append_param command -w | |||||
[ ! -z "$cfg_audio_output" ] && procd_append_param command -o "$cfg_audio_output" | |||||
[ ! -z "$cfg_mdns" ] && procd_append_param command -m "$cfg_mdns" | |||||
procd_set_param respawn | |||||
procd_close_instance | |||||
} | |||||
start_service() { | |||||
config_load shairport | |||||
config_foreach config_shairport shairport | |||||
} |
@ -0,0 +1,11 @@ | |||||
--- a/configure | |||||
+++ b/configure | |||||
@@ -59,7 +59,7 @@ do_pkg_config() | |||||
do_pkg_config OpenSSL openssl | |||||
do_pkg_config libao ao CONFIG_AO | |||||
-do_pkg_config PulseAudio libpulse-simple CONFIG_PULSE | |||||
+#do_pkg_config PulseAudio libpulse-simple CONFIG_PULSE | |||||
do_pkg_config ALSA alsa CONFIG_ALSA | |||||
do_pkg_config Avahi\ client avahi-client CONFIG_AVAHI | |||||