pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/audio/snapcast snapcast: /var/run is cleared on boot s...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/16b441942907
branches:  trunk
changeset: 381397:16b441942907
user:      nia <nia%pkgsrc.org@localhost>
date:      Wed Jul 06 10:02:13 2022 +0000

description:
snapcast: /var/run is cleared on boot so needs to be created by the rc
script

diffstat:

 audio/snapcast/Makefile            |  11 ++++-------
 audio/snapcast/files/snapclient.sh |  15 ++++++++++++---
 audio/snapcast/files/snapserver.sh |  11 ++++++++++-
 3 files changed, 26 insertions(+), 11 deletions(-)

diffs (92 lines):

diff -r 40f4c532de48 -r 16b441942907 audio/snapcast/Makefile
--- a/audio/snapcast/Makefile   Wed Jul 06 09:18:24 2022 +0000
+++ b/audio/snapcast/Makefile   Wed Jul 06 10:02:13 2022 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.3 2022/07/03 17:32:04 nia Exp $
+# $NetBSD: Makefile,v 1.4 2022/07/06 10:02:13 nia Exp $
 
 DISTNAME=      snapcast-0.26.0
+PKGREVISION=   1
 CATEGORIES=    audio
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=badaix/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}
@@ -48,6 +49,8 @@
 
 FILES_SUBST+=          SNAPCLIENT_USER=${SNAPCLIENT_USER}
 FILES_SUBST+=          SNAPCLIENT_GROUP=${SNAPCLIENT_GROUP}
+FILES_SUBST+=          SNAPSERVER_USER=${SNAPSERVER_USER}
+FILES_SUBST+=          SNAPSERVER_GROUP=${SNAPSERVER_GROUP}
 FILES_SUBST+=          VARBASE=${VARBASE}
 
 PKG_GROUPS+=           ${SNAPCLIENT_GROUP}
@@ -56,12 +59,6 @@
 PKG_USERS+=            ${SNAPCLIENT_USER}:${SNAPCLIENT_GROUP}
 PKG_USERS+=            ${SNAPSERVER_USER}:${SNAPSERVER_GROUP}
 
-OWN_DIRS_PERMS+=       ${VARBASE}/run/snapclient \
-                       ${SNAPCLIENT_USER} ${SNAPCLIENT_GROUP} 0755
-
-OWN_DIRS_PERMS+=       ${VARBASE}/run/snapserver \
-                       ${SNAPCLIENT_USER} ${SNAPCLIENT_GROUP} 0755
-
 OWN_DIRS_PERMS+=       ${VARBASE}/lib/snapclient \
                        ${SNAPSERVER_USER} ${SNAPSERVER_GROUP} 0755
 
diff -r 40f4c532de48 -r 16b441942907 audio/snapcast/files/snapclient.sh
--- a/audio/snapcast/files/snapclient.sh        Wed Jul 06 09:18:24 2022 +0000
+++ b/audio/snapcast/files/snapclient.sh        Wed Jul 06 10:02:13 2022 +0000
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: snapclient.sh,v 1.1 2022/07/03 16:09:15 nia Exp $
+# $NetBSD: snapclient.sh,v 1.2 2022/07/06 10:02:14 nia Exp $
 #
 # PROVIDE: snapclient
 # KEYWORD: shutdown
@@ -16,8 +16,17 @@
 command="@PREFIX@/bin/snapclient"
 command_args="-d"
 pidfile="@VARBASE@/run/snapclient/pid"
-snapclient_user=@SNAPCLIENT_USER@
-snapclient_group=@SNAPCLIENT_GROUP@
+snapclient_user="@SNAPCLIENT_USER@"
+snapclient_group="@SNAPCLIENT_GROUP@"
+start_precmd="snapclient_precmd"
+
+snapclient_precmd()
+{
+       if [ ! -d "@VARBASE@/run/snapclient" ]; then
+               mkdir -p -m 755 "@VARBASE@/run/snapclient"
+               chown @SNAPCLIENT_USER@:@SNAPCLIENT_GROUP@ "@VARBASE@/run/snapclient"
+       fi
+}
 
 load_rc_config $name
 run_rc_command "$1"
diff -r 40f4c532de48 -r 16b441942907 audio/snapcast/files/snapserver.sh
--- a/audio/snapcast/files/snapserver.sh        Wed Jul 06 09:18:24 2022 +0000
+++ b/audio/snapcast/files/snapserver.sh        Wed Jul 06 10:02:13 2022 +0000
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: snapserver.sh,v 1.1 2022/07/03 16:09:15 nia Exp $
+# $NetBSD: snapserver.sh,v 1.2 2022/07/06 10:02:14 nia Exp $
 #
 # PROVIDE: snapserver
 # KEYWORD: shutdown
@@ -16,6 +16,15 @@
 command="@PREFIX@/bin/snapserver"
 command_args="-d"
 pidfile="@VARBASE@/run/snapserver/pid"
+start_precmd="snapserver_precmd"
+
+snapserver_precmd()
+{
+       if [ ! -d "@VARBASE@/run/snapserver" ]; then
+               mkdir -p -m 755 "@VARBASE@/run/snapserver"
+               chown @SNAPSERVER_USER@:@SNAPSERVER_GROUP@ "@VARBASE@/run/snapserver"
+       fi
+}
 
 load_rc_config $name
 run_rc_command "$1"



Home | Main Index | Thread Index | Old Index