# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 # Import eutils (required for newicon, make_desktop_entry) inherit eutils # Determine major version (required to determine download URL) MY_MV=${PV/\.*} # Strip '-bin' from package name MY_PN=${PN/-bin/} # Application name (used for menu entry) MY_AN="TeamViewer" # Package information DESCRIPTION="All-In-One Solution for Remote Access and Support over the Internet" HOMEPAGE="https://www.teamviewer.com" SRC_URI="https://download.teamviewer.com/download/version_${MY_MV}x/${MY_PN}_${PV}_i386.tar.xz" SLOT=0 KEYWORDS="-* ~amd64 ~x86" RESTRICT="bindist mirror" # Licenses (TeamViewer, Wine/QTWebKit, xdg-utils, D-Bus) LICENSE="TeamViewer LGPL-2.1 MIT || ( AFL-2.1 GPL-2 )" # Required dependencies (provided by 'tv-setup checklibs') RDEPEND=" sys-apps/dbus[abi_x86_32(-)] virtual/jpeg:62[abi_x86_32(-)] media-libs/fontconfig[abi_x86_32(-)] media-libs/freetype[abi_x86_32(-)] media-libs/libpng:1.2[abi_x86_32(-)] media-libs/alsa-lib[abi_x86_32(-)] sys-libs/zlib[abi_x86_32(-)] x11-libs/libICE[abi_x86_32(-)] x11-libs/libSM[abi_x86_32(-)] x11-libs/libX11[abi_x86_32(-)] x11-libs/libXau[abi_x86_32(-)] x11-libs/libXdamage[abi_x86_32(-)] x11-libs/libXdmcp[abi_x86_32(-)] x11-libs/libXext[abi_x86_32(-)] x11-libs/libXfixes[abi_x86_32(-)] x11-libs/libXrandr[abi_x86_32(-)] x11-libs/libXtst[abi_x86_32(-)] " # Silence QA messages QA_PREBUILT="opt/${MY_PN}/*" # Set temporary build directory to subdirectory of archive S=${WORKDIR}/${MY_PN} src_prepare() { default # Switch operation mode from 'portable' to 'installed' sed -i 's/TAR_NI/TAR_IN/g' tv_bin/script/tvw_config || die # Change user local share folder name from 'teamviewer12' to 'teamviewer' sed -i 's/teamviewer12/teamviewer/g' tv_bin/script/tvw_config || die } src_install() { # Define install destination local dst="/opt/${MY_PN}" # Install main application insinto ${dst} doins -r tv_bin # Restore permissions for executables for exe in $(find tv_bin -type f -executable); do fperms 755 ${dst}/${exe} done # Install daemon init script and config newinitd ${FILESDIR}/${MY_PN}d.init ${MY_PN}d #newconfd ${FILESDIR}/${MY_PN}d.conf ${MY_PN}d # Install documents for doc in $(find doc -type f); do dodoc $doc done # Create directory and symlink for global config keepdir /etc/${MY_PN} dosym /etc/${MY_PN} ${dst}/config # Create directory and symlink for log files keepdir /var/log/${MY_PN} dosym /var/log/${MY_PN} ${dst}/logfiles # Install symlink to executable dodir /opt/bin dosym ${dst}/tv_bin/script/${MY_PN} /opt/bin/${MY_PN} # Install application icon and menu entry newicon -s 48 tv_bin/desktop/${MY_PN}.png ${MY_PN}.png make_desktop_entry ${MY_PN} "${MY_AN}" ${MY_PN} } pkg_postinst() { elog "Before using TeamViewer, you need to start its daemon:" elog "# /etc/init.d/teamviewerd start" elog "" elog "You might want to add teamviewerd to the default runlevel:" elog "# rc-update add teamviewerd default" elog "" elog "To display additional command line options simply run:" elog "# teamviewer help" }