Bug 239465 - audio/spotifyd: add rc script
Summary: audio/spotifyd: add rc script
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2019-07-26 19:21 UTC by Steve Wills
Modified: 2019-08-06 05:18 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (tobik)


Attachments
patch to add rc script (2.60 KB, patch)
2019-07-26 19:21 UTC, Steve Wills
no flags Details | Diff
updated patch (2.79 KB, patch)
2019-08-05 15:53 UTC, Steve Wills
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Wills freebsd_committer 2019-07-26 19:21:52 UTC
Created attachment 206086 [details]
patch to add rc script
Comment 1 Tobias Kortkamp freebsd_committer 2019-07-27 05:38:00 UTC
Comment on attachment 206086 [details]
patch to add rc script


 USE_GITHUB=	yes
+USE_RC_SUBR=	${PORTNAME}
+
 GH_ACCOUNT=	Spotifyd

USE_RC_SUBR is in the wrong place.  Put it after GH_TUPLE without
any new blank lines (pet portclippy).

+PLIST_FILES=	bin/spotifyd \
+		"@sample ${PREFIX}/etc/spotifyd.conf.sample"

Remove ${PREFIX}/

+# spotifyd_config (str):        Set to $PREFIX/etc/etc/spotifyd.conf by default.

s,/etc/etc,/etc,

+spotifyd_args="-c ${spotifyd_config}"

spotifyd_args is only used in one place.  Please put it directly
in command_args.

+command_args="-S -m 3 -s "info" -l "daemon" -p ${pidfile} ${procname} --no-daemon ${spotifyd_args}"

Remove the unescaped " after -s and -l.

+        /usr/bin/install -d -m 0755 -o ${spotifyd_user} /var/run/${name}

Use a tab for indentation.

Given that I no longer have a Spotify Premium account I cannot test
this for real, but just attempting to start the script fails because
spotifyd_user is not defined to any value and it tries to run

	/usr/bin/install -d -m 0755 -o /var/run/spotifyd

which is of course not right.  spotifyd_user needs a sensible
default.  Maybe "nobody"?
Comment 2 Tobias Kortkamp freebsd_committer 2019-08-05 12:35:25 UTC
This has not been fixed...  If you do not feel like iterating on the original
patch then let's close this with an appropriate status.
Comment 3 Steve Wills freebsd_committer 2019-08-05 15:53:26 UTC
Created attachment 206294 [details]
updated patch

Here's an updated patch, let me know if I missed something. I was using this with the pulseaudio backend and had:

spotifyd_enable="YES"
spotifyd_user="swills"
spotifyd_env="HOME=/usr/home/swills XDG_RUNTIME_DIR=/var/run/user/1001"

in rc.conf when I tested, so didn't notice the user issue. I've tested with the default backend as "nobody" and it works. Would be nice to have the pulseaudio backend enabled by default.
Comment 4 Steve Wills freebsd_committer 2019-08-05 15:53:48 UTC
Re-opening
Comment 5 Tobias Kortkamp freebsd_committer 2019-08-06 05:18:42 UTC
Committed. Thanks.
Comment 6 commit-hook freebsd_committer 2019-08-06 05:18:42 UTC
A commit references this bug:

Author: tobik
Date: Tue Aug  6 05:18:38 UTC 2019
New revision: 508227
URL: https://svnweb.freebsd.org/changeset/ports/508227

Log:
  audio/spotifyd: Add an rc script

  PR:		239465
  Submitted by:	swills

Changes:
  head/audio/spotifyd/Makefile
  head/audio/spotifyd/files/
  head/audio/spotifyd/files/spotifyd.conf
  head/audio/spotifyd/files/spotifyd.in