commit:     c93a5aa4d63ef216bff85c61d039509da7b47c3d
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 29 05:49:11 2020 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Jan  7 01:54:20 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c93a5aa4

Revert "net-misc/chrome-remote-desktop: remove package"

This reverts commit c5c9e0d4dc94f19ba7b00b918a3c65818c23e0e4.

Cleanup mess made by careless devs.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 net-misc/chrome-remote-desktop/Manifest            |   3 +
 .../chrome-remote-desktop-63.0.3239.17-r1.ebuild   | 126 +++++++++++++++++++
 .../chrome-remote-desktop-77.0.3865.32.ebuild      | 137 ++++++++++++++++++++
 .../chrome-remote-desktop-80.0.3987.18.ebuild      | 138 +++++++++++++++++++++
 ...e-remote-desktop-44.0.2403.44-always-sudo.patch |  20 +++
 .../files/chrome-remote-desktop.conf.d             |   7 ++
 .../files/chrome-remote-desktop.rc                 |  65 ++++++++++
 net-misc/chrome-remote-desktop/metadata.xml        |  10 ++
 8 files changed, 506 insertions(+)

diff --git a/net-misc/chrome-remote-desktop/Manifest 
b/net-misc/chrome-remote-desktop/Manifest
new file mode 100644
index 00000000000..0ef12519ee3
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/Manifest
@@ -0,0 +1,3 @@
+DIST chrome-remote-desktop_63.0.3239.17_amd64.deb 19026074 BLAKE2B 
9a62d317768d6c0ab3cf3c6e7c5dea074133cc7c5d2b04ffdc1e0f9877f5f606c044ebab7b230914eba2ade51d2805fb1267f7b1731fa36235495a8192eb3c48
 SHA512 
2843deb7817217c8b8e41931b1e9ef0fdfb40c6a4ceb1bc69499aed16cc729d7ed64f88200c9bb2366a768f294a164da2360ed2b9654d1626696bcf0403e347a
+DIST chrome-remote-desktop_77.0.3865.32_amd64.deb 35724698 BLAKE2B 
25828e144d88072fde7a7e50cd278df1a90b94e0281038239d67e2369eaf93e82897cbda4624cffe34f045b185437a892671541eeb685b80a912733380e3afb8
 SHA512 
1181592536b9313ca136ce280c8349e3d7325b2bfa116714adc4fcb4d4b4f8659cb53cba134d2476b696fa73f55eefbc0a255f6cc76fb1a93eecfff42eb1d425
+DIST chrome-remote-desktop_80.0.3987.18_amd64.deb 27188594 BLAKE2B 
10dbb9364195da2d648d1087360ad7d2845b51d2517eef7e793f6b004d27a4a4331c6b7138db0dcee6d220ca2758549562ddbb1ab176a30dae8ae35744fceb31
 SHA512 
6aee7482ee9dbbc46dabf132c3ab4f610a568de7bb476e1dfdfd19a3ae30fa5d3ac8b9469699e5f0ecea436a3d565252d0a86818f27c7c095d9c6db5859d35a6

diff --git 
a/net-misc/chrome-remote-desktop/chrome-remote-desktop-63.0.3239.17-r1.ebuild 
b/net-misc/chrome-remote-desktop/chrome-remote-desktop-63.0.3239.17-r1.ebuild
new file mode 100644
index 00000000000..4c61d6b3d16
--- /dev/null
+++ 
b/net-misc/chrome-remote-desktop/chrome-remote-desktop-63.0.3239.17-r1.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Base URL: https://dl.google.com/linux/chrome-remote-desktop/deb/
+# Fetch the Release file:
+#  https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/Release
+# Which gives you the Packages file:
+#  
https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-i386/Packages
+#  
https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-amd64/Packages
+# And finally gives you the file name:
+#  
pool/main/c/chrome-remote-desktop/chrome-remote-desktop_29.0.1547.32_amd64.deb
+#
+# Use curl to find the answer:
+#  curl -q 
https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-amd64/Packages
 | grep ^Filename
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+PLOCALES="am ar bg bn ca cs da de el en_GB en es_419 es et fa fil fi fr gu he 
hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt_BR pt_PT ro ru sk sl sr sv 
sw ta te th tr uk vi zh_CN zh_TW"
+
+inherit unpacker eutils python-single-r1 l10n
+
+DESCRIPTION="access remote computers via Chrome!"
+PLUGIN_URL="https://chrome.google.com/remotedesktop";
+HOMEPAGE="https://support.google.com/chrome/answer/1649523 ${PLUGIN_URL}"
+BASE_URI="https://dl.google.com/linux/chrome-remote-desktop/deb/pool/main/c/${PN}/${PN}_${PV}";
+SRC_URI="amd64? ( ${BASE_URI}_amd64.deb )"
+
+LICENSE="google-chrome"
+SLOT="0"
+KEYWORDS="-* amd64"
+IUSE="xrandr"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="bindist mirror"
+
+# All the libs this package links against.
+RDEPEND="app-admin/sudo
+       ${PYTHON_DEPS}
+       >=dev-libs/expat-2
+       dev-libs/glib:2
+       dev-libs/nspr
+       dev-libs/nss
+       dev-python/psutil
+       gnome-base/gconf:2
+       media-libs/fontconfig
+       media-libs/freetype:2
+       sys-devel/gcc
+       sys-libs/glibc
+       sys-libs/pam
+       x11-apps/xdpyinfo
+       x11-apps/setxkbmap
+       x11-libs/cairo
+       x11-libs/gtk+:2
+       x11-libs/libX11
+       x11-libs/libXdamage
+       x11-libs/libXext
+       x11-libs/libXfixes
+       x11-libs/libXi
+       x11-libs/libXrandr
+       x11-libs/libXtst
+       x11-libs/pango"
+# Settings we just need at runtime.
+# TODO: Look at switching to xf86-video-dummy & xf86-input-void instead of 
xvfb.
+RDEPEND+="
+       xrandr? ( x11-apps/xrandr )
+       x11-base/xorg-server[xvfb]"
+DEPEND=""
+
+S=${WORKDIR}
+
+QA_PREBUILT="/opt/google/chrome-remote-desktop/*"
+
+src_prepare() {
+       epatch "${FILESDIR}"/${PN}-44.0.2403.44-always-sudo.patch #541708
+       cd opt/google/chrome-remote-desktop
+       python_fix_shebang chrome-remote-desktop
+
+       cd remoting_locales
+       rm fake-bidi* || die
+       PLOCALES=${PLOCALES//_/-} l10n_find_plocales_changes "${PWD}" '' '.pak'
+}
+
+src_install() {
+       pushd opt/google/chrome-remote-desktop/remoting_locales >/dev/null || 
die
+       rm_pak() { local l=${1//_/-}; rm "${l}.pak" "${l}.pak.info"; }
+       l10n_for_each_disabled_locale_do rm_pak
+       popd >/dev/null
+
+       insinto /etc
+       doins -r etc/opt
+
+       insinto /opt
+       doins -r opt/google
+       chmod a+rx "${ED}"/opt/google/${PN}/* || die
+       fperms +s /opt/google/${PN}/user-session
+
+       dodir /etc/pam.d
+       dosym system-remote-login /etc/pam.d/${PN}
+
+       dodoc usr/share/doc/${PN}/changelog*
+
+       newinitd "${FILESDIR}"/${PN}.rc ${PN}
+       newconfd "${FILESDIR}"/${PN}.conf.d ${PN}
+}
+
+pkg_postinst() {
+       if [[ -z ${REPLACING_VERSIONS} ]] ; then
+               elog "Two ways to launch the server:"
+               elog "(1) access an existing desktop"
+               elog "    (a) install the Chrome plugin on the server & client:"
+               elog "        ${PLUGIN_URL}"
+               elog "    (b) on the server, run the Chrome plugin & enable 
remote access"
+               elog "    (c) on the client, connect to the server"
+               elog "(2) headless system"
+               elog "    (a) install the Chrome plugin on the client:"
+               elog "        ${PLUGIN_URL}"
+               elog "    (b) run 
${EPREFIX}opt/google/chrome-remote-desktop/start-host --help to get the auth 
URL"
+               elog "    (c) when it redirects you to a blank page, look at 
the URL for a code=XXX field"
+               elog "    (d) run start-host again, and past the code when 
asked for an authorization code"
+               elog "    (e) on the client, connect to the server"
+               elog
+               elog "Configuration settings you might want to be aware of:"
+               elog "  ~/.${PN}-session - shell script to start your session"
+               elog "  /etc/init.d/${PN} - script to auto-restart server"
+       fi
+}

diff --git 
a/net-misc/chrome-remote-desktop/chrome-remote-desktop-77.0.3865.32.ebuild 
b/net-misc/chrome-remote-desktop/chrome-remote-desktop-77.0.3865.32.ebuild
new file mode 100644
index 00000000000..ea0b20823e0
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/chrome-remote-desktop-77.0.3865.32.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Base URL: https://dl.google.com/linux/chrome-remote-desktop/deb/
+# Fetch the Release file:
+#  https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/Release
+# Which gives you the Packages file:
+#  
https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-i386/Packages
+#  
https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-amd64/Packages
+# And finally gives you the file name:
+#  
pool/main/c/chrome-remote-desktop/chrome-remote-desktop_29.0.1547.32_amd64.deb
+#
+# Use curl to find the answer:
+#  curl -q 
https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-amd64/Packages
 | grep ^Filename
+
+EAPI="6"
+
+PYTHON_COMPAT=( python2_7 )
+PLOCALES="am ar bg bn ca cs da de el en_GB en es_419 es et fa fil fi fr gu he 
hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt_BR pt_PT ro ru sk sl sr sv 
sw ta te th tr uk vi zh_CN zh_TW"
+
+inherit unpacker eutils python-single-r1 l10n
+
+DESCRIPTION="access remote computers via Chrome!"
+PLUGIN_URL="https://chrome.google.com/remotedesktop";
+HOMEPAGE="https://support.google.com/chrome/answer/1649523 ${PLUGIN_URL}"
+BASE_URI="https://dl.google.com/linux/chrome-remote-desktop/deb/pool/main/c/${PN}/${PN}_${PV}";
+SRC_URI="amd64? ( ${BASE_URI}_amd64.deb )"
+
+LICENSE="google-chrome"
+SLOT="0"
+KEYWORDS="-* ~amd64"
+IUSE="xrandr"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="bindist mirror"
+
+# All the libs this package links against.
+RDEPEND="app-admin/sudo
+       ${PYTHON_DEPS}
+       >=dev-libs/expat-2
+       dev-libs/glib:2
+       dev-libs/nspr
+       dev-libs/nss
+       dev-python/psutil
+       gnome-base/gconf:2
+       media-libs/fontconfig
+       media-libs/freetype:2
+       sys-devel/gcc
+       sys-libs/glibc
+       sys-libs/pam
+       x11-apps/xdpyinfo
+       x11-apps/setxkbmap
+       x11-libs/cairo
+       x11-libs/gtk+:2
+       x11-libs/libX11
+       x11-libs/libXdamage
+       x11-libs/libXext
+       x11-libs/libXfixes
+       x11-libs/libXi
+       x11-libs/libXrandr
+       x11-libs/libXtst
+       x11-libs/pango"
+# Settings we just need at runtime.
+# TODO: Look at switching to xf86-video-dummy & xf86-input-void instead of 
xvfb.
+# - The env var (CHROME_REMOTE_DESKTOP_USE_XORG) seems to be stripped before 
being checked.
+# - The Xorg invocation uses absolute paths with -logfile & -config which are 
rejected.
+# - The config takes over the active display in addition to starting up a 
virtual one.
+RDEPEND+="
+       xrandr? ( x11-apps/xrandr )
+       x11-base/xorg-server[xvfb]"
+DEPEND=""
+
+S=${WORKDIR}
+
+QA_PREBUILT="/opt/google/chrome-remote-desktop/*"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-44.0.2403.44-always-sudo.patch #541708
+)
+
+src_prepare() {
+       default
+
+       gunzip usr/share/doc/${PN}/*.gz || die
+
+       cd opt/google/chrome-remote-desktop
+       python_fix_shebang chrome-remote-desktop
+
+       cd remoting_locales
+       rm fake-bidi* || die
+       PLOCALES=${PLOCALES//_/-} l10n_find_plocales_changes "${PWD}" '' '.pak'
+}
+
+src_install() {
+       pushd opt/google/chrome-remote-desktop/remoting_locales >/dev/null || 
die
+       rm_pak() { local l=${1//_/-}; rm "${l}.pak" "${l}.pak.info"; }
+       l10n_for_each_disabled_locale_do rm_pak
+       popd >/dev/null
+
+       insinto /etc
+       doins -r etc/opt
+       dosym ../opt/chrome/native-messaging-hosts 
/etc/chromium/native-messaging-hosts #581754
+
+       insinto /opt
+       doins -r opt/google
+       chmod a+rx "${ED}"/opt/google/${PN}/* || die
+       fperms +s /opt/google/${PN}/user-session
+
+       dodir /etc/pam.d
+       dosym system-remote-login /etc/pam.d/${PN}
+
+       dodoc usr/share/doc/${PN}/changelog*
+
+       newinitd "${FILESDIR}"/${PN}.rc ${PN}
+       newconfd "${FILESDIR}"/${PN}.conf.d ${PN}
+}
+
+pkg_postinst() {
+       if [[ -z ${REPLACING_VERSIONS} ]] ; then
+               elog "Two ways to launch the server:"
+               elog "(1) access an existing desktop"
+               elog "    (a) install the Chrome plugin on the server & client:"
+               elog "        ${PLUGIN_URL}"
+               elog "    (b) on the server, run the Chrome plugin & enable 
remote access"
+               elog "    (c) on the client, connect to the server"
+               elog "(2) headless system"
+               elog "    (a) install the Chrome plugin on the client:"
+               elog "        ${PLUGIN_URL}"
+               elog "    (b) run 
${EPREFIX}opt/google/chrome-remote-desktop/start-host --help to get the auth 
URL"
+               elog "    (c) when it redirects you to a blank page, look at 
the URL for a code=XXX field"
+               elog "    (d) run start-host again, and past the code when 
asked for an authorization code"
+               elog "    (e) on the client, connect to the server"
+               elog
+               elog "Configuration settings you might want to be aware of:"
+               elog "  ~/.${PN}-session - shell script to start your session"
+               elog "  /etc/init.d/${PN} - script to auto-restart server"
+       fi
+}

diff --git 
a/net-misc/chrome-remote-desktop/chrome-remote-desktop-80.0.3987.18.ebuild 
b/net-misc/chrome-remote-desktop/chrome-remote-desktop-80.0.3987.18.ebuild
new file mode 100644
index 00000000000..a4c723ac7f2
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/chrome-remote-desktop-80.0.3987.18.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Base URL: https://dl.google.com/linux/chrome-remote-desktop/deb/
+# Fetch the Release file:
+#  https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/Release
+# Which gives you the Packages file:
+#  
https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-i386/Packages
+#  
https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-amd64/Packages
+# And finally gives you the file name:
+#  
pool/main/c/chrome-remote-desktop/chrome-remote-desktop_29.0.1547.32_amd64.deb
+#
+# Use curl to find the answer:
+#  curl -q 
https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-amd64/Packages
 | grep ^Filename
+
+EAPI="7"
+
+PYTHON_COMPAT=( python2_7 )
+PLOCALES="am ar bg bn ca cs da de el en_GB en es_419 es et fa fil fi fr gu he 
hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt_BR pt_PT ro ru sk sl sr sv 
sw ta te th tr uk vi zh_CN zh_TW"
+
+inherit unpacker eutils python-single-r1 l10n
+
+DESCRIPTION="access remote computers via Chrome!"
+PLUGIN_URL="https://chrome.google.com/remotedesktop";
+HOMEPAGE="https://support.google.com/chrome/answer/1649523
+       https://chrome.google.com/remotedesktop";
+BASE_URI="https://dl.google.com/linux/chrome-remote-desktop/deb/pool/main/c/${PN}/${PN}_${PV}";
+SRC_URI="amd64? ( ${BASE_URI}_amd64.deb )"
+
+LICENSE="google-chrome"
+SLOT="0"
+KEYWORDS="-* ~amd64"
+IUSE="xrandr"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="bindist mirror"
+
+# All the libs this package links against.
+RDEPEND="app-admin/sudo
+       ${PYTHON_DEPS}
+       >=dev-libs/expat-2
+       dev-libs/glib:2
+       dev-libs/nspr
+       dev-libs/nss
+       dev-python/psutil
+       gnome-base/gconf:2
+       media-libs/fontconfig
+       media-libs/freetype:2
+       sys-devel/gcc
+       sys-libs/glibc
+       sys-libs/pam
+       x11-apps/xdpyinfo
+       x11-apps/setxkbmap
+       x11-libs/cairo
+       x11-libs/gtk+:2
+       x11-libs/libX11
+       x11-libs/libXdamage
+       x11-libs/libXext
+       x11-libs/libXfixes
+       x11-libs/libXi
+       x11-libs/libXrandr
+       x11-libs/libXtst
+       x11-libs/pango"
+# Settings we just need at runtime.
+# TODO: Look at switching to xf86-video-dummy & xf86-input-void instead of 
xvfb.
+# - The env var (CHROME_REMOTE_DESKTOP_USE_XORG) seems to be stripped before 
being checked.
+# - The Xorg invocation uses absolute paths with -logfile & -config which are 
rejected.
+# - The config takes over the active display in addition to starting up a 
virtual one.
+RDEPEND+="
+       xrandr? ( x11-apps/xrandr )
+       x11-base/xorg-server[xvfb]"
+DEPEND=""
+
+S=${WORKDIR}
+
+QA_PREBUILT="/opt/google/chrome-remote-desktop/*"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-44.0.2403.44-always-sudo.patch #541708
+)
+
+src_prepare() {
+       default
+
+       gunzip usr/share/doc/${PN}/*.gz || die
+
+       cd opt/google/chrome-remote-desktop
+       python_fix_shebang chrome-remote-desktop
+
+       cd remoting_locales
+       rm fake-bidi* || die
+       PLOCALES=${PLOCALES//_/-} l10n_find_plocales_changes "${PWD}" '' '.pak'
+}
+
+src_install() {
+       pushd opt/google/chrome-remote-desktop/remoting_locales >/dev/null || 
die
+       rm_pak() { local l=${1//_/-}; rm "${l}.pak" "${l}.pak.info"; }
+       l10n_for_each_disabled_locale_do rm_pak
+       popd >/dev/null
+
+       insinto /etc
+       doins -r etc/opt
+       dosym ../opt/chrome/native-messaging-hosts 
/etc/chromium/native-messaging-hosts #581754
+
+       insinto /opt
+       doins -r opt/google
+       chmod a+rx "${ED}"/opt/google/${PN}/* || die
+       fperms +s /opt/google/${PN}/user-session
+
+       dodir /etc/pam.d
+       dosym system-remote-login /etc/pam.d/${PN}
+
+       dodoc usr/share/doc/${PN}/changelog*
+
+       newinitd "${FILESDIR}"/${PN}.rc ${PN}
+       newconfd "${FILESDIR}"/${PN}.conf.d ${PN}
+}
+
+pkg_postinst() {
+       if [[ -z ${REPLACING_VERSIONS} ]] ; then
+               elog "Two ways to launch the server:"
+               elog "(1) access an existing desktop"
+               elog "    (a) install the Chrome plugin on the server & client:"
+               elog "        ${PLUGIN_URL}"
+               elog "    (b) on the server, run the Chrome plugin & enable 
remote access"
+               elog "    (c) on the client, connect to the server"
+               elog "(2) headless system"
+               elog "    (a) install the Chrome plugin on the client:"
+               elog "        ${PLUGIN_URL}"
+               elog "    (b) run 
${EPREFIX}/opt/google/chrome-remote-desktop/start-host --help to get the auth 
URL"
+               elog "    (c) when it redirects you to a blank page, look at 
the URL for a code=XXX field"
+               elog "    (d) run start-host again, and past the code when 
asked for an authorization code"
+               elog "    (e) on the client, connect to the server"
+               elog
+               elog "Configuration settings you might want to be aware of:"
+               elog "  ~/.${PN}-session - shell script to start your session"
+               elog "  /etc/init.d/${PN} - script to auto-restart server"
+       fi
+}

diff --git 
a/net-misc/chrome-remote-desktop/files/chrome-remote-desktop-44.0.2403.44-always-sudo.patch
 
b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop-44.0.2403.44-always-sudo.patch
new file mode 100644
index 00000000000..d303e5e753f
--- /dev/null
+++ 
b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop-44.0.2403.44-always-sudo.patch
@@ -0,0 +1,20 @@
+https://bugs.gentoo.org/541708
+
+just use `sudo` for everything
+
+--- a/opt/google/chrome-remote-desktop/chrome-remote-desktop
++++ b/opt/google/chrome-remote-desktop/chrome-remote-desktop
+@@ -1092,12 +1092,7 @@
+       logging.info("Group '%s' not found." % CHROME_REMOTING_GROUP_NAME)
+ 
+     command = [SCRIPT_PATH, '--add-user-as-root', user]
+-    if os.getenv("DISPLAY"):
+-      # TODO(rickyz): Add a Polkit policy that includes a more friendly 
message
+-      # about what this command does.
+-      command = ["/usr/bin/pkexec"] + command
+-    else:
+-      command = ["/usr/bin/sudo", "-k", "--"] + command
++    command = ["/usr/bin/sudo", "-k", "--"] + command
+ 
+     # Run with an empty environment out of paranoia, though if an attacker
+     # controls the environment this script is run under, we're already screwed

diff --git a/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.conf.d 
b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.conf.d
new file mode 100644
index 00000000000..aa3d8919c87
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.conf.d
@@ -0,0 +1,7 @@
+# /etc/conf.d/chrome-remote-desktop: config file for 
/etc/init.d/chrome-remote-desktop
+
+# List of users to start Chrome Remote Desktop for.
+CHROME_REMOTING_USERS=''
+
+# Options to pass to chrome-remote-desktop.  Only the -s option is interesting.
+#OPTIONS='-s 1600x1200 -s 3840x1600'

diff --git a/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.rc 
b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.rc
new file mode 100644
index 00000000000..272923ce6af
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.rc
@@ -0,0 +1,65 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="checkconfig reload"
+
+CRD=/opt/google/chrome-remote-desktop/chrome-remote-desktop
+
+depend() {
+       need net
+       use logger
+}
+
+checkconfig() {
+       local ret=0
+       if [ -z "${CHROME_REMOTING_USERS}" ] ; then
+               eerror "You must set CHROME_REMOTING_USERS in 
/etc/conf.d/${SVCNAME} first"
+               ret=1
+       else
+               local user
+               for user in ${CHROME_REMOTING_USERS} ; do
+                       if ! id "${user}" >/dev/null ; then
+                               eerror "Invalid user found in 
CHROME_REMOTING_USERS: ${user}"
+                               ret=1
+                       fi
+               done
+       fi
+       return ${ret}
+}
+
+for_users() {
+       local user ret msg log
+       msg=$1; shift
+
+       for user in ${CHROME_REMOTING_USERS} ; do
+               ebegin "${msg} ${SVCNAME} for ${user}"
+
+               # We need to background the app as it won't fork until the 
network
+               # (including DNS) is available.
+               start-stop-daemon \
+                       -b \
+                       -u "${user}" \
+                       -x "${CRD}" \
+                       -- \
+                       ${OPTIONS} \
+                       "$@"
+               eend $?
+               : $(( ret |= $? ))
+       done
+
+       return ${ret}
+}
+
+start() {
+       checkconfig || return
+       for_users Starting --start
+}
+
+stop() {
+       for_users Stopping --stop
+}
+
+reload() {
+       for_users Reloading --reload
+}

diff --git a/net-misc/chrome-remote-desktop/metadata.xml 
b/net-misc/chrome-remote-desktop/metadata.xml
new file mode 100644
index 00000000000..09ff7ff62a4
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+<maintainer type="person">
+       <email>[email protected]</email>
+</maintainer>
+<use>
+       <flag name="xrandr">Enable support for the XRandR extension for dynamic 
desktop resizing</flag>
+</use>
+</pkgmetadata>

Reply via email to