[crux-commits] ports/contrib (refs/remotes/origin/3.6): bluealsa: tweak; change /run dir

crux at crux.nu crux at crux.nu
Sat Apr 10 19:05:53 UTC 2021


commit 7fefc4ff3ddd1ab290589a1b0a9c8f7fa019746d
Author: Steffen Nurpmeso <steffen at sdaoden.eu>
Date:   Mon Feb 8 23:30:38 2021 +0100

    bluealsa: tweak; change /run dir

diff --git a/bluealsa/.signature b/bluealsa/.signature
index a2d28f1bd..29b4d84df 100644
--- a/bluealsa/.signature
+++ b/bluealsa/.signature
@@ -1,7 +1,7 @@
 untrusted comment: verify with /etc/ports/contrib.pub
-RWSagIOpLGJF3+wKo7LPbKqB0Ko9pcrBu1lgGDnG0dKn8Aq1qgkSiTAlWujJj88BXcgvgCCBjqxLW6Y5BxeR7hlEUwQszp/YnAE=
-SHA256 (Pkgfile) = 735999d6c5c8b496a10cc772cc2b1a9aba4473d057596e6e441d40d8857f456e
+RWSagIOpLGJF36MBXVh7iFE7IsH6tIlMkV9POdMaR2pFpiC9WxQTmOdSEKtQ89kZyIlUbhi4kAF3xDGPNWN7U1fEiT3+VCdhYA4=
+SHA256 (Pkgfile) = 7b0e9db380bd901887b058ccba45a4894ab352dfba44c15d08d8d8cbdb35db12
 SHA256 (.footprint) = a1ec2cab3b6db9ed7c973fec4a346d4cc1f1a489618664a156bfa4f19d1d49bd
 SHA256 (bluez-alsa-3.0.0.tar.gz) = 8b9bc36be922c10c6628ddf84b13dfadfeb3ab0bcf72bad842c66f3120abc6b2
-SHA256 (bluealsa) = 87bdea39125a877c4613f48f97ad8aafffb669ba72bc76e49cfa5a6763680c4e
+SHA256 (bluealsa) = 2250cf2e34ac81f43e5ebd1741e421a69bceb2932b736a0d25c0e97f13fe33ae
 SHA256 (bluealsa.conf) = 85751bb2dbda79b22ce4572e2165dcb0843e292676a781db2c2a5bcc60f840b0
diff --git a/bluealsa/Pkgfile b/bluealsa/Pkgfile
index de5685905..c75a49f72 100644
--- a/bluealsa/Pkgfile
+++ b/bluealsa/Pkgfile
@@ -8,20 +8,24 @@
 name=bluealsa
 rname=bluez-alsa
 version=3.0.0
-release=1
+release=2
 source=(
-https://github.com/Arkq/${rname}/archive/v${version}/${rname}-${version}.tar.gz
+   https://github.com/Arkq/${rname}/archive/\
+v${version}/${rname}-${version}.tar.gz
    bluealsa bluealsa.conf)
 
 build() {
-   cd $rname-$version
+   cd ${rname}-${version}
+
    autoreconf --install --symlink
    mkdir build && cd build
-   ../configure --prefix=/usr --enable-aac
+   ../configure --prefix=/usr --runstatedir=/run --enable-aac
    make all
-   make DESTDIR=$PKG install
-   install -D -m 0755 $SRC/bluealsa $PKG/etc/rc.d/bluealsa
-   install -D -m 0644 $SRC/bluealsa.conf $PKG/etc/dbus-1/system.d/bluealsa.conf
+   make DESTDIR="${PKG}" install
+
+   install -D -m 0755 "${SRC}"/bluealsa "${PKG}"/etc/rc.d/${name}
+   install -D -m 0644 "${SRC}"/bluealsa.conf \
+      "${PKG}"/etc/dbus-1/system.d/${name}.conf
 }
 
 # s-sh-mode
diff --git a/bluealsa/bluealsa b/bluealsa/bluealsa
index 8c359ae9f..e47c92319 100755
--- a/bluealsa/bluealsa
+++ b/bluealsa/bluealsa
@@ -2,46 +2,37 @@
 #@ bluez-alsa startup script.
 #@ Likely requires <- bluetoothd <- dbus 
 
-#@ With bluealsa <2.0.0, the daemon crashed at times
-#@	Nov  5 23:22:25 kent kernel: baio[19242]: segfault at 1 ip \
-#@		00007f06dc0bca31 sp 00007f06da5dce28 error 4 \
-#@		in libc-2.28.so[7f06dbf83000+147000]
-#@ and if we would not remove $RUNDIR, restart would be rejected:
-#@	Nov  5 23:25:07 kent /usr/bin/bluealsa: Couldn't initialize \
-#@		controller thread: Bad file descriptor
-
 SSD=/sbin/start-stop-daemon
 PROG=/usr/bin/bluealsa
-PID=/var/run/bluealsa.pid
-RUNDIR=/var/run/bluealsa
+PID=/run/bluealsa.pid
+RUNDIR=/run/bluealsa
 OPTS=-S
 
 case $1 in
 start)
-	rm -rf "${RUNDIR}"
-	$SSD --start --background --make-pidfile --pidfile $PID --exec $PROG \
-		-- $OPTS
+	exec "${SSD}" --start --background --make-pidfile --pidfile "${PID}" \
+		--exec "${PROG}" -- ${OPTS}
 	;;
 stop)
-	$SSD --stop --remove-pidfile --retry 10 --pidfile $PID --exec $PROG
-	rm -rf "${RUNDIR}"
+	exec "${SSD}" --stop --remove-pidfile --retry 10 --pidfile "${PID}" \
+		--exec "${PROG}"
 	;;
 restart)
-	$0 stop
-	$0 start
+	"${0}" stop
+	exec "${0}" start
 	;;
 status)
-	$SSD --status --pidfile $PID --exec $PROG
-	e=$?
-	case $e in
-	0) echo "$PROG is running with pid $(cat $PID)" ;;
-	1) echo "$PROG is not running but the pid file $PID exists" ;;
-	3) echo "$PROG is not running" ;;
-	4) echo "Unable to determine the program status" ;;
+	"${SSD}" --status --pidfile "${PID}" --exec "${PROG}"
+	e=${?}
+	case ${e} in
+	0) echo "${PROG} is running with pid $(cat ${PID})";;
+	1) echo "${PROG} is not running but the pid file ${PID} exists";;
+	3) echo "${PROG} is not running";;
+	4) echo "Unable to determine the program status";;
 	esac
-	exit $e
+	exit ${e}
 	;;
 *)
-	echo "usage: $0 [start|stop|restart|status]"
+	echo "usage: $0 start|stop|restart|status"
 	;;
 esac


More information about the crux-commits mailing list