summaryrefslogtreecommitdiff
path: root/community-testing
diff options
context:
space:
mode:
Diffstat (limited to 'community-testing')
-rw-r--r--community-testing/cdemu-daemon/PKGBUILD63
-rw-r--r--community-testing/cdemu-daemon/cdemu-daemon.install27
-rw-r--r--community-testing/cdemu-daemon/cdemu-daemon.service10
-rw-r--r--community-testing/cdemu-daemon/cdemud-dbus.conf24
-rw-r--r--community-testing/cdemu-daemon/cdemud.conf8
-rw-r--r--community-testing/cdemu-daemon/cdemud.rc34
-rw-r--r--community-testing/cdemu-daemon/system.patch45
-rw-r--r--community-testing/vhba-module/60-vhba.rules14
-rw-r--r--community-testing/vhba-module/PKGBUILD6
-rw-r--r--community-testing/vhba-module/vhba-module.install2
10 files changed, 228 insertions, 5 deletions
diff --git a/community-testing/cdemu-daemon/PKGBUILD b/community-testing/cdemu-daemon/PKGBUILD
new file mode 100644
index 000000000..78af6152f
--- /dev/null
+++ b/community-testing/cdemu-daemon/PKGBUILD
@@ -0,0 +1,63 @@
+# $Id: PKGBUILD 72681 2012-06-19 12:54:14Z heftig $
+# Maintainer: Ray Rashif <schiv@archlinux.org>
+# Contributor: Mateusz Herych <heniekk@gmail.com>
+# Contributor: Charles Lindsay <charles@chaoslizard.org>
+
+pkgname=cdemu-daemon
+pkgver=1.5.0
+pkgrel=6
+pkgdesc="CD/DVD-ROM device emulator daemon"
+arch=('i686' 'x86_64')
+url="http://cdemu.sourceforge.net/"
+license=('GPL')
+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=$pkgname.install
+source=("http://downloads.sourceforge.net/cdemu/$pkgname-$pkgver.tar.bz2"
+ 'cdemud.conf' 'cdemud.rc' 'system.patch' 'cdemu-daemon.service'
+ 'cdemud-dbus.conf')
+md5sums=('5ba780caa26d855942512b5b3c22405a'
+ '6f31ad7a64d320cf4d6820432184070b'
+ 'cbc0937ef4ac50db3ce5cdbbe2e17a3b'
+ '90a2516639c05737fa10a110a1cba467'
+ 'be9a8f50da3f42129c0a0e3dea8cd56c'
+ 'afbf24bcdec382f58d95ba5de29bff71')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ # make things Arch-friendly
+ patch -Np1 -i "$srcdir/system.patch"
+
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --libexecdir=/usr/lib/$pkgname
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ make DESTDIR="$pkgdir" install
+
+ # Custom dbus policy, tightening security to console and 'cdemu' group
+ install -m644 "$srcdir/cdemud-dbus.conf" \
+ "$pkgdir/etc/dbus-1/system.d/cdemud-dbus.conf"
+
+ # the init stuff
+ install -Dm644 "$srcdir/cdemud.conf" "$pkgdir/etc/conf.d/cdemud"
+ install -Dm755 "$srcdir/cdemud.rc" "$pkgdir/etc/rc.d/cdemud"
+ install -d "$pkgdir/usr/lib/modules-load.d"
+ echo "vhba" > "$pkgdir/usr/lib/modules-load.d/cdemu.conf"
+
+ # for systemd
+ install -Dm644 "$srcdir/cdemu-daemon.service" \
+ "$pkgdir/usr/lib/systemd/system/cdemu-daemon.service"
+ echo "SystemdService=cdemu-daemon.service" >> \
+ "$pkgdir/usr/share/dbus-1/system-services/net.sf.cdemu.CDEMUD_Daemon.service"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/community-testing/cdemu-daemon/cdemu-daemon.install b/community-testing/cdemu-daemon/cdemu-daemon.install
new file mode 100644
index 000000000..ba34d1ea0
--- /dev/null
+++ b/community-testing/cdemu-daemon/cdemu-daemon.install
@@ -0,0 +1,27 @@
+post_install () {
+ cat <<MSG
+ > The daemon is automatically started, but can be manually
+ started via /etc/rc.d/cdemud or cdemu-daemon.service.
+ > See /etc/conf.d/cdemud for further configuration.
+
+ > Only users at the console or in the 'cdemu' group can
+ communicate with the system daemon or use a session
+ daemon.
+
+ > If you want to output CD-Audio, write AUDIO_DRIVER=pulse or
+ AUDIO_DRIVER=alsa to ~/.cdemud and use "cdemu -b session"
+ to control a session daemon.
+MSG
+
+ return 0
+}
+
+post_upgrade () {
+ # Repeat install message due to policy changes
+ # Added on 2012-06-19, remove after a grace period
+ post_install
+
+ return 0
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/community-testing/cdemu-daemon/cdemu-daemon.service b/community-testing/cdemu-daemon/cdemu-daemon.service
new file mode 100644
index 000000000..9879a3e6f
--- /dev/null
+++ b/community-testing/cdemu-daemon/cdemu-daemon.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=CDEmu Daemon
+
+[Service]
+Type=dbus
+BusName=net.sf.cdemu.CDEMUD_Daemon
+ExecStart=/usr/lib/cdemu-daemon/cdemu-daemon-system.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/community-testing/cdemu-daemon/cdemud-dbus.conf b/community-testing/cdemu-daemon/cdemud-dbus.conf
new file mode 100644
index 000000000..3043fe251
--- /dev/null
+++ b/community-testing/cdemu-daemon/cdemud-dbus.conf
@@ -0,0 +1,24 @@
+<!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 CDEMUD_Daemon service on bus -->
+ <policy user="root">
+ <allow own="net.sf.cdemu.CDEMUD_Daemon"/>
+ </policy>
+ <policy group="root">
+ <allow own="net.sf.cdemu.CDEMUD_Daemon"/>
+ </policy>
+
+ <!-- Allow users at the console to invoke methods on the interface -->
+ <policy at_console="true">
+ <allow send_destination="net.sf.cdemu.CDEMUD_Daemon"/>
+ </policy>
+
+ <!-- Allow users in the 'cdemu' group to invoke methods on the interface -->
+ <policy group="cdemu">
+ <allow send_destination="net.sf.cdemu.CDEMUD_Daemon"/>
+ </policy>
+</busconfig>
+
diff --git a/community-testing/cdemu-daemon/cdemud.conf b/community-testing/cdemu-daemon/cdemud.conf
new file mode 100644
index 000000000..1d8c55fe6
--- /dev/null
+++ b/community-testing/cdemu-daemon/cdemud.conf
@@ -0,0 +1,8 @@
+# how many optical drives to emulate
+NUM_DEVICES=2
+
+# audio backend (null, alsa or pulse)
+AUDIO_DRIVER=null
+
+# log file
+LOG_FILE=/var/log/cdemud.log
diff --git a/community-testing/cdemu-daemon/cdemud.rc b/community-testing/cdemu-daemon/cdemud.rc
new file mode 100644
index 000000000..09b9ec345
--- /dev/null
+++ b/community-testing/cdemu-daemon/cdemud.rc
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting cdemud"
+ /usr/lib/cdemu-daemon/cdemu-daemon-system.sh &
+ if [ $? -ne 0 ]; then
+ stat_fail
+ else
+ add_daemon cdemud
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping cdemud"
+ kill `pidof cdemud` &>/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
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};
diff --git a/community-testing/vhba-module/60-vhba.rules b/community-testing/vhba-module/60-vhba.rules
index 91de6f86a..e4de1dca7 100644
--- a/community-testing/vhba-module/60-vhba.rules
+++ b/community-testing/vhba-module/60-vhba.rules
@@ -1 +1,13 @@
-KERNEL=="vhba_ctl", NAME="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu"
+ACTION=="remove", GOTO="vhba_end"
+KERNEL!="vhba_ctl", GOTO="vhba_end"
+
+NAME="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu"
+
+TEST=="/sys/fs/cgroup/systemd", GOTO="vhba_uaccess"
+TAG+="udev-acl"
+GOTO="vhba_end"
+
+LABEL="vhba_uaccess"
+TAG+="uaccess"
+
+LABEL="vhba_end"
diff --git a/community-testing/vhba-module/PKGBUILD b/community-testing/vhba-module/PKGBUILD
index 685a5db1d..083415a0c 100644
--- a/community-testing/vhba-module/PKGBUILD
+++ b/community-testing/vhba-module/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 71080 2012-05-23 14:37:08Z heftig $
+# $Id: PKGBUILD 72680 2012-06-19 12:52:14Z heftig $
# Maintainer: Ray Rashif <schiv@archlinux.org>
# Contributor: Mateusz Herych <heniekk@gmail.com>
# Contributor: Charles Lindsay <charles@chaoslizard.org>
@@ -6,7 +6,7 @@
pkgname=vhba-module
pkgver=20120422
_extramodules=extramodules-3.4-ARCH
-pkgrel=1
+pkgrel=2
pkgdesc="Kernel module that emulates SCSI devices"
arch=('i686' 'x86_64')
url="http://cdemu.sourceforge.net/"
@@ -17,7 +17,7 @@ install=$pkgname.install
source=("http://downloads.sourceforge.net/cdemu/$pkgname-$pkgver.tar.bz2"
'60-vhba.rules')
md5sums=('d97372da1d270d1605742b2995fb6678'
- '549bd2d9696bd1884c8eed7193c00e21')
+ 'b5e82d0160e7a181219b67c1794d5c27')
build() {
cd "$srcdir/$pkgname-$pkgver"
diff --git a/community-testing/vhba-module/vhba-module.install b/community-testing/vhba-module/vhba-module.install
index 73029498f..d9264d853 100644
--- a/community-testing/vhba-module/vhba-module.install
+++ b/community-testing/vhba-module/vhba-module.install
@@ -1,7 +1,7 @@
post_upgrade() {
! grep -q 'cdemu' /etc/group && groupadd cdemu
echo " > Updating module dependencies..."
- EXTRAMODULES='extramodules-3.2-ARCH'
+ EXTRAMODULES='extramodules-3.4-ARCH'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
}