summaryrefslogtreecommitdiff
blob: d6ab3121665bb455063fb00e071e39e5efe88297 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="7"

inherit desktop systemd xdg-utils

DESCRIPTION="Feature rich multi-platform remote desktop application"
HOMEPAGE="https://anydesk.com"
SRC_URI="amd64? ( https://download.anydesk.com/linux/${P}-amd64.tar.gz )
	x86? ( https://download.anydesk.com/linux/${P}-i686.tar.gz )"

# OpeSSL/SSLeay, libvpx, zlib, Xiph, xxHash
LICENSE="AnyDesk-TOS BSD BSD-2 openssl ZLIB"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"

RDEPEND="
	dev-libs/atk
	dev-libs/glib
	media-libs/fontconfig
	media-libs/freetype
	media-libs/glu
	media-libs/mesa
	sys-auth/polkit
	x11-libs/cairo
	x11-libs/gdk-pixbuf
	x11-libs/gtk+
	x11-libs/gtkglext
	x11-libs/libICE
	x11-libs/libSM
	x11-libs/libX11
	x11-libs/libXdamage
	x11-libs/libXext
	x11-libs/libXfixes
	x11-libs/libXi
	x11-libs/libXmu
	x11-libs/libXrandr
	x11-libs/libXt
	x11-libs/libXtst
	x11-libs/libxcb
	x11-libs/pango
	x11-libs/pangox-compat
"

RESTRICT="bindist mirror"

QA_PREBUILT="opt/${PN}/*"

src_install() {
	local dst="/opt/${PN}"

	dodir ${dst}
	exeinto ${dst}
	doexe ${PN}

	dodir /opt/bin
	dosym ${dst}/${PN} /opt/bin/${PN}

	newinitd "${FILESDIR}"/anydesk.init anydesk
	systemd_newunit "${FILESDIR}"/anydesk-4.0.1.service anydesk.service

	insinto /usr/share/polkit-1/actions
	doins polkit-1/com.philandro.anydesk.policy

	insinto /usr/share
	doins -r icons

	domenu anydesk.desktop

	keepdir /etc/${PN}

	dodoc changelog copyright README
}

pkg_postinst() {
	xdg_desktop_database_update
	xdg_icon_cache_update

	if [[ -z ${REPLACING_VERSIONS} ]]; then
		elog "To run AnyDesk as background service use:"
		elog
		elog "OpenRC:"
		elog "# rc-service anydesk start"
		elog "# rc-update add anydesk default"
		elog
		elog "Systemd:"
		elog "# systemctl start anydesk.service"
		elog "# systemctl enable anydesk.service"
		elog
		elog "Please see README at /usr/share/doc/${PF}/README.bz2 for"
		elog "further information about the linux version of AnyDesk."
		elog
		elog "AnyDesk might require the following commands/packages"
		elog "for some functions:"
		elog "* lsb_release	(sys-apps/lsb-release)"
		elog "* lsusb		(sys-apps/usbutils)"
	fi
}

pkg_postrm() {
	xdg_desktop_database_update
	xdg_icon_cache_update
}