summaryrefslogtreecommitdiff
path: root/pcr/spice-vdagent/PKGBUILD
blob: 429ab3cee856626474ab9d4ae55b5fcab8028746 (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
# Maintainer (Arch): mutantmonkey <aur@mutantmonkey.in>
pkgname=spice-vdagent
pkgver=0.16.0
pkgrel=2
pkgdesc="Spice agent xorg client that enables copy and paste between client and X-session and more"
arch=('i686' 'x86_64')
url="http://www.spice-space.org/"
license=('GPL')
depends=('libpciaccess' 'libxinerama' 'libxrandr' 'libxfixes'
         'libsystemd' 'alsa-lib' 'glib2')
optdepends=('dex: start spice-vdagent automatically on login')
makedepends=('systemd' 'spice-protocol>=0.12.8')
backup=('etc/conf.d/spice-vdagentd.conf')
source=("http://www.spice-space.org/download/releases/$pkgname-$pkgver.tar.bz2"{,.sign}
        'spice-vdagentd.conf.d')
sha256sums=('5b951646e0bd996afda2d063e706fa2aad2655af5bdd1b6525260ab50be30f7d'
            'SKIP'
            '03e0cc9e0f0e2afb3fc99846b8eb1fcb0698955833c67a40a6692c7df4df2d12')
validpgpkeys=('94A9F75661F77A6168649B23A9D8C21429AC6C82')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  # set udevrulesdir, since this is impossible with a flag
  sed -i 's/udevrulesdir = \/lib/udevrulesdir = \/usr\/lib/' Makefile.am

  # remove mkdir for /var/run/spice-vdagentd
  sed -i 's/$(mkdir_p) $(DESTDIR)$(localstatedir)\/run\/spice-vdagentd/true/' \
    Makefile.am

  sed -i 's/\/var\/run/\/run/' data/tmpfiles.d/spice-vdagentd.conf
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  autoreconf -fi
  ./configure --prefix=/usr \
    --bindir=/usr/bin --sbindir=/usr/bin --sysconfdir=/etc \
    --localstatedir=/var --libdir=/usr/lib \
    --with-session-info=systemd --with-init-script=systemd \
    --enable-static-uinput
  make
}

check() {
  cd "$srcdir/$pkgname-$pkgver"
  make -k check
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install

  sed -i 's/\/etc\/sysconfig\/spice-vdagentd/\/etc\/conf.d\/spice-vdagentd.conf/' $pkgdir/usr/lib/systemd/system/spice-vdagentd.service
  sed -i 's/\/usr\/sbin/\/usr\/bin/' $pkgdir/usr/lib/systemd/system/spice-vdagentd.service

  install  -Dm0755 "${srcdir}/spice-vdagentd.conf.d" "${pkgdir}/etc/conf.d/spice-vdagentd.conf"
}

# vim:set ts=2 sw=2 et: