diff --git a/acct-group/navidrome/metadata.xml b/acct-group/navidrome/metadata.xml new file mode 100644 index 0000000..da58abe --- /dev/null +++ b/acct-group/navidrome/metadata.xml @@ -0,0 +1,8 @@ + + + + + gentoo@tastytea.de + tastytea + + diff --git a/acct-group/navidrome/navidrome-0.ebuild b/acct-group/navidrome/navidrome-0.ebuild new file mode 100644 index 0000000..274302d --- /dev/null +++ b/acct-group/navidrome/navidrome-0.ebuild @@ -0,0 +1,11 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit acct-group + +DESCRIPTION="Group for Navidrome" +KEYWORDS="~amd64" + +ACCT_GROUP_ID=-1 diff --git a/acct-user/navidrome/metadata.xml b/acct-user/navidrome/metadata.xml new file mode 100644 index 0000000..da58abe --- /dev/null +++ b/acct-user/navidrome/metadata.xml @@ -0,0 +1,8 @@ + + + + + gentoo@tastytea.de + tastytea + + diff --git a/acct-user/navidrome/navidrome-0.ebuild b/acct-user/navidrome/navidrome-0.ebuild new file mode 100644 index 0000000..a577dc0 --- /dev/null +++ b/acct-user/navidrome/navidrome-0.ebuild @@ -0,0 +1,15 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit acct-user + +DESCRIPTION="User for Navidrome" +KEYWORDS="~amd64" + +ACCT_USER_ID=-1 +ACCT_USER_HOME="/var/lib/navidrome" +ACCT_USER_GROUPS=( ${PN} ) + +acct-user_add_deps diff --git a/media-sound/navidrome-bin/Manifest b/media-sound/navidrome-bin/Manifest new file mode 100644 index 0000000..cbc65a2 --- /dev/null +++ b/media-sound/navidrome-bin/Manifest @@ -0,0 +1 @@ +DIST navidrome_0.51.1_linux_amd64.tar.gz 15018686 BLAKE2B d1c484d041f4a0adc6884815d156c3770d68d7b493dfd351dc0d86417a2108a27af214fd887055412909adbda434ae762c74f82d8589acb847b6aa8c1c650220 SHA512 6da3d9b0b0084d97bf23eaf596552280c012082edf64f173a33282c56f5fe18091e6a6dba1a3a495f18dc937dc5fba505e6eb75e51cf3292d4aa53fec60f7704 diff --git a/media-sound/navidrome-bin/files/navidrome.initd b/media-sound/navidrome-bin/files/navidrome.initd new file mode 100644 index 0000000..e32d13a --- /dev/null +++ b/media-sound/navidrome-bin/files/navidrome.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +: ${navidrome_config:=/var/lib/navidrome/navidrome.toml} +: ${navidrome_home:=/var/lib/navidrome} +: ${navidrome_args:=} + +name="navidrome daemon" +description="Navidrome Music Server and Streamer compatible with Subsonic/Airsonic" +command=/usr/bin/navidrome +command_args="--configfile ${navidrome_config} ${navidrome_args}" +command_user="navidrome:navidrome" +pidfile="/run/navidrome.pid" +directory="${navidrome_home}" + +depend() { + need net +} diff --git a/media-sound/navidrome-bin/files/navidrome.service b/media-sound/navidrome-bin/files/navidrome.service new file mode 100644 index 0000000..c8d1bc4 --- /dev/null +++ b/media-sound/navidrome-bin/files/navidrome.service @@ -0,0 +1,47 @@ +[Unit] +Description=Navidrome Music Server and Streamer compatible with Subsonic/Airsonic +After=remote-fs.target network.target +AssertPathExists=/var/lib/navidrome + +[Install] +WantedBy=multi-user.target + +[Service] +User= +Group= +Type=simple +ExecStart=/usr/bin/navidrome --configfile "/var/lib/navidrome/navidrome.toml" +WorkingDirectory=/var/lib/navidrome +TimeoutStopSec=20 +KillMode=process +Restart=on-failure + +# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html +DevicePolicy=closed +NoNewPrivileges=yes +PrivateTmp=yes +PrivateUsers=yes +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 +RestrictNamespaces=yes +RestrictRealtime=yes +SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap +ReadWritePaths=/var/lib/navidrome + +# You can uncomment the following line if you're not using the jukebox This +# will prevent navidrome from accessing any real (physical) devices +#PrivateDevices=yes + +# You can change the following line to `strict` instead of `full` if you don't +# want navidrome to be able to write anything on your filesystem outside of +# /var/lib/navidrome. +ProtectSystem=full + +# You can uncomment the following line if you don't have any media in /home/*. +# This will prevent navidrome from ever reading/writing anything there. +#ProtectHome=true + +# You can customize some Navidrome config options by setting environment variables here. Ex: +#Environment=ND_BASEURL="/navidrome" diff --git a/media-sound/navidrome-bin/metadata.xml b/media-sound/navidrome-bin/metadata.xml new file mode 100644 index 0000000..da58abe --- /dev/null +++ b/media-sound/navidrome-bin/metadata.xml @@ -0,0 +1,8 @@ + + + + + gentoo@tastytea.de + tastytea + + diff --git a/media-sound/navidrome-bin/navidrome-bin-0.51.1.ebuild b/media-sound/navidrome-bin/navidrome-bin-0.51.1.ebuild new file mode 100644 index 0000000..eb91303 --- /dev/null +++ b/media-sound/navidrome-bin/navidrome-bin-0.51.1.ebuild @@ -0,0 +1,41 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit systemd + +DESCRIPTION="Music Server and Streamer compatible with Subsonic/Airsonic" +HOMEPAGE="https://www.navidrome.org/" +SRC_URI="https://github.com/navidrome/navidrome/releases/download/v${PV}/navidrome_${PV}_linux_amd64.tar.gz" +S="${WORKDIR}" + +LICENSE="GPL-3" +SLOT="0" +# KEYWORDS="~amd64" + +DEPEND="" +RDEPEND="media-video/ffmpeg" # TODO: ffmpeg USE-flags? +BDEPEND="" + +src_prepare() { + cat << EOF > navidrome.toml +# see for more options + +# ScanSchedule = '@every 24h' +# MusicFolder = '/media/music' +EOF + + default +} + +src_install() { + dobin navidrome + dodoc README.md + insinto /var/lib/navidrome + doins navidrome.toml + fowners -R navidrome:navidrome /var/lib/navidrome + + systemd_dounit "${FILESDIR}"/navidrome.service + newinit.d "${FILESDIR}"/navidrome.initd +}