1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils gnome2-utils systemd unpacker
11 DESCRIPTION="All-In-One Solution for Remote Access and Support over the Internet"
12 HOMEPAGE="https://www.teamviewer.com"
13 SRC_URI="https://download.teamviewer.com/download/version_${MV}x/${PN}_${PV}_i386.deb"
17 LICENSE="TeamViewer LGPL-2.1" #LGPL for bundled wine
19 KEYWORDS="-* ~amd64 ~x86"
21 RESTRICT="bindist mirror"
24 system-wine? ( app-emulation/wine[abi_x86_32(-)] )
25 dev-qt/qtcore:4[abi_x86_32(-)]
26 dev-qt/qtgui:4[abi_x86_32(-)]
27 dev-qt/qtwebkit:4[abi_x86_32(-)]
28 media-libs/alsa-lib[abi_x86_32(-)]
29 x11-libs/libICE[abi_x86_32(-)]
30 x11-libs/libSM[abi_x86_32(-)]
31 x11-libs/libX11[abi_x86_32(-)]
32 x11-libs/libXau[abi_x86_32(-)]
33 x11-libs/libXdamage[abi_x86_32(-)]
34 x11-libs/libXdmcp[abi_x86_32(-)]
35 x11-libs/libXext[abi_x86_32(-)]
36 x11-libs/libXfixes[abi_x86_32(-)]
37 x11-libs/libXrandr[abi_x86_32(-)]
38 x11-libs/libXtst[abi_x86_32(-)]"
40 QA_PREBUILT="opt/teamviewer${MV}/*"
42 S=${WORKDIR}/opt/teamviewer/tv_bin
45 #epatch "${FILESDIR}/${P}-gentoo.patch"
47 -e "s/@TVV@/${MV}/g" \
48 "${FILESDIR}"/${PN}d.init > "${T}"/init || die
50 -e "s:/opt/teamviewer:/opt/teamviewer${MV}:g" \
51 "script//${PN}d.service" > "${T}/${PN}d.service" || die
53 -e "s/@TVV@/${PV}/g" \
54 -e "s/@TVMV@/${MV}/g" \
55 "${FILESDIR}"/${PN}.sh > "${T}"/sh || die
56 if ! use system-wine; then
57 sed -i "s/native=true/native=false/g" "${T}/sh" || die
62 local destdir="/opt/${MY_PN}"
64 # install wine prefix skeleton and reg keys
65 insinto "${destdir}/wine/drive_c/"
66 doins -r wine/drive_c/TeamViewer/
67 # install bundled wine if necessary
68 if ! use system-wine; then
69 insinto "${destdir}/tv_bin/wine"
70 doins -r wine/{lib,share}
71 exeinto "${destdir}/tv_bin/wine/bin"
72 doexe wine/bin/{wine,wine-preloader,wineserver}
75 fperms 755 ${destdir}/wine/drive_c/TeamViewer/TeamViewer.exe
77 # install wine wrapper
79 newexe "${T}/sh" "${MY_PN}"
81 # install teamviewer linux binaries
82 exeinto "${destdir}/tv_bin"
83 doexe TeamViewer_Desktop TVGuiDelegate TVGuiSlave.32
84 use amd64 && doexe TVGuiSlave.64
86 # install daemon binary and scripts
87 exeinto "${destdir}/tv_bin"
89 newinitd "${T}/init" ${PN}d${MV}
90 newconfd "${FILESDIR}/${PN}d.conf" ${PN}d${MV}
91 systemd_newunit "${T}/${PN}d.service" ${PN}d${MV}.service
94 keepdir /var/log/${MY_PN}
95 dosym /var/log/${MY_PN} /opt/${MY_PN}/logfiles
99 dosym /etc/${MY_PN} /opt/${MY_PN}/config
101 newicon -s 48 desktop/${PN}.png ${MY_PN}.png
102 #dodoc ../doc/linux_FAQ_{EN,DE}.txt
103 make_desktop_entry ${MY_PN} "TeamViewer ${MV}" ${MY_PN}
111 gnome2_icon_cache_update
113 elog "TeamViewer from upstream uses an overly-complicated set of bash"
114 elog "scripts to start the program. This has been simplified for Gentoo"
115 elog "use. Any issues should be reported via bugzilla."
116 if use system-wine; then
118 elog "Due to bug #552016, when using system wine, one is not able to"
119 elog "share one's own screen. At this time, this may be remedied by"
120 elog "toggling the system-wine USE flag."
123 elog "The end-user client requires running the accompanying daemon,"
124 elog "available via init-scripts."
128 gnome2_icon_cache_update