shairplay: Move to sound menu and sub-directory 856/head
authorTed Hess <thess@kitschensync.net>
Wed, 4 Feb 2015 20:13:08 +0000 (15:13 -0500)
committerTed Hess <thess@kitschensync.net>
Wed, 4 Feb 2015 20:13:08 +0000 (15:13 -0500)
Signed-off-by: Ted Hess <thess@kitschensync.net>
12 files changed:
multimedia/shairplay/Makefile [deleted file]
multimedia/shairplay/files/shairplay.config [deleted file]
multimedia/shairplay/files/shairplay.init [deleted file]
multimedia/shairplay/patches/001-key_file_dir.patch [deleted file]
multimedia/shairplay/patches/002-libavahi-compat-dnssd.patch [deleted file]
multimedia/shairplay/patches/003-fix_big-endian.patch [deleted file]
sound/shairplay/Makefile [new file with mode: 0644]
sound/shairplay/files/shairplay.config [new file with mode: 0644]
sound/shairplay/files/shairplay.init [new file with mode: 0644]
sound/shairplay/patches/001-key_file_dir.patch [new file with mode: 0644]
sound/shairplay/patches/002-libavahi-compat-dnssd.patch [new file with mode: 0644]
sound/shairplay/patches/003-fix_big-endian.patch [new file with mode: 0644]

diff --git a/multimedia/shairplay/Makefile b/multimedia/shairplay/Makefile
deleted file mode 100644 (file)
index 1dc61f7..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# 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-27
-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:=+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))
diff --git a/multimedia/shairplay/files/shairplay.config b/multimedia/shairplay/files/shairplay.config
deleted file mode 100644 (file)
index 6e1f939..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-config shairplay main
-       option disabled '1'
-       option respawn '1'
-       option apname 'AirPlay'
-       option port '5000'
-       option password ''
-       option hwaddr ''
-       option ao_driver 'oss'
-       option ao_devicename ''
-       option ao_deviceid ''
diff --git a/multimedia/shairplay/files/shairplay.init b/multimedia/shairplay/files/shairplay.init
deleted file mode 100644 (file)
index 093a168..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/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"
-       local aux
-
-       config_get_bool aux "$cfg" 'disabled' '0'
-       [ "$aux" = 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"
-
-       config_get_bool aux "$cfg" 'respawn' '0'
-       [ "$aux" = 1 ] && procd_set_param respawn
-
-       procd_close_instance
-}
-
-service_triggers() { 
-       procd_add_reload_trigger "shairplay" 
-}
-
-start_service() {
-       config_load shairplay
-       config_foreach start_instance shairplay
-}
diff --git a/multimedia/shairplay/patches/001-key_file_dir.patch b/multimedia/shairplay/patches/001-key_file_dir.patch
deleted file mode 100644 (file)
index 3c5e3a5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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");
diff --git a/multimedia/shairplay/patches/002-libavahi-compat-dnssd.patch b/multimedia/shairplay/patches/002-libavahi-compat-dnssd.patch
deleted file mode 100644 (file)
index ff70e24..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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);
diff --git a/multimedia/shairplay/patches/003-fix_big-endian.patch b/multimedia/shairplay/patches/003-fix_big-endian.patch
deleted file mode 100644 (file)
index 7764aab..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
---- 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;
diff --git a/sound/shairplay/Makefile b/sound/shairplay/Makefile
new file mode 100644 (file)
index 0000000..9ee6663
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2015 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-27
+PKG_RELEASE:=2
+
+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:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+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))
diff --git a/sound/shairplay/files/shairplay.config b/sound/shairplay/files/shairplay.config
new file mode 100644 (file)
index 0000000..6e1f939
--- /dev/null
@@ -0,0 +1,10 @@
+config shairplay main
+       option disabled '1'
+       option respawn '1'
+       option apname 'AirPlay'
+       option port '5000'
+       option password ''
+       option hwaddr ''
+       option ao_driver 'oss'
+       option ao_devicename ''
+       option ao_deviceid ''
diff --git a/sound/shairplay/files/shairplay.init b/sound/shairplay/files/shairplay.init
new file mode 100644 (file)
index 0000000..093a168
--- /dev/null
@@ -0,0 +1,51 @@
+#!/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"
+       local aux
+
+       config_get_bool aux "$cfg" 'disabled' '0'
+       [ "$aux" = 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"
+
+       config_get_bool aux "$cfg" 'respawn' '0'
+       [ "$aux" = 1 ] && procd_set_param respawn
+
+       procd_close_instance
+}
+
+service_triggers() { 
+       procd_add_reload_trigger "shairplay" 
+}
+
+start_service() {
+       config_load shairplay
+       config_foreach start_instance shairplay
+}
diff --git a/sound/shairplay/patches/001-key_file_dir.patch b/sound/shairplay/patches/001-key_file_dir.patch
new file mode 100644 (file)
index 0000000..3c5e3a5
--- /dev/null
@@ -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");
diff --git a/sound/shairplay/patches/002-libavahi-compat-dnssd.patch b/sound/shairplay/patches/002-libavahi-compat-dnssd.patch
new file mode 100644 (file)
index 0000000..ff70e24
--- /dev/null
@@ -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);
diff --git a/sound/shairplay/patches/003-fix_big-endian.patch b/sound/shairplay/patches/003-fix_big-endian.patch
new file mode 100644 (file)
index 0000000..7764aab
--- /dev/null
@@ -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;