dev-lang/python-2.7: unfork python-exec wrapping support

For python 2.7, upstream gentoo added symlink creation with commit
6c2f9e9f1170 ("dev-lang/python: Add symlinks for python-exec wrapping
of execs").  The python 3.* versions were later updated by [1]-[3],
but the 2.7 ones were not.

[1] 8512ed0c726cc39ad004df0d1cca18c15fbcf39e ("dev-lang/python: Add compat symlink for pythonX.Y-config")
[2] c673770d67a67a83f41fb1eddc9e29726b22bb33 ("dev-lang/python: Ensure python-config & .pc ABI symlinks, idle wrapping")
[3] 9483c233c49989f12e192847b5248055f896a0a2 ("dev-lang/python: Install a wrapper to fix python-config paths, #569506")

We implemented the same in our local 2.7 ebuild in [4], but based on the
modified 3.* approach.
[4] https://chromium-review.googlesource.com/1315770

Let's unfork ourselves to make updating python2.7 a little more
straightforward.

BUG=chromium:736313,chromium:884766
TEST=PreCQ, SDK tryjob
TEST=sudo emerge dev-lang/python:2.7
    # confirm python versions remain unchanged
    python --version # expect 2.7
    python2 --version # expect 2.7

Change-Id: I7923c05105f8792fbcc90cab412225a82ccccafc
Reviewed-on: https://chromium-review.googlesource.com/1623917
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
diff --git a/dev-lang/python/python-2.7.10.ebuild b/dev-lang/python/python-2.7.10.ebuild
index accd5a7..7b6bd34 100644
--- a/dev-lang/python/python-2.7.10.ebuild
+++ b/dev-lang/python/python-2.7.10.ebuild
@@ -419,8 +419,6 @@
 	mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
 	rm -f "${ED}usr/bin/smtpd.py"
 
-	local abiver="python2.7"
-
 		use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die
 		use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
 		use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
@@ -465,33 +463,21 @@
 	# python-exec wrapping support
 	local pymajor=${SLOT%.*}
 	mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
-
-	# python-exec: python, pythonX
-	dosym "../../../bin/${abiver}" \
-		"${PYTHON_SCRIPTDIR}/python${pymajor}"
-	dosym "python${pymajor}" "${PYTHON_SCRIPTDIR}/python"
-
-	# python-exec: python-config, python-configX
-	#
-	# Note: we need to create a wrapper rather than symlinking it due
-	# to some random dirname(argv[0]) magic performed by python-config.
-	cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
-		#!/bin/sh
-		exec "${abiver}-config" "\${@}"
-	EOF
-	# Must strip EPREFIX because fperms prepends ED.
-	fperms 755 "${PYTHON_SCRIPTDIR#$EPREFIX}/python${pymajor}-config"
-	dosym "python${pymajor}-config" \
-		"${PYTHON_SCRIPTDIR}/python-config"
-
-	# python-exec: pydoc, pydocX
-	dosym "../../../bin/pydoc${SLOT}" \
-		"${PYTHON_SCRIPTDIR}/pydoc${pymajor}"
-	dosym "pydoc${pymajor}" "${PYTHON_SCRIPTDIR}/pydoc"
-
-	# python-exec: 2to3
-	dosym "../../../bin/2to3-${SLOT}" \
-		"${PYTHON_SCRIPTDIR}/2to3"
+	# python and pythonX
+	ln -s "../../../bin/python${SLOT}" \
+		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+	ln -s "python${pymajor}" \
+		"${D}${PYTHON_SCRIPTDIR}/python" || die
+	# python-config and pythonX-config
+	ln -s "../../../bin/python${SLOT}-config" \
+		"${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+	ln -s "python${pymajor}-config" \
+		"${D}${PYTHON_SCRIPTDIR}/python-config" || die
+	# 2to3, pydoc, pyvenv
+	ln -s "../../../bin/2to3-${SLOT}" \
+		"${D}${PYTHON_SCRIPTDIR}/2to3" || die
+	ln -s "../../../bin/pydoc${SLOT}" \
+		"${D}${PYTHON_SCRIPTDIR}/pydoc" || die
 
 	# The sysconfig module will actually read the pyconfig.h at runtime to see what kind
 	# of functionality is enabled in the build.  Deploy it behind the back of portage as