diff options
| author | Tobias Kortkamp <tobik@FreeBSD.org> | 2019-08-06 05:18:37 +0000 |
|---|---|---|
| committer | Tobias Kortkamp <tobik@FreeBSD.org> | 2019-08-06 05:18:37 +0000 |
| commit | e818dbb82dde1fde75e772e8aed85f6a219ca3c7 (patch) | |
| tree | a5acfc8ca18454883112e62dd8753739f5103e47 | |
| parent | 171e89fa66264cbb3b304fdd4b59f3f83efa595f (diff) | |
Notes
| -rw-r--r-- | audio/spotifyd/Makefile | 6 | ||||
| -rw-r--r-- | audio/spotifyd/files/spotifyd.conf | 3 | ||||
| -rw-r--r-- | audio/spotifyd/files/spotifyd.in | 40 |
3 files changed, 48 insertions, 1 deletions
diff --git a/audio/spotifyd/Makefile b/audio/spotifyd/Makefile index 86cb05993a9b..9821e9edf427 100644 --- a/audio/spotifyd/Makefile +++ b/audio/spotifyd/Makefile @@ -2,6 +2,7 @@ PORTNAME= spotifyd DISTVERSION= 0.2.11 +PORTREVISION= 1 CATEGORIES= audio MAINTAINER= tobik@FreeBSD.org @@ -19,6 +20,7 @@ GH_TUPLE= plietar:dns-parser:1d3e5a5591bc72eb061c23bd426c4a25f2f73791:dnsparser librespot-org:librespot:4e3576ba7c6146cf68e1953daeec929d619b26b1:librespot \ plietar:rust-mdns:66a74033da6c9f1a06e7b0a29f4544fd189d6479:mdns \ plietar:rust-tremor:5958cc302e78f535dad90e9665da981ddff4000a:tremor +USE_RC_SUBR= spotifyd CARGO_CRATES= adler32-1.0.3 \ advapi32-sys-0.2.0 \ @@ -336,7 +338,8 @@ CARGO_BUILD_ARGS= --no-default-features CARGO_INSTALL_ARGS= --no-default-features CARGO_TEST_ARGS= --no-default-features -PLIST_FILES= bin/spotifyd +PLIST_FILES= bin/spotifyd \ + "@sample etc/spotifyd.conf.sample" PORTDOCS= README.md OPTIONS_DEFINE= DBUS DOCS PORTAUDIO PULSEAUDIO @@ -358,6 +361,7 @@ post-patch: post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/spotifyd + ${INSTALL_DATA} ${FILESDIR}/spotifyd.conf ${STAGEDIR}${PREFIX}/etc/spotifyd.conf.sample post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} diff --git a/audio/spotifyd/files/spotifyd.conf b/audio/spotifyd/files/spotifyd.conf new file mode 100644 index 000000000000..df18fa86e36c --- /dev/null +++ b/audio/spotifyd/files/spotifyd.conf @@ -0,0 +1,3 @@ +[global] +username = user +password = pass diff --git a/audio/spotifyd/files/spotifyd.in b/audio/spotifyd/files/spotifyd.in new file mode 100644 index 000000000000..1c96a9800999 --- /dev/null +++ b/audio/spotifyd/files/spotifyd.in @@ -0,0 +1,40 @@ +#!/bin/sh + +# PROVIDE: spotifyd +# REQUIRE: DAEMON NETWORKING +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf.local, /etc/rc.conf or +# /etc/rc.conf.d/spotifyd to enable this service: +# +# spotifyd_enable (bool): Set to NO by default. +# Set it to "YES" to enable spotifyd. +# spotifyd_config (str): Set to %%PREFIX%%/etc/spotifyd.conf by default. +# Path to configuration file. +# spotifyd_user (str): Set to "nobody" by default. +# User to run spotifyd + +. /etc/rc.subr + +name=spotifyd +rcvar=spotifyd_enable +start_precmd="${name}_precmd" + +load_rc_config $name + +: ${spotifyd_enable:="NO"} +: ${spotifyd_config:="%%PREFIX%%/etc/spotifyd.conf"} +: ${spotifyd_user:="nobody"} + +pidfile="/var/run/${name}/${name}.pid" +procname="%%PREFIX%%/bin/${name}" +command="/usr/sbin/daemon" +command_args="-S -m 3 -s info -l daemon -p ${pidfile} ${procname} --no-daemon -c ${spotifyd_config} ${spotifyd_args}" + +spotifyd_precmd() +{ + /usr/bin/install -d -m 0755 -o ${spotifyd_user} /var/run/${name} +} + +run_rc_command "$1" |
