From c8729cab8302ab82e01135a22fb9fa9704f1559b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 27 Mar 2012 00:01:20 +0000 Subject: Tue Mar 27 00:01:20 UTC 2012 --- community-testing/cdemu-daemon/PKGBUILD | 32 +++++++-------- .../cdemu-daemon/cdemu-daemon.install | 20 ++++++++++ community-testing/cdemu-daemon/cdemud.conf | 11 +++--- community-testing/cdemu-daemon/cdemud.rc | 8 ++-- community-testing/cdemu-daemon/system.patch | 45 ++++++++++++++++++++++ 5 files changed, 88 insertions(+), 28 deletions(-) create mode 100644 community-testing/cdemu-daemon/cdemu-daemon.install create mode 100644 community-testing/cdemu-daemon/system.patch (limited to 'community-testing/cdemu-daemon') diff --git a/community-testing/cdemu-daemon/PKGBUILD b/community-testing/cdemu-daemon/PKGBUILD index b757373de..87eb6bd8e 100644 --- a/community-testing/cdemu-daemon/PKGBUILD +++ b/community-testing/cdemu-daemon/PKGBUILD @@ -1,36 +1,35 @@ -# $Id: PKGBUILD 68321 2012-03-21 15:58:26Z schiv $ +# $Id: PKGBUILD 68476 2012-03-25 14:38:03Z schiv $ # Maintainer: Ray Rashif # Contributor: Mateusz Herych # Contributor: Charles Lindsay pkgname=cdemu-daemon pkgver=1.5.0 -pkgrel=3 +pkgrel=4 pkgdesc="CD/DVD-ROM device emulator daemon" arch=('i686' 'x86_64') url="http://cdemu.sourceforge.net/" license=('GPL') -depends=('dbus-glib' 'libdaemon' 'vhba-module' - 'dbus' "libmirage=$pkgver" 'libao') -optdepends=('alsa-lib: to enable the audio driver') +depends=('dbus' 'vhba-module>=20110915-5' 'libao' "libmirage=$pkgver") +optdepends=('alsa-lib: to enable the ALSA audio driver' + 'pulseaudio: to enable the PA audio driver') backup=('etc/conf.d/cdemud' 'etc/dbus-1/system.d/cdemud-dbus.conf') -install=cdemud.install +install=$pkgname.install source=("http://downloads.sourceforge.net/cdemu/$pkgname-$pkgver.tar.bz2" 'cdemud.conf' 'cdemud.rc' - '60-vhba.rules' - 'cdemu-daemon-system.patch') + 'system.patch') md5sums=('5ba780caa26d855942512b5b3c22405a' - 'd65c30651389900c46e62a9e5559b9d5' - 'ef47f06a3d4e07885bfbb57d4d6d0be4' - '549bd2d9696bd1884c8eed7193c00e21' - 'a3ae9c51c460d31a521dd00dd3f0a852') + '5d9e08255e45ca3c0987329b7920e206' + '4bbf42b69133e4e91c1be2c6825fa392' + '90a2516639c05737fa10a110a1cba467') build() { cd "$srcdir/$pkgname-$pkgver" - patch -Np0 -i $srcdir/cdemu-daemon-system.patch + # make things Arch-friendly + patch -Np1 -i "$srcdir/system.patch" ./configure --prefix=/usr \ --sysconfdir=/etc \ @@ -43,14 +42,11 @@ package() { make DESTDIR="$pkgdir" install + # the init stuff install -Dm644 "$srcdir/cdemud.conf" "$pkgdir/etc/conf.d/cdemud" install -Dm755 "$srcdir/cdemud.rc" "$pkgdir/etc/rc.d/cdemud" - # install udev rule for non-root mounting of iso's - install -Dm644 "$srcdir/60-vhba.rules" \ - "$pkgdir/lib/udev/rules.d/60-vhba.rules" - - # should we really be doing this? + # should we really be doing this? (for systemd) #install -d "$pkgdir/usr/lib/modules-load.d" #echo "vhba" > "$pkgdir/usr/lib/modules-load.d/cdemu.conf" } diff --git a/community-testing/cdemu-daemon/cdemu-daemon.install b/community-testing/cdemu-daemon/cdemu-daemon.install new file mode 100644 index 000000000..7a3e8a9f5 --- /dev/null +++ b/community-testing/cdemu-daemon/cdemu-daemon.install @@ -0,0 +1,20 @@ +post_upgrade() { + echo " > The 'cdemu' group is now created by vhba-module" + echo " >> you may have to re-add yourself to the group and relogin" + echo + echo " > Daemon can be used in session mode as user, simply run 'cdemud'" + echo " >> you do not need to use the init script in this case" + echo " >> put your configuration in ~/.cdemud instead" +} + +post_install () { + echo " > Add yourself to the 'cdemu' group for non-root access" + echo " > Start the daemon as root with /etc/rc.d/cdemud" + echo " > See /etc/conf.d/cdemud for further configuration" + echo + echo " > Daemon can be used in session mode as user, simply run 'cdemud'" + echo " >> you do not need to use the init script in this case" + echo " >> put your configuration in ~/.cdemud instead" +} + +# vim:set ts=2 sw=2 et: diff --git a/community-testing/cdemu-daemon/cdemud.conf b/community-testing/cdemu-daemon/cdemud.conf index 4e0e314f4..6f14947a6 100644 --- a/community-testing/cdemu-daemon/cdemud.conf +++ b/community-testing/cdemu-daemon/cdemud.conf @@ -1,12 +1,11 @@ # how many optical drives to emulate NUM_DEVICES=2 -# control device -CTL_DEVICE=/dev/vhba_ctl - -# audio backend (null or alsa) +# audio backend (null, alsa or pulse) AUDIO_DRIVER=null -DAEMON="/usr/bin/cdemud" +# log file +LOG_FILE=/var/log/cdemud.log + +# bus to use (system or session) BUS="system" -LOG_FILE="/var/log/cdemu.log" diff --git a/community-testing/cdemu-daemon/cdemud.rc b/community-testing/cdemu-daemon/cdemud.rc index 21cae0a26..e8dab1f08 100644 --- a/community-testing/cdemu-daemon/cdemud.rc +++ b/community-testing/cdemu-daemon/cdemud.rc @@ -14,20 +14,20 @@ case "$1" in stat_done fi - stat_busy "Waiting for $CTL_DEVICE" + stat_busy "Waiting for /dev/vhba_ctl" i=0 - until [ -c $CTL_DEVICE -o $i -ge 10 ]; do + until [ -c /dev/vhba_ctl -o $i -ge 10 ]; do i=`expr $i + 1` sleep 1 done - if [ -c $CTL_DEVICE ]; then + if [ -c /dev/vhba_ctl ]; then stat_done else stat_fail fi stat_busy "Starting cdemud" - cdemud --ctl-device=$CTL_DEVICE --bus=$BUS --num-devices=$NUM_DEVICES --audio-driver=$AUDIO_DRIVER --logfile=$LOG_FILE & + cdemud --ctl-device=/dev/vhba_ctl --bus=$BUS --num-devices=$NUM_DEVICES --audio-driver=$AUDIO_DRIVER --logfile=$LOG_FILE & if [ $? -ne 0 ]; then stat_fail else diff --git a/community-testing/cdemu-daemon/system.patch b/community-testing/cdemu-daemon/system.patch new file mode 100644 index 000000000..3c3d4b221 --- /dev/null +++ b/community-testing/cdemu-daemon/system.patch @@ -0,0 +1,45 @@ +diff -aur cdemu-daemon-1.5.0.orig/session/cdemu-daemon-session.sh cdemu-daemon-1.5.0/session/cdemu-daemon-session.sh +--- cdemu-daemon-1.5.0.orig/session/cdemu-daemon-session.sh 2012-03-25 16:35:40.577837996 +0800 ++++ cdemu-daemon-1.5.0/session/cdemu-daemon-session.sh 2012-03-25 16:39:12.180024983 +0800 +@@ -1,15 +1,15 @@ + #!/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 ++# from ~/.cdemud + + # Default settings + NUM_DEVICES=2 +-AUDIO_DRIVER=pulse +-LOG_FILE=~/.cdemu-daemon.log ++AUDIO_DRIVER=null ++LOG_FILE=~/.cdemud.log + + # Read the settings +-CONFIG_FILE=~/.cdemu-daemon ++CONFIG_FILE=~/.cdemud + + if [ -f ${CONFIG_FILE} ]; then + . ${CONFIG_FILE}; +diff -aur cdemu-daemon-1.5.0.orig/system/cdemu-daemon-system.sh cdemu-daemon-1.5.0/system/cdemu-daemon-system.sh +--- cdemu-daemon-1.5.0.orig/system/cdemu-daemon-system.sh 2012-03-25 16:35:40.581171312 +0800 ++++ cdemu-daemon-1.5.0/system/cdemu-daemon-system.sh 2012-03-25 16:36:48.810801678 +0800 +@@ -1,15 +1,15 @@ + #!/bin/sh + # Starts the CDEmu daemon instance on D-Bus *system* bus. Optional + # configuration (number of devices, audio driver, log file) are read +-# from /etc/sysconfig/cdemu-daemon ++# from /etc/conf.d/cdemud + + # Default settings + NUM_DEVICES=2 + AUDIO_DRIVER=null +-LOG_FILE=/tmp/cdemu-daemon.log ++LOG_FILE=/var/log/cdemud.log + + # Read the settings +-CONFIG_FILE=/etc/sysconfig/cdemu-daemon ++CONFIG_FILE=/etc/conf.d/cdemud + + if [ -f ${CONFIG_FILE} ]; then + . ${CONFIG_FILE}; -- cgit v1.2.3-54-g00ecf