summaryrefslogtreecommitdiff
path: root/media-sound/owntone
diff options
context:
space:
mode:
Diffstat (limited to 'media-sound/owntone')
-rw-r--r--media-sound/owntone/Manifest6
-rw-r--r--media-sound/owntone/files/owntone-28.9-stream-support.patch22
-rw-r--r--media-sound/owntone/files/owntone.confd9
-rw-r--r--media-sound/owntone/files/owntone.initd40
-rw-r--r--media-sound/owntone/metadata.xml13
-rw-r--r--media-sound/owntone/owntone-28.9.ebuild85
6 files changed, 175 insertions, 0 deletions
diff --git a/media-sound/owntone/Manifest b/media-sound/owntone/Manifest
new file mode 100644
index 000000000000..549a9e9c0f9f
--- /dev/null
+++ b/media-sound/owntone/Manifest
@@ -0,0 +1,6 @@
+AUX owntone-28.9-stream-support.patch 848 BLAKE2B ce4b2083d2beee8129255a133849096e582a6dab19a5a16206c8fddbcf96f694e35408977096368f84b67ca73d9f5fca938e570134cf882a781a205a0ed4511d SHA512 11499bce393c50836b716274f9033130de7ac7f994549ff0eb04466788ea53b2a879555472774741d9504edc42ea733fe272351c4979d6ba15319c97c8135182
+AUX owntone.confd 227 BLAKE2B f19256cbe06f06471f5e6d7e4ab6f96dd108acc801e76ddbf2ac6219e373a919885e506442134e5838dbdabf6cc2481590aeedd690df707eeab325524449e6b5 SHA512 7b436941609b54685ce17bbe5f274b13bb742441683409be0a8f98a8f758dd45f1706ba667fb8023b6e1dd1589d8d02bec03cee42737c5da0d57904d6928a252
+AUX owntone.initd 822 BLAKE2B 48d39eaf2a812058d8d6d3469bb65d2baa9ca992304bc5ec7557c75dc4afaba3665c8cab763a7277bb4f8cbaba44efe60a53e4ed9b2d8585f95f83a7f24fe45c SHA512 8bc2dca5894850cb5274c7ff09f72c8d0585182fe6150e894488670e06784a7bb13ac8393c20cd2f1d483b931e2701f92550a206b122e1fd0d2cd597a0ed4a1a
+DIST owntone-28.9.tar.xz 1066248 BLAKE2B 68ba46e6ff2e406d54ccfe387191a67d4eb7590db3039d87ffcd5eabf7417059084997f0d6be810d164616cd663b2e4143714ef4ac31acb7d91e254ccd342465 SHA512 29f42a4a8c9501a038ecc5026fc4bce9d777dee722937b89a55523cd68f001c821017d09f32b704a0c331879f7049d7d087d8e6899c82924f45401b012c65e95
+EBUILD owntone-28.9.ebuild 1760 BLAKE2B d3ef912c1225e63a1de9dc4ab2a27fcf4f7c1a40c569f619c55853f8d90cfe3e21a1ae4d7cf2fcb5ee6dddb1b3b55ba53174f1cc5d6ab91301b0665cb6e5bd51 SHA512 7b703ddb3caf2cf691dc0644e316918ee7665490bcb534b42865709563e70346913c8abe1231251fec5f8b3fc676fbc256039bd7c430375b0bfa6494a1abad09
+MISC metadata.xml 403 BLAKE2B efbee0defee322407b936352527f4977549249fc59371d7be2c9d396303c7fbe3adad16ed562c87cb3b7ea0a8e5077f8f0cf3a41f354ee778f913f46081e2eff SHA512 2a6b993fe4989132a85969b88124169ca2079e98a984f597cee5a5c48300dc78babd748765575e14a8247f6cbf81b58b1d12808ac765a9a11357e40d74433cdf
diff --git a/media-sound/owntone/files/owntone-28.9-stream-support.patch b/media-sound/owntone/files/owntone-28.9-stream-support.patch
new file mode 100644
index 000000000000..9206c3ff5298
--- /dev/null
+++ b/media-sound/owntone/files/owntone-28.9-stream-support.patch
@@ -0,0 +1,22 @@
+Mimick MPDs httpd plugin, while owntone doesn't listen for port 8000 for
+this, a proxy in front could map that to stream.mp3 easily.
+
+diff --git a/src/mpd.c b/src/mpd.c
+index 10645409..0ac30867 100644
+--- a/src/mpd.c
++++ b/src/mpd.c
+@@ -3753,6 +3753,14 @@ speaker_enum_cb(struct player_speaker_info *spk, void *arg)
+ static int
+ mpd_command_outputs(struct evbuffer *evbuf, int argc, char **argv, char **errmsg, struct mpd_client_ctx *ctx)
+ {
++ /* emulate MPDs output for http stream, as "httpd" plugin, which some
++ * clients look for to ascertain there is stream playback support */
++ evbuffer_add_printf(evbuf,
++ "outputid: 65536\n" /* USHRT_MAX + 1 */
++ "outputname: MP3 stream\n"
++ "plugin: httpd\n"
++ "outputenabled: 1\n");
++
+ player_speaker_enumerate(speaker_enum_cb, evbuf);
+
+ return 0;
diff --git a/media-sound/owntone/files/owntone.confd b/media-sound/owntone/files/owntone.confd
new file mode 100644
index 000000000000..5f69b10aa6ae
--- /dev/null
+++ b/media-sound/owntone/files/owntone.confd
@@ -0,0 +1,9 @@
+# Copyright 1999-2024 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# user and group to run owntone as
+#USER=owntone
+#GROUP=audio
+
+# any options to use when starting owntone
+#EXTRA_OPTS=
diff --git a/media-sound/owntone/files/owntone.initd b/media-sound/owntone/files/owntone.initd
new file mode 100644
index 000000000000..ee99dae982b6
--- /dev/null
+++ b/media-sound/owntone/files/owntone.initd
@@ -0,0 +1,40 @@
+#!/sbin/openrc-run
+# Copyright 1999-2024 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="DAAP/DACP (iTunes), RSP and MPD server."
+
+command="/usr/sbin/owntone"
+pidfile="/run/owntone/${SVCNAME}.pid"
+conffile="/etc/${SVCNAME}.conf"
+user=${USER:-owntone}
+group=${GROUP:-audio}
+
+depend() {
+ need net avahi-daemon
+ use dns
+}
+
+start_pre() {
+ mkdir -p "${pidfile%/*}"
+ chown ${user}:${group} "${pidfile%/*}"
+}
+
+stop_post() {
+ rm -f "${pidfile}"
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --pidfile "${pidfile}" \
+ --user ${user} --group ${group} \
+ --exec ${command} -- -P "${pidfile}" -c "${conffile}" \
+ ${EXTRA_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec ${command} --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/media-sound/owntone/metadata.xml b/media-sound/owntone/metadata.xml
new file mode 100644
index 000000000000..600501543b2d
--- /dev/null
+++ b/media-sound/owntone/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>grobian@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="chromecast">build and install Chromecast support</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">owntone/owntone-server</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-sound/owntone/owntone-28.9.ebuild b/media-sound/owntone/owntone-28.9.ebuild
new file mode 100644
index 000000000000..f18018075487
--- /dev/null
+++ b/media-sound/owntone/owntone-28.9.ebuild
@@ -0,0 +1,85 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="DAAP (iTunes) and MPD media server"
+HOMEPAGE="https://owntone.github.io/owntone-server"
+SRC_URI="https://github.com/owntone/owntone-server/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+alsa +chromecast"
+
+RDEPEND="
+ app-pda/libplist
+ dev-db/sqlite:3
+ dev-libs/confuse
+ dev-libs/json-c
+ dev-libs/libevent
+ dev-libs/libgcrypt
+ dev-libs/libsodium
+ dev-libs/libunistring
+ dev-libs/libxml2
+ dev-libs/mxml:0
+ dev-libs/protobuf-c
+ media-libs/alsa-lib
+ media-video/ffmpeg
+ net-dns/avahi
+ net-libs/libwebsockets
+ net-misc/curl
+ sys-devel/gettext
+ sys-libs/zlib
+ acct-group/audio
+ acct-user/owntone
+ alsa? ( media-libs/alsa-lib )
+ chromecast? ( net-libs/gnutls media-video/ffmpeg[opus] )
+"
+DEPEND="${RDEPEND}
+ dev-util/gperf
+ sys-apps/gawk
+ sys-devel/bison
+ sys-devel/flex
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-28.9-stream-support.patch
+)
+
+src_prepare() {
+ default
+
+ # fix log path, and enable songs/cache databases
+ sed -i \
+ -e "/logfile = /s:= .*$:= ${EPREFIX}/var/log/owntone/owntone.log:" \
+ -e "/\(db_path\|cache_path\) =/s:/cache/:/:" \
+ -e "/\(db_path\|cache_path\) =/s:^#::" \
+ owntone.conf.in || die
+}
+
+src_configure() {
+ econf \
+ --without-pulseaudio \
+ --with-libwebsockets \
+ --with-avahi \
+ --with-user=owntone \
+ --with-group=audio \
+ $(use_with alsa) \
+ $(use_enable chromecast) || die
+}
+
+src_install() {
+ default
+
+ rm -Rf "${ED}"/var/lib # all empty dirs
+ find "${ED}" -name "*.la" -delete
+
+ keepdir /var/lib/owntone
+ keepdir /var/log/owntone
+ fowners owntone /var/log/owntone
+
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}