Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>lilik-openwrt-22.03
@ -0,0 +1,56 @@ | |||||
# | |||||
# Copyright (C) 2014 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:=shairplay | |||||
PKG_VERSION:=2014-10-25 | |||||
PKG_RELEASE:=$(PKG_SOURCE_VERSION) | |||||
PKG_SOURCE_PROTO:=git | |||||
PKG_SOURCE_URL:=git://github.com/juhovh/shairplay.git | |||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) | |||||
PKG_SOURCE_VERSION:=64d59e3087f829006d091fa0d114efb50972a2bf | |||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz | |||||
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com> | |||||
PKG_LICENSE:=MIT | |||||
PKG_LICENSE_FILES:=LICENSE | |||||
include $(INCLUDE_DIR)/package.mk | |||||
PKG_FIXUP:=libtool | |||||
define Package/shairplay | |||||
SECTION:=multimedia | |||||
CATEGORY:=Multimedia | |||||
DEPENDS:=+avahi-daemon +libao +libavahi-compat-libdnssd +libltdl +libpthread | |||||
TITLE:=Shairplay | |||||
endef | |||||
define Build/Configure | |||||
(cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \ | |||||
./autogen.sh;) | |||||
$(call Build/Configure/Default) | |||||
endef | |||||
define Package/shairplay/description | |||||
Free portable AirPlay server implementation similar to ShairPort. | |||||
endef | |||||
define Package/shairplay/install | |||||
$(INSTALL_DIR) $(1)/usr/bin | |||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/shairplay $(1)/usr/bin/ | |||||
$(INSTALL_DIR) $(1)/usr/share/shairplay | |||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/airport.key $(1)/usr/share/shairplay/ | |||||
$(INSTALL_DIR) $(1)/etc/init.d | |||||
$(INSTALL_BIN) files/shairplay.init $(1)/etc/init.d/shairplay | |||||
$(INSTALL_DIR) $(1)/etc/config | |||||
$(INSTALL_CONF) files/shairplay.config $(1)/etc/config/shairplay | |||||
endef | |||||
$(eval $(call BuildPackage,shairplay)) |
@ -0,0 +1,9 @@ | |||||
config shairplay main | |||||
option disabled '1' | |||||
option apname 'AirPlay' | |||||
option port '5000' | |||||
option password '' | |||||
option hwaddr '' | |||||
option ao_driver 'oss' | |||||
option ao_devicename '' | |||||
option ao_deviceid '' |
@ -0,0 +1,47 @@ | |||||
#!/bin/sh /etc/rc.common | |||||
# Copyright (C) 2014 OpenWrt.org | |||||
START=90 | |||||
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" | |||||
config_get_bool disabled "$cfg" 'disabled' '0' | |||||
[ "$disabled" = 1 ] && return 1 | |||||
procd_open_instance | |||||
procd_set_param command /usr/bin/shairplay | |||||
append_arg "$cfg" apname "--apname" "AirPlay" | |||||
append_arg "$cfg" port "--server_port" | |||||
append_arg "$cfg" password "--password" | |||||
append_arg "$cfg" hwaddr "--hwaddr" | |||||
append_arg "$cfg" ao_driver "--ao_driver" | |||||
append_arg "$cfg" ao_devicename "--ao_devicename" | |||||
append_arg "$cfg" ao_deviceid "--ao_deviceid" | |||||
procd_close_instance | |||||
} | |||||
service_triggers() { | |||||
procd_add_reload_trigger "shairplay" | |||||
} | |||||
start_service() { | |||||
config_load shairplay | |||||
config_foreach start_instance shairplay | |||||
} |
@ -0,0 +1,11 @@ | |||||
--- a/src/shairplay.c | |||||
+++ b/src/shairplay.c | |||||
@@ -346,7 +346,7 @@ main(int argc, char *argv[]) | |||||
raop_cbs.audio_destroy = audio_destroy; | |||||
raop_cbs.audio_set_volume = audio_set_volume; | |||||
- raop = raop_init_from_keyfile(10, &raop_cbs, "airport.key", NULL); | |||||
+ raop = raop_init_from_keyfile(10, &raop_cbs, "/usr/share/shairplay/airport.key", NULL); | |||||
if (raop == NULL) { | |||||
fprintf(stderr, "Could not initialize the RAOP service\n"); | |||||
fprintf(stderr, "Please make sure the airport.key file is in the current directory.\n"); |
@ -0,0 +1,11 @@ | |||||
--- a/src/lib/dnssd.c | |||||
+++ b/src/lib/dnssd.c | |||||
@@ -167,7 +167,7 @@ dnssd_init(int *error) | |||||
return NULL; | |||||
} | |||||
#elif USE_LIBDL | |||||
- dnssd->module = dlopen("libdns_sd.so", RTLD_LAZY); | |||||
+ dnssd->module = dlopen("libdns_sd.so.1", RTLD_LAZY); | |||||
if (!dnssd->module) { | |||||
if (error) *error = DNSSD_ERROR_LIBNOTFOUND; | |||||
free(dnssd); |
@ -0,0 +1,24 @@ | |||||
--- a/src/lib/alac/alac.c | |||||
+++ b/src/lib/alac/alac.c | |||||
@@ -29,11 +29,7 @@ | |||||
* | |||||
*/ | |||||
-#ifdef __BIG_ENDIAN__ | |||||
-static const int host_bigendian = 1; | |||||
-#else | |||||
-static const int host_bigendian = 0; | |||||
-#endif | |||||
+static int host_bigendian = 0; | |||||
#include <stdio.h> | |||||
#include <stdlib.h> | |||||
@@ -1181,6 +1177,8 @@ alac_file *create_alac(int samplesize, i | |||||
{ | |||||
alac_file *newfile = malloc(sizeof(alac_file)); | |||||
+ host_bigendian = (htonl(42) == 42); | |||||
+ | |||||
newfile->samplesize = samplesize; | |||||
newfile->numchannels = numchannels; | |||||
newfile->bytespersample = (samplesize / 8) * numchannels; |