summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 062f7f5bc50fc855b32bdc3bda68b25999c84119 (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
64
# Maintainer:  Peter Mattern <pmattern at arcor dot de>

_pkgname=spice-vdagent
pkgname=$_pkgname-git
pkgver=0.22.1.r3.gaa08162
pkgrel=1
pkgdesc='SPICE VDAgent for Linux'
arch=('i686' 'x86_64')
url='https://www.spice-space.org'
license=('GPL-3.0-only')
depends=('glib2' 'alsa-lib' 'libdrm' 'libxfixes' 'libxrandr' 'libxinerama' 'systemd' 'gtk3' 'dbus')
makedepends=('git' 'spice-protocol')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("$_pkgname::git+https://gitlab.freedesktop.org/spice/linux/vd_agent.git"
         spice-vdagentd.conf.sample)
sha256sums=("SKIP"
            ab5231eb6375fee5baaf10a59559e7dea58def158fa0ab8e125e9b7340c5e4e8)

pkgver() {
    cd $_pkgname
    git describe --always | sed 's:^spice-vdagent.::;s:-:.r:;s:-:.:'
}

prepare() {

    # adjustment of several paths to the habits of Arch Linux

    cd $_pkgname

    # don't expect file providing command line options for spice-vdagentd in /etc/sysconfig
    sed -i 's:etc/sysconfig.*$:etc/spice/spice-vdagentd.conf:' data/spice-vdagentd.service

    # /bin and /usr/sbin should be avoided
    sed -i 's:bin.rm:usr/bin/rm:;s:sbin:bin:' data/spice-vdagentd.service

    # place runtime data directory in /run instead of /var/run
    sed -i 's:$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd:true:' Makefile.am
    sed -i 's:/var::' data/tmpfiles.d/spice-vdagentd.conf

    # place udev rules file in /usr/lib instead of /lib
    sed -i 's:udevrulesdir = /lib:udevrulesdir = /usr/lib:' Makefile.am

}

build() {
    cd $_pkgname
    autoreconf -fi
    ./configure \
        --prefix=/usr \
        --sysconfdir=/etc \
        --sbindir=/usr/bin \
        --localstatedir=/var \
        --with-init-script=systemd
    make
}

package() {
    cd $_pkgname
    make DESTDIR=$pkgdir install

    # sample configuration file to pass command line options to spice-vdagentd
    install -Dm644 -t $pkgdir/usr/share/doc/spice-vdagent/ $srcdir/spice-vdagentd.conf.sample
}