summaryrefslogtreecommitdiff
path: root/community/cdemu-daemon/PKGBUILD
blob: 4dec04ed81250cb205ae754ece7304d9881c9b2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# $Id: PKGBUILD 73196 2012-07-03 19:16:11Z dreisner $
# 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: