commit:     9878eb26536caeadc3d46597643ea67ef9e27af4
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 18 00:22:25 2017 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Dec 18 01:28:44 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9878eb26

net-misc/teamviewer: Fix slotting

Package-Manager: Portage-2.3.19, Repoman-2.3.6

 net-misc/teamviewer/files/teamviewerd13.init    |  2 +-
 net-misc/teamviewer/teamviewer-13.0.5693.ebuild | 46 +++++++++++++------------
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/net-misc/teamviewer/files/teamviewerd13.init 
b/net-misc/teamviewer/files/teamviewerd13.init
index bb6e23884b6..79dbc29e2aa 100644
--- a/net-misc/teamviewer/files/teamviewerd13.init
+++ b/net-misc/teamviewer/files/teamviewerd13.init
@@ -2,7 +2,7 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-command="/opt/teamviewer/tv_bin/teamviewerd"
+command="/opt/teamviewer13/tv_bin/teamviewerd"
 command_args="-d"
 description="Starts the TeamViewer remote control daemon"
 pidfile="/var/run/teamviewerd.pid"

diff --git a/net-misc/teamviewer/teamviewer-13.0.5693.ebuild 
b/net-misc/teamviewer/teamviewer-13.0.5693.ebuild
index 768c644d329..5928c42171d 100644
--- a/net-misc/teamviewer/teamviewer-13.0.5693.ebuild
+++ b/net-misc/teamviewer/teamviewer-13.0.5693.ebuild
@@ -3,17 +3,16 @@
 
 EAPI=6
 
-MV=${PV/\.*}
-MY_PN=${PN}${MV}
+MY_PN=${PN}${PV/\.*}
 inherit eutils gnome2-utils systemd
 
 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_${MV}x/${PN}_${PV}_amd64.tar.xz )
-               x86? ( 
https://dl.tvcdn.de/download/linux/version_${MV}x/${PN}_${PV}_i386.tar.xz )"
+SRC_URI="amd64? ( 
https://dl.tvcdn.de/download/linux/version_${PV/\.*}x/${PN}_${PV}_amd64.tar.xz )
+               x86? ( 
https://dl.tvcdn.de/download/linux/version_${PV/\.*}x/${PN}_${PV}_i386.tar.xz )"
 
 LICENSE="TeamViewer MIT"
-SLOT="${MV}"
+SLOT="${PV/\.*}"
 KEYWORDS="-* ~amd64 ~x86"
 IUSE=""
 
@@ -34,7 +33,7 @@ RDEPEND="
 RESTRICT="bindist mirror"
 
 # Silence QA messages
-QA_PREBUILT="opt/teamviewer/*"
+QA_PREBUILT="opt/${MY_PN}/*"
 
 S="${WORKDIR}"/teamviewer
 
@@ -42,11 +41,14 @@ src_prepare() {
        default
 
        # Switch operation mode from 'portable' to 'installed'
-       sed -i 's/TAR_NI/TAR_IN/g' tv_bin/script/tvw_config || die
+       sed -e "s/TAR_NI/TAR_IN/g" -i tv_bin/script/tvw_config || die
+
+       sed -e "/^ExecStart/s/${PN}/${MY_PN}/" \
+               -i tv_bin/script/teamviewerd.service || die
 }
 
 src_install() {
-       local dst="/opt/teamviewer" # install destination
+       local dst="/opt/${MY_PN}" # install destination
 
        # Quirk:
        # Remove Intel 80386 32-bit ELF binary 'libdepend' present in all
@@ -64,8 +66,8 @@ src_install() {
                fperms 755 ${dst}/${exe}
        done
 
-       newinitd "${FILESDIR}"/teamviewerd13.init teamviewerd
-       systemd_dounit tv_bin/script/teamviewerd.service
+       newinitd "${FILESDIR}"/teamviewerd13.init teamviewerd${SLOT}
+       systemd_newunit tv_bin/script/${PN}d.service ${PN}d${SLOT}.service
 
        insinto /usr/share/dbus-1/services
        doins tv_bin/script/com.teamviewer.TeamViewer.service
@@ -75,7 +77,7 @@ src_install() {
        doins tv_bin/script/com.teamviewer.TeamViewer.policy
 
        for size in 16 24 32 48 256; do
-               newicon -s ${size} tv_bin/desktop/teamviewer_${size}.png 
TeamViewer.png
+               newicon -s ${size} tv_bin/desktop/teamviewer_${size}.png 
${MY_PN}.png
        done
 
        # Install documents (NOTE: using 'dodoc -r doc' instead of loop will
@@ -85,21 +87,21 @@ src_install() {
                dodoc ${doc}
        done
 
-       keepdir /etc/teamviewer
-       dosym /etc/teamviewer ${dst}/config
+       keepdir /etc/${MY_PN}
+       dosym /etc/${MY_PN} ${dst}/config
 
        # Create directory and symlink for log files (NOTE: according to Team-
        # Viewer devs, all paths are hard-coded in the binaries; therefore
        # using the same path as the DEB/RPM archives, i.e. '/var/log/teamviewer
        # <major-version>')
-       keepdir /var/log/teamviewer${MV}
-       dosym /var/log/teamviewer${MV} ${dst}/logfiles
+       keepdir /var/log/${MY_PN}
+       dosym /var/log/${MY_PN} ${dst}/logfiles
 
        dodir /opt/bin
-       dosym ${dst}/tv_bin/teamviewerd /opt/bin/teamviewerd
-       dosym ${dst}/tv_bin/script/teamviewer /opt/bin/teamviewer
+       dosym ${dst}/tv_bin/teamviewerd /opt/bin/teamviewerd${SLOT}
+       dosym ${dst}/tv_bin/script/teamviewer /opt/bin/${MY_PN}
 
-       make_desktop_entry teamviewer "TeamViewer" TeamViewer
+       make_desktop_entry ${MY_PN} "TeamViewer ${SLOT}" ${MY_PN}
 }
 
 pkg_postinst() {
@@ -107,12 +109,12 @@ pkg_postinst() {
 
        elog "Before using TeamViewer, you need to start its daemon:"
        elog "OpenRC:"
-       elog "# /etc/init.d/teamviewerd start"
-       elog "# rc-update add teamviewerd default"
+       elog "# /etc/init.d/teamviewerd${SLOT} start"
+       elog "# rc-update add teamviewerd${SLOT} default"
        elog
        elog "Systemd:"
-       elog "# systemctl start teamviewerd.service"
-       elog "# systemctl enable teamviewerd.service"
+       elog "# systemctl start teamviewerd${SLOT}.service"
+       elog "# systemctl enable teamviewerd${SLOT}.service"
        elog
        elog "To display additional command line options simply run:"
        elog "$ ${MY_PN} help"

Reply via email to