[Slackbuilds-users] 0002-updated-for-bluez-alsa-added-rc-script.patch
khronosschoty
khronosschoty at posteo.org
Wed Feb 16 23:27:49 UTC 2022
Hi this is an update for bluez-alsa
-------------- next part --------------
>From 06be55b1a322c6ae02af3cecfb7abee7ec6e98e3 Mon Sep 17 00:00:00 2001
From: khronosschoty <khronosschoty at posteo.org>
Date: Wed, 16 Feb 2022 15:25:36 -0800
Subject: [PATCH 2/2] updated for bluez-alsa, added rc script
---
libraries/bluez-alsa/README | 11 +++++++---
libraries/bluez-alsa/bluez-alsa.SlackBuild | 5 +++--
libraries/bluez-alsa/rc.bluez-alsa | 24 ++++++++++++++++++++++
3 files changed, 35 insertions(+), 5 deletions(-)
create mode 100644 libraries/bluez-alsa/rc.bluez-alsa
diff --git a/libraries/bluez-alsa/README b/libraries/bluez-alsa/README
index c30d02528e..07c24be1b4 100644
--- a/libraries/bluez-alsa/README
+++ b/libraries/bluez-alsa/README
@@ -6,7 +6,12 @@ party audio applications. From now on, Bluez acts as a middleware between an
audio application, which implements Bluetooth audio profile, and a Bluetooth
audio device.
-Note: you might want to "start" "/usr/bin/bluealsa" via rc.local --
-for example, add the following line to rc.local:
+NOTE: A sample "rc" script is included, and installed in the usual location
+i.e. /etc/rc.d -- to use this rc script do the usual:
+chmod +x /etc/rc.d/rc.bluez-alsa
- /usr/bin/bluealsa &
+Then add the following to your rc.local:
+ # Start bluez-alsa
+ if [ -x /etc/rc.d/rc.bluez-alsa ]; then
+ /etc/rc.d/rc.bluez-alsa start
+ fi
diff --git a/libraries/bluez-alsa/bluez-alsa.SlackBuild b/libraries/bluez-alsa/bluez-alsa.SlackBuild
index b426140ce7..f60fd6416e 100644
--- a/libraries/bluez-alsa/bluez-alsa.SlackBuild
+++ b/libraries/bluez-alsa/bluez-alsa.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for bluez-alsa
-# Copyright 2018 Vasily Sora USA
+# Copyright 2018,2022 Vasily Sora USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -105,9 +105,10 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKG/etc/rc.d
cp -a README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-
+cat $CWD/rc.bluez-alsa > $PKG/etc/rc.d/rc.bluez-alsa
rm -f $PKG/usr/lib*/*.la
mkdir -p $PKG/install
diff --git a/libraries/bluez-alsa/rc.bluez-alsa b/libraries/bluez-alsa/rc.bluez-alsa
new file mode 100644
index 0000000000..94d83656a8
--- /dev/null
+++ b/libraries/bluez-alsa/rc.bluez-alsa
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# /etc/rc.d/rc.bluez-alsa
+#
+
+case "$1" in
+ 'start')
+ nohup /usr/bin/bluealsa > /dev/null 2>&1 &
+ echo $! > /var/run/bluealsa.pid
+ ;;
+ 'stop')
+ kill $(cat /var/run/bluealsa.pid)
+ rm -f /var/run/bluealsa.pid
+ ;;
+ 'restart')
+ kill $(cat /var/run/bluealsa.pid)
+ nohup /usr/bin/bluealsa > /dev/null 2>&1 &
+ echo $! > /var/run/bluealsa.pid
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ ;;
+esac
+
--
2.35.1
More information about the SlackBuilds-users
mailing list