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(-),png] )
25 !system-wine? ( media-libs/libpng:1.2[abi_x86_32(-)] )
26 sys-apps/dbus[abi_x86_32(-)]
27 dev-qt/qtcore:4[abi_x86_32(-)]
28 dev-qt/qtgui:4[abi_x86_32(-)]
29 dev-qt/qtwebkit:4[abi_x86_32(-)]
30 media-libs/alsa-lib[abi_x86_32(-)]
31 x11-libs/libICE[abi_x86_32(-)]
32 x11-libs/libSM[abi_x86_32(-)]
33 x11-libs/libX11[abi_x86_32(-)]
34 x11-libs/libXau[abi_x86_32(-)]
35 x11-libs/libXdamage[abi_x86_32(-)]
36 x11-libs/libXdmcp[abi_x86_32(-)]
37 x11-libs/libXext[abi_x86_32(-)]
38 x11-libs/libXfixes[abi_x86_32(-)]
39 x11-libs/libXrandr[abi_x86_32(-)]
40 x11-libs/libXtst[abi_x86_32(-)]"
42 QA_PREBUILT="opt/teamviewer${MV}/*"
44 S=${WORKDIR}/opt/teamviewer/tv_bin
47 #epatch "${FILESDIR}/${P}-gentoo.patch"
49 -e "s/@TVV@/${MV}/g" \
50 "${FILESDIR}"/${PN}d.init > "${T}"/init || die
52 -e "s:/opt/teamviewer:/opt/teamviewer${MV}:g" \
53 "script//${PN}d.service" > "${T}/${PN}d.service" || die
55 -e "s/@TVV@/${PV}/g" \
56 -e "s/@TVMV@/${MV}/g" \
57 "${FILESDIR}"/${PN}.sh > "${T}"/sh || die
58 if ! use system-wine; then
59 sed -i "s/native=true/native=false/g" "${T}/sh" || die
64 local destdir="/opt/${MY_PN}"
66 # install wine prefix skeleton and reg keys
67 insinto "${destdir}/wine/drive_c/"
68 doins -r wine/drive_c/TeamViewer/
69 # install bundled wine if necessary
70 if ! use system-wine; then
71 insinto "${destdir}/tv_bin/wine"
72 doins -r wine/{lib,share}
73 exeinto "${destdir}/tv_bin/wine/bin"
74 doexe wine/bin/{wine,wine-preloader,wineserver}
77 fperms 755 ${destdir}/wine/drive_c/TeamViewer/TeamViewer.exe
79 # install wine wrapper
81 newexe "${T}/sh" "${MY_PN}"
83 # install teamviewer linux binaries
84 exeinto "${destdir}/tv_bin"
85 doexe TeamViewer_Desktop TVGuiDelegate TVGuiSlave.32
86 use amd64 && doexe TVGuiSlave.64
88 # install daemon binary and scripts
89 exeinto "${destdir}/tv_bin"
91 newinitd "${T}/init" ${PN}d${MV}
92 newconfd "${FILESDIR}/${PN}d.conf" ${PN}d${MV}
93 systemd_newunit "${T}/${PN}d.service" ${PN}d${MV}.service
96 keepdir /var/log/${MY_PN}
97 dosym /var/log/${MY_PN} /opt/${MY_PN}/logfiles
100 keepdir /etc/${MY_PN}
101 dosym /etc/${MY_PN} /opt/${MY_PN}/config
103 newicon -s 48 desktop/${PN}.png ${MY_PN}.png
104 #dodoc ../doc/linux_FAQ_{EN,DE}.txt
105 make_desktop_entry ${MY_PN} "TeamViewer ${MV}" ${MY_PN}
113 gnome2_icon_cache_update
115 elog "TeamViewer from upstream uses an overly-complicated set of bash"
116 elog "scripts to start the program. This has been simplified for Gentoo"
117 elog "use. Any issues should be reported via bugzilla."
118 if use system-wine; then
120 elog "Due to bug #552016, when using system wine, one is not able to"
121 elog "share one's own screen. At this time, this may be remedied by"
122 elog "toggling the system-wine USE flag."
125 elog "The end-user client requires running the accompanying daemon,"
126 elog "available via init-scripts."
130 gnome2_icon_cache_update