# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 inherit eutils systemd gnome2-utils # Major version MY_MV="${PV/\.*}" DESCRIPTION="All-In-One Solution for Remote Access and Support over the Internet" HOMEPAGE="https://www.teamviewer.com" SRC_URI="amd64? ( https://dl.tvcdn.de/download/linux/version_${MY_MV}x/${PN}_${PV}_amd64.tar.xz -> ${PN}-${PV}_amd64.tar.xz ) x86? ( https://dl.tvcdn.de/download/linux/version_${MY_MV}x/${PN}_${PV}_i386.tar.xz -> ${PN}-${PV}_x86.tar.xz ) arm? ( https://dl.tvcdn.de/download/linux/version_${MY_MV}x/${PN}_${PV}_armhf.tar.xz -> ${PN}-${PV}_arm.tar.xz )" SLOT="0" KEYWORDS="-* ~amd64 ~x86 ~arm" RESTRICT="bindist mirror" IUSE="" LICENSE="TeamViewer MIT" DEPEND="sys-apps/sed" RDEPEND="!net-misc/teamviewer dev-qt/qtcore:5 dev-qt/qtdbus:5 dev-qt/qtdeclarative:5 dev-qt/qtgui:5 dev-qt/qtnetwork:5 dev-qt/qtquickcontrols:5 dev-qt/qtwebkit:5 dev-qt/qtwidgets:5 dev-qt/qtx11extras:5 sys-apps/dbus" # Silence QA messages QA_PREBUILT="opt/teamviewer/*" S="${WORKDIR}/teamviewer" src_prepare() { default # Switch operation mode from 'portable' to 'installed' sed -i 's/TAR_NI/TAR_IN/g' tv_bin/script/tvw_config || die } src_install() { # Install destination local dst="/opt/teamviewer" # Remove unsed binary 'libdepend' (relic of previous Wine-based releases) rm tv_bin/script/libdepend # Install application files/resources insinto ${dst} doins -r tv_bin # Set permissions for executables and libraries for exe in $(find tv_bin -type f -executable -or -name '*.so'); do fperms 755 ${dst}/${exe} done # Install daemon init script and systemd service newinitd "${FILESDIR}/teamviewerd-${PV}.init" teamviewerd systemd_dounit tv_bin/script/teamviewerd.service # Install D-Bus services insinto /usr/share/dbus-1/services doins tv_bin/script/com.teamviewer.TeamViewer.service doins tv_bin/script/com.teamviewer.TeamViewer.Desktop.service # Install Polkit policy insinto /usr/share/polkit-1/actions doins tv_bin/script/com.teamviewer.TeamViewer.policy # Install icons for size in 16 24 32 48 256; do newicon -s ${size} tv_bin/desktop/teamviewer_${size}.png TeamViewer.png done # Install documents for doc in $(find doc -type f); do dodoc ${doc} done # Create directory and symlink for global config keepdir /etc/teamviewer dosym /etc/teamviewer ${dst}/config # Create directory and symlink for log files keepdir /var/log/teamviewer${MY_MV} dosym /var/log/teamviewer${MY_MV} ${dst}/logfiles # Create symlinks to main executables in /opt/bin dodir /opt/bin dosym ${dst}/tv_bin/teamviewerd /opt/bin/teamviewerd dosym ${dst}/tv_bin/script/teamviewer /opt/bin/teamviewer # Create application menu entry make_desktop_entry teamviewer "TeamViewer Host" TeamViewer } pkg_postinst() { gnome2_icon_cache_update elog "Before using TeamViewer Host, you need to start its daemon:" elog "" elog "OpenRC:" elog "# /etc/init.d/teamviewerd start" elog "# rc-update add teamviewerd default" elog elog "Systemd:" elog "# systemctl start teamviewerd.service" elog "# systemctl enable teamviewerd.service" elog "" elog "To display additional command line options simply run:" elog "# teamviewer help" elog "" elog "NOTE: some commands may require root privileges" } pkg_postrm() { gnome2_icon_cache_update }