3610881932b8faa97bc0e727ffeeed0523064dd1
[gentoo.git] / app-emulation / spice-vdagent / spice-vdagent-0.19.0-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools linux-info
7
8 DESCRIPTION="SPICE VD Linux Guest Agent"
9 HOMEPAGE="https://www.spice-space.org/"
10 SRC_URI="https://www.spice-space.org/download/releases/${P}.tar.bz2"
11
12 LICENSE="LGPL-2.1"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="consolekit gtk selinux systemd"
16
17 CDEPEND="
18         >=app-emulation/spice-protocol-0.14.0
19         media-libs/alsa-lib
20         >=x11-libs/libpciaccess-0.10
21         x11-libs/libdrm
22         x11-libs/libXfixes
23         x11-libs/libXrandr
24         x11-libs/libX11
25         x11-libs/libXinerama
26         consolekit? ( sys-auth/consolekit sys-apps/dbus )
27         gtk? ( x11-libs/gtk+:3 )
28         systemd? ( sys-apps/systemd )"
29 DEPEND="${CDEPEND}
30         virtual/pkgconfig"
31 RDEPEND="${CDEPEND}
32         selinux? ( sec-policy/selinux-vdagent )"
33
34 CONFIG_CHECK="~INPUT_UINPUT ~VIRTIO_CONSOLE"
35 ERROR_INPUT_UINPUT="User level input support (INPUT_UINPUT) is required"
36 ERROR_VIRTIO_CONSOLE="VirtIO console/serial device support (VIRTIO_CONSOLE) is required"
37
38 src_configure() {
39         local opt=()
40         if use consolekit; then
41                 opt+=( --with-session-info=console-kit )
42         elif use systemd; then
43                 opt+=( --with-session-info=systemd )
44         else
45                 opt+=( --with-session-info=none )
46         fi
47
48         econf \
49                 --with-init-script=systemd \
50                 --localstatedir="${EPREFIX}"/var \
51                 $(use_with gtk) \
52                 "${opt[@]}"
53 }
54
55 src_install() {
56         default
57
58         cd "${ED}" && rmdir -p var/run/spice-vdagentd || die
59
60         keepdir /var/log/spice-vdagentd
61
62         newinitd "${FILESDIR}/${PN}.initd-4" "${PN}"
63         newconfd "${FILESDIR}/${PN}.confd-2" "${PN}"
64 }