aboutsummaryrefslogtreecommitdiff
path: root/system/cdemu-daemon
diff options
context:
space:
mode:
authorIsaac Yu <isaacyu1@isaacyu1.com>2022-01-30 16:18:02 -0800
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-01-31 10:15:39 +0700
commite711c6f3de02b1c23323e7a63107591a88b908ae (patch)
treeea37d3d44f61461d3eb4c4a2759b88478c9e50c7 /system/cdemu-daemon
parent216079a09e6c1c2fdfd7b9fa783c39d57ede4cad (diff)
Update CDEmu software series
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/cdemu-daemon')
-rw-r--r--system/cdemu-daemon/cdemu-daemon.SlackBuild38
-rw-r--r--system/cdemu-daemon/cdemu-daemon.info6
-rw-r--r--system/cdemu-daemon/config/cdemu-daemon-dbus.conf19
-rwxr-xr-xsystem/cdemu-daemon/config/cdemu-daemon-session.sh19
4 files changed, 63 insertions, 19 deletions
diff --git a/system/cdemu-daemon/cdemu-daemon.SlackBuild b/system/cdemu-daemon/cdemu-daemon.SlackBuild
index 136050e5310a..514b798a135f 100644
--- a/system/cdemu-daemon/cdemu-daemon.SlackBuild
+++ b/system/cdemu-daemon/cdemu-daemon.SlackBuild
@@ -4,7 +4,7 @@
# Copyright 2008 Niklas "Nille" Åkerström
# Copyright 2010-2013 Niels Horn, Rio de Janeiro, RJ, Brazil <niels.horn@gmail.com>
-# Copyright 2018-2020 Isaac Yu <isaacyu1@isaacyu1.com>
+# Copyright 2018-2022 Isaac Yu <isaacyu1@isaacyu1.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -27,7 +27,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=cdemu-daemon
-VERSION=${VERSION:-3.2.4}
+VERSION=${VERSION:-3.2.6}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -74,7 +74,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
@@ -96,23 +96,29 @@ cd build
make install DESTDIR=$PKG
cd ..
-# Fix standard configuration to make it more "Slackware"-like
-sed \
- -e "/^LOG_FILE/s|/tmp/|/var/log/|" \
- -e "/^CONFIG_FILE/s|/etc/sysconfig/|/etc/|" \
- -i $PKG/usr/libexec/$PRGNAM-system.sh
-
-# Fix a silly error in the dbus file
-sed \
- -e "/^Name=/s/CdemuDaemon/CDEmuDaemon/" \
- -i $PKG/usr/share/dbus-1/system-services/net.sf.cdemu.CDEmuDaemon.service
-
# Install init script
mkdir -p $PKG/etc/rc.d
install -m 0755 $CWD/rc.cdemud $PKG/etc/rc.d/rc.cdemud.new
-# dbus and udev rules
-mv $PKG/etc/dbus-1/system.d/cdemu-daemon-dbus.conf \
+# Install systemd sample services
+mkdir -p $PKG/usr/lib/systemd/user
+cp $TMP/$PRGNAM-$VERSION/service-example/cdemu-daemon.service \
+ $PKG/usr/lib/systemd/user/cdemu-daemon.service
+mkdir -p $PKG/usr/share/dbus-1/services
+cp $TMP/$PRGNAM-$VERSION/service-example/net.sf.cdemu.CDEmuDaemon.service \
+ $PKG/usr/share/dbus-1/services/net.sf.cdemu.CDEmuDaemon.service
+
+# Adapt systemd service for Slackware
+sed \
+ -e "/^SystemdService/d" \
+ -e "/^Exec=/s|/bin/true|/usr/libexec/cdemu-daemon-session.sh|" \
+ -i $PKG/usr/share/dbus-1/services/net.sf.cdemu.CDEmuDaemon.service
+mkdir -p $PKG/usr/libexec
+cp $CWD/config/cdemu-daemon-session.sh $PKG/usr/libexec/cdemu-daemon-session.sh
+
+# Install dbus and udev rules
+mkdir -p $PKG/etc/dbus-1/system.d
+cp $CWD/config/cdemu-daemon-dbus.conf \
$PKG/etc/dbus-1/system.d/cdemu-daemon-dbus.conf.new
sed -i 's/group="root"/group="'$GROUP'"/' \
$PKG/etc/dbus-1/system.d/cdemu-daemon-dbus.conf.new
diff --git a/system/cdemu-daemon/cdemu-daemon.info b/system/cdemu-daemon/cdemu-daemon.info
index 3a27c0b19b5f..25b7e9156a52 100644
--- a/system/cdemu-daemon/cdemu-daemon.info
+++ b/system/cdemu-daemon/cdemu-daemon.info
@@ -1,8 +1,8 @@
PRGNAM="cdemu-daemon"
-VERSION="3.2.4"
+VERSION="3.2.6"
HOMEPAGE="https://cdemu.sourceforge.io/about/daemon/"
-DOWNLOAD="https://downloads.sourceforge.net/cdemu/cdemu-daemon-3.2.4.tar.bz2"
-MD5SUM="9021f56fd95686f5b14d3b32f68e7b1a"
+DOWNLOAD="https://downloads.sourceforge.net/cdemu/cdemu-daemon-3.2.6.tar.xz"
+MD5SUM="21c8d2b4e8952999628ed755304b1b0f"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="libmirage vhba-module"
diff --git a/system/cdemu-daemon/config/cdemu-daemon-dbus.conf b/system/cdemu-daemon/config/cdemu-daemon-dbus.conf
new file mode 100644
index 000000000000..c450d78cf03b
--- /dev/null
+++ b/system/cdemu-daemon/config/cdemu-daemon-dbus.conf
@@ -0,0 +1,19 @@
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+
+<busconfig>
+ <!-- Only root can own the CDEmuDaemon service on bus -->
+ <policy user="root">
+ <allow own="net.sf.cdemu.CDEmuDaemon"/>
+ </policy>
+ <policy group="root">
+ <allow own="net.sf.cdemu.CDEmuDaemon"/>
+ </policy>
+
+ <!-- Allow anyone to invoke methods on the interface -->
+ <policy context="default">
+ <allow send_destination="net.sf.cdemu.CDEmuDaemon"/>
+ </policy>
+</busconfig>
+
diff --git a/system/cdemu-daemon/config/cdemu-daemon-session.sh b/system/cdemu-daemon/config/cdemu-daemon-session.sh
new file mode 100755
index 000000000000..c533612a733e
--- /dev/null
+++ b/system/cdemu-daemon/config/cdemu-daemon-session.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Starts the CDEmu daemon instance on D-Bus *session* bus. Optional
+# configuration (number of devices, audio driver, log file) are read
+# from ~/.cdemu-daemon
+
+# Default settings
+NUM_DEVICES=1
+AUDIO_DRIVER=default
+LOG_FILE=~/.cdemu-daemon.log
+
+# Read the settings
+CONFIG_FILE=~/.cdemu-daemon
+
+if [ -f ${CONFIG_FILE} ]; then
+ . ${CONFIG_FILE};
+fi
+
+# Start the daemon
+exec cdemu-daemon --ctl-device=/dev/vhba_ctl --bus=session --num-devices=${NUM_DEVICES} --audio-driver=${AUDIO_DRIVER} --logfile=${LOG_FILE}