add new package: media-sound/navidrome-bin

This commit is contained in:
tastytea 2024-03-22 11:16:11 +01:00
parent 593397acb8
commit db55a393a7
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
9 changed files with 158 additions and 0 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>gentoo@tastytea.de</email>
<name>tastytea</name>
</maintainer>
</pkgmetadata>

View File

@ -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

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>gentoo@tastytea.de</email>
<name>tastytea</name>
</maintainer>
</pkgmetadata>

View File

@ -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

View File

@ -0,0 +1 @@
DIST navidrome_0.51.1_linux_amd64.tar.gz 15018686 BLAKE2B d1c484d041f4a0adc6884815d156c3770d68d7b493dfd351dc0d86417a2108a27af214fd887055412909adbda434ae762c74f82d8589acb847b6aa8c1c650220 SHA512 6da3d9b0b0084d97bf23eaf596552280c012082edf64f173a33282c56f5fe18091e6a6dba1a3a495f18dc937dc5fba505e6eb75e51cf3292d4aa53fec60f7704

View File

@ -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
}

View File

@ -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=<user>
Group=<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"

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>gentoo@tastytea.de</email>
<name>tastytea</name>
</maintainer>
</pkgmetadata>

View File

@ -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 <https://www.navidrome.org/docs/usage/configuration-options/#available-options> 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
}