From owner-svn-ports-all@freebsd.org Tue Aug 6 05:18:38 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 923CBB70A3; Tue, 6 Aug 2019 05:18:38 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462jbL3KfHz4d8p; Tue, 6 Aug 2019 05:18:38 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 502812717D; Tue, 6 Aug 2019 05:18:38 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x765IcD7014032; Tue, 6 Aug 2019 05:18:38 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x765IbtC014029; Tue, 6 Aug 2019 05:18:37 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201908060518.x765IbtC014029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Tue, 6 Aug 2019 05:18:37 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r508227 - in head/audio/spotifyd: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: in head/audio/spotifyd: . files X-SVN-Commit-Revision: 508227 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Aug 2019 05:18:38 -0000 Author: tobik Date: Tue Aug 6 05:18:37 2019 New Revision: 508227 URL: https://svnweb.freebsd.org/changeset/ports/508227 Log: audio/spotifyd: Add an rc script PR: 239465 Submitted by: swills Added: head/audio/spotifyd/files/ head/audio/spotifyd/files/spotifyd.conf (contents, props changed) head/audio/spotifyd/files/spotifyd.in (contents, props changed) Modified: head/audio/spotifyd/Makefile Modified: head/audio/spotifyd/Makefile ============================================================================== --- head/audio/spotifyd/Makefile Tue Aug 6 04:17:47 2019 (r508226) +++ head/audio/spotifyd/Makefile Tue Aug 6 05:18:37 2019 (r508227) @@ -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:1d3e5a5591bc72eb061c23bd4 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} Added: head/audio/spotifyd/files/spotifyd.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/audio/spotifyd/files/spotifyd.conf Tue Aug 6 05:18:37 2019 (r508227) @@ -0,0 +1,3 @@ +[global] +username = user +password = pass Added: head/audio/spotifyd/files/spotifyd.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/audio/spotifyd/files/spotifyd.in Tue Aug 6 05:18:37 2019 (r508227) @@ -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"