diff options
Diffstat (limited to 'cdemu-daemon')
-rw-r--r-- | cdemu-daemon/PKGBUILD | 27 | ||||
-rw-r--r-- | cdemu-daemon/cdemud.conf | 8 | ||||
-rw-r--r-- | cdemu-daemon/cdemud.install | 12 | ||||
-rw-r--r-- | cdemu-daemon/cdemud.rc | 55 |
4 files changed, 102 insertions, 0 deletions
diff --git a/cdemu-daemon/PKGBUILD b/cdemu-daemon/PKGBUILD new file mode 100644 index 0000000..caa609d --- /dev/null +++ b/cdemu-daemon/PKGBUILD @@ -0,0 +1,27 @@ +# $Id: PKGBUILD,v 1.1 2008/11/24 18:40:08 partition Exp $ +# Maintainer: Mateusz Herych <heniekk@gmail.com> +# Contributor: Charles Lindsay <charles@chaoslizard.org> +pkgname=cdemu-daemon +pkgver=1.1.0 +pkgrel=3 +pkgdesc="CD/DVD-ROM device emulator daemon" +arch=(i686 x86_64) +url="http://cdemu.sourceforge.net/" +license=('GPL') +depends=('glib2' 'dbus' 'dbus-glib' 'libdaemon' 'vhba-module' 'libmirage' 'libao') +install=cdemud.install +source=(http://downloads.sourceforge.net/cdemu/$pkgname-$pkgver.tar.bz2 + cdemud.conf + cdemud.rc) +md5sums=('0118e5f590d7c0e1b02027b718880ac6' + '26b94a626c2c1d0a83ad5a7593dff70f' + 'c4a2f36337b5ce53cf0fac1128ad9545') + +build() { + cd $startdir/src/$pkgname-$pkgver + ./configure --prefix=/usr --sysconfdir=/etc + make -j1 || return 1 + make DESTDIR=$startdir/pkg install || return 1 + install -m 644 -D ../../cdemud.conf $startdir/pkg/etc/conf.d/cdemud || return 1 + install -m 755 -D ../../cdemud.rc $startdir/pkg/etc/rc.d/cdemud || return 1 +} diff --git a/cdemu-daemon/cdemud.conf b/cdemu-daemon/cdemud.conf new file mode 100644 index 0000000..91ada61 --- /dev/null +++ b/cdemu-daemon/cdemud.conf @@ -0,0 +1,8 @@ +# how many optical drives to emulate +NUM_DRIVES=1 + +# control device +CTL_DEVICE=/dev/vhba_ctl + +# audio backend (null or alsa) +AUDIO_BACKEND=null diff --git a/cdemu-daemon/cdemud.install b/cdemu-daemon/cdemud.install new file mode 100644 index 0000000..d1b0cf2 --- /dev/null +++ b/cdemu-daemon/cdemud.install @@ -0,0 +1,12 @@ +post_install () { + echo ">> Place 'cdemud' in DAEMONS= in /etc/rc.conf to enable cdemud on system boot." + echo ">> If the alsa-lib package is installed, cdemud can use the ALSA audio backend" + echo ">> (edit /etc/conf.d/cdemud to enable this)." + groupadd cdemu +} +post_remove() { + groupdel cdemu +} +op=$1 +shift +$op $* diff --git a/cdemu-daemon/cdemud.rc b/cdemu-daemon/cdemud.rc new file mode 100644 index 0000000..f76ba42 --- /dev/null +++ b/cdemu-daemon/cdemud.rc @@ -0,0 +1,55 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/cdemud + +case "$1" in + start) + stat_busy "Loading vhba module" + modprobe vhba + if [ $? -ne 0 ]; then + stat_fail + else + stat_done + fi + + stat_busy "Waiting for $CTL_DEVICE" + i=0 + until [ -c $CTL_DEVICE -o $i -ge 10 ]; do + i=`expr $i + 1` + sleep 1 + done + if [ -c $CTL_DEVICE ]; then + stat_done + else + stat_fail + fi + + stat_busy "Starting cdemud" + cdemud -d -n $NUM_DRIVES -c $CTL_DEVICE -a $AUDIO_BACKEND &>/dev/null + if [ $? -ne 0 ]; then + stat_fail + else + add_daemon cdemud + stat_done + fi + ;; + stop) + stat_busy "Stopping cdemud" + cdemud -k &>/dev/null + if [ $? -ne 0 ]; then + stat_fail + else + rm_daemon cdemud + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac |