Revert "coreutils: upgraded package to upstream (and drop realpath)"

This reverts commit ac55e1639ab0957e6d61c2a0b3ce1e4bb109cead

ToT on lumpy with this patch reverted passes all bvt tests. This has somehow caused DBus services to no longer be reachable.

TEST=remote trybot hwtest
BUG=chromium-os:37219

Change-Id: I3f09ad254c6df0e67c0c1b3451d007ad9566cf1b
Reviewed-on: https://gerrit.chromium.org/gerrit/39661
Commit-Ready: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
diff --git a/app-misc/realpath/Manifest b/app-misc/realpath/Manifest
new file mode 100644
index 0000000..f587dab
--- /dev/null
+++ b/app-misc/realpath/Manifest
@@ -0,0 +1,2 @@
+DIST realpath_1.15.tar.gz 17406 RMD160 83129946171248446b3bcd1eae8ad82217c4248d SHA1 27174ef37d846761a12ebd81af1398327ee824b9 SHA256 b3d11cec375145ea60663e6fe54727c70a0e86c18f40bddac2a89b635cc1531f
+DIST realpath_1.15_i386.deb 15670 RMD160 cedc694ff0e7302581ee3a81ba951ca591309828 SHA1 a890ea32d012d712fc263a68a076631805feab4c SHA256 6fdcace221422a042d7fce941e46977adfb3b1da44d23e8be00628c56d726d3e
diff --git a/app-misc/realpath/files/realpath-1.14-build.patch b/app-misc/realpath/files/realpath-1.14-build.patch
new file mode 100644
index 0000000..baba53f
--- /dev/null
+++ b/app-misc/realpath/files/realpath-1.14-build.patch
@@ -0,0 +1,26 @@
+diff -ur realpath-1.14.orig/common.mk realpath-1.14/common.mk
+--- realpath-1.14.orig/common.mk	2009-02-22 11:58:00.000000000 +0000
++++ realpath-1.14/common.mk	2009-04-30 16:12:29.000000000 +0000
+@@ -34,9 +34,9 @@
+ applicationsdir := $(prefix)/share/applications
+ 
+ PERL            := /usr/bin/perl
+-CC              := gcc
+-CFLAGS           = -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Werror -g -DVERSION='"$(VERSION)"' -DPACKAGE='"$(PACKAGE)"' -DLOCALEDIR='"$(nlsdir)"'
+-LDFLAGS         :=
++CC              ?= gcc
++CFLAGS          += -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -DVERSION='"$(VERSION)"' -DPACKAGE='"$(PACKAGE)"' -DLOCALEDIR='"$(nlsdir)"'
++LDFLAGS         +=
+ LIBS            := 
+ 
+ ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+@@ -60,9 +60,6 @@
+   unexport CDPATH ENV
+ 
+   ifdef DESTDIR
+-    ifneq ($(DESTDIR),$(abspath $(DESTDIR)))
+-      $(error DESTDIR "$(DESTDIR)" is not an absolute path)
+-    endif
+     override ddirshort  :=  DESTDIR
+     export ddirshort
+   endif
diff --git a/app-misc/realpath/files/realpath-1.14-no-po4a.patch b/app-misc/realpath/files/realpath-1.14-no-po4a.patch
new file mode 100644
index 0000000..cfa7805
--- /dev/null
+++ b/app-misc/realpath/files/realpath-1.14-no-po4a.patch
@@ -0,0 +1,12 @@
+Don't require po4a at build time.
+http://bugs.gentoo.org/269905
+
+--- realpath-1.14-orig/po/Makefile	2009-02-22 12:56:47.000000000 +0100
++++ realpath-1.14/po/Makefile	2009-05-19 23:45:26.000000000 +0200
+@@ -4,5 +4,5 @@
+ #
+ 
+ ALL_TARGET=
+-SUBDIRS=bin man
++SUBDIRS=bin
+ include ../common.mk
diff --git a/app-misc/realpath/realpath-1.15.ebuild b/app-misc/realpath/realpath-1.15.ebuild
new file mode 100644
index 0000000..a0735fa
--- /dev/null
+++ b/app-misc/realpath/realpath-1.15.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/realpath/realpath-1.15.ebuild,v 1.1 2009/10/13 16:58:23 ulm Exp $
+
+EAPI=2
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Return the canonicalized absolute pathname"
+HOMEPAGE="http://packages.debian.org/unstable/utils/realpath"
+SRC_URI="mirror://debian/pool/main/r/${PN}/${PN}_${PV}.tar.gz
+	nls? ( mirror://debian/pool/main/r/${PN}/${PN}_${PV}_i386.deb )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE="nls"
+
+RDEPEND="!sys-freebsd/freebsd-bin"
+
+src_unpack() {
+	unpack ${PN}_${PV}.tar.gz
+
+	if use nls; then
+		# Unpack the .deb file, in order to get the preprocessed man page
+		# translations. This way we avoid a dependency on app-text/po4a.
+		mkdir deb
+		cd deb
+		unpack ${PN}_${PV}_i386.deb
+		unpack ./data.tar.gz
+		gunzip -r usr/share/man || die "gunzip failed"
+	fi
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-1.14-build.patch
+	epatch "${FILESDIR}"/${PN}-1.14-no-po4a.patch
+}
+
+src_compile() {
+	tc-export CC
+	emake VERSION="${PV}" SUBDIRS="src man $(use nls && echo po)" \
+		|| die "emake failed"
+}
+
+src_install() {
+	emake VERSION="${PV}" SUBDIRS="src man $(use nls && echo po)" \
+		DESTDIR="${D}" install || die "emake install failed"
+	newdoc debian/changelog ChangeLog.debian
+
+	if use nls; then
+		local dir
+		for dir in "${WORKDIR}"/deb/usr/share/man/*; do
+			[ -f "${dir}"/man1/realpath.1 ] || continue
+			newman "${dir}"/man1/realpath.1 realpath.${dir##*/}.1 \
+				|| die "newman failed"
+		done
+	fi
+}
diff --git a/metadata/md5-cache/sys-apps/coreutils-7.5-r1 b/metadata/md5-cache/sys-apps/coreutils-7.5-r1
new file mode 100644
index 0000000..6163788
--- /dev/null
+++ b/metadata/md5-cache/sys-apps/coreutils-7.5-r1
@@ -0,0 +1,12 @@
+DEFINED_PHASES=compile install postinst test unpack
+DEPEND=caps? ( sys-libs/libcap ) gmp? ( dev-libs/gmp ) selinux? ( sys-libs/libselinux ) acl? ( sys-apps/acl ) xattr? ( sys-apps/attr ) nls? ( >=sys-devel/gettext-0.15 ) !<sys-apps/util-linux-2.13 !sys-apps/stat !net-mail/base64 !sys-apps/mktemp !<app-forensics/tct-1.18-r1 !<net-fs/netatalk-2.0.3-r4 !<sci-chemistry/ccp4-6.1.1 >=sys-libs/ncurses-5.3-r5 || ( app-arch/xz-utils app-arch/lzma-utils )
+DESCRIPTION=Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)
+HOMEPAGE=http://www.gnu.org/software/coreutils/
+IUSE=acl caps gmp nls selinux static vanilla xattr
+KEYWORDS=alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86
+LICENSE=GPL-3
+RDEPEND=caps? ( sys-libs/libcap ) gmp? ( dev-libs/gmp ) selinux? ( sys-libs/libselinux ) acl? ( sys-apps/acl ) xattr? ( sys-apps/attr ) nls? ( >=sys-devel/gettext-0.15 ) !<sys-apps/util-linux-2.13 !sys-apps/stat !net-mail/base64 !sys-apps/mktemp !<app-forensics/tct-1.18-r1 !<net-fs/netatalk-2.0.3-r4 !<sci-chemistry/ccp4-6.1.1 >=sys-libs/ncurses-5.3-r5
+SLOT=0
+SRC_URI=ftp://alpha.gnu.org/gnu/coreutils/coreutils-7.5.tar.gz mirror://gnu/coreutils/coreutils-7.5.tar.gz mirror://gentoo/coreutils-7.5.tar.gz mirror://gentoo/coreutils-7.5-patches-2.tar.lzma http://dev.gentoo.org/~vapier/dist/coreutils-7.5-patches-2.tar.lzma
+_eclasses_=eutils	33ef77a15337022e05342d2c772a7a5a	flag-o-matic	01a8b1eb019305bc4b4a8bd0b04e4cd8	multilib	5f4ad6cf85e365e8f0c6050ddd21659e	portability	0be430f759a631e692678ed796e09f5c	toolchain-funcs	6526ac6fc9aedf391efb91fcd75ace68	user	9e552f935106ff0bc92af16da64b4b29
+_md5_=ec18fcab9b6291f3a6f280510f300665
diff --git a/metadata/md5-cache/sys-apps/coreutils-8.20 b/metadata/md5-cache/sys-apps/coreutils-8.20
deleted file mode 100644
index 6f193c1..0000000
--- a/metadata/md5-cache/sys-apps/coreutils-8.20
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=configure install postinst prepare test
-DEPEND=!static? ( acl? ( sys-apps/acl ) caps? ( sys-libs/libcap ) gmp? ( dev-libs/gmp ) xattr? ( !userland_BSD? ( sys-apps/attr ) ) ) selinux? ( sys-libs/libselinux ) nls? ( >=sys-devel/gettext-0.15 ) !app-misc/realpath !<sys-apps/util-linux-2.13 !sys-apps/stat !net-mail/base64 !sys-apps/mktemp !<app-forensics/tct-1.18-r1 !<net-fs/netatalk-2.0.3-r4 !<sci-chemistry/ccp4-6.1.1 static? ( acl? ( sys-apps/acl[static-libs] ) caps? ( sys-libs/libcap ) gmp? ( dev-libs/gmp[static-libs] ) xattr? ( !userland_BSD? ( sys-apps/attr[static-libs] ) ) ) app-arch/xz-utils
-DESCRIPTION=Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)
-EAPI=3
-HOMEPAGE=http://www.gnu.org/software/coreutils/
-IUSE=acl caps gmp nls selinux static userland_BSD vanilla xattr
-KEYWORDS=~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd
-LICENSE=GPL-3
-RDEPEND=!static? ( acl? ( sys-apps/acl ) caps? ( sys-libs/libcap ) gmp? ( dev-libs/gmp ) xattr? ( !userland_BSD? ( sys-apps/attr ) ) ) selinux? ( sys-libs/libselinux ) nls? ( >=sys-devel/gettext-0.15 ) !app-misc/realpath !<sys-apps/util-linux-2.13 !sys-apps/stat !net-mail/base64 !sys-apps/mktemp !<app-forensics/tct-1.18-r1 !<net-fs/netatalk-2.0.3-r4 !<sci-chemistry/ccp4-6.1.1
-SLOT=0
-SRC_URI=mirror://gnu-alpha/coreutils/coreutils-8.20.tar.xz mirror://gnu/coreutils/coreutils-8.20.tar.xz mirror://gentoo/coreutils-8.20.tar.xz mirror://gentoo/coreutils-8.20-patches-1.1.tar.xz http://dev.gentoo.org/~ryao/dist/coreutils-8.20-patches-1.1.tar.xz
-_eclasses_=eutils	33ef77a15337022e05342d2c772a7a5a	flag-o-matic	01a8b1eb019305bc4b4a8bd0b04e4cd8	multilib	5f4ad6cf85e365e8f0c6050ddd21659e	portability	0be430f759a631e692678ed796e09f5c	toolchain-funcs	6526ac6fc9aedf391efb91fcd75ace68	user	9e552f935106ff0bc92af16da64b4b29
-_md5_=51a4adcd372a18514da63848b1d8649f
diff --git a/sys-apps/coreutils/Manifest b/sys-apps/coreutils/Manifest
index 7a4196b..be67b12 100644
--- a/sys-apps/coreutils/Manifest
+++ b/sys-apps/coreutils/Manifest
@@ -1,2 +1,2 @@
-DIST coreutils-8.20-patches-1.1.tar.xz 19504 RMD160 3dc266645a88af8722726d66f5cccb5e9517d8f0 SHA1 cd32a518491542c487a795156441dbcc9c66074e SHA256 0a1a3cc578e8872ebc93113edd76d1f1d88fb4d6596a047cfbb6c5fd4e82c22d
-DIST coreutils-8.20.tar.xz 5273788 RMD160 1e634929fd0934754bab8e2293e2b8c365ac04a4 SHA1 b120f138758100060333c2ed207ee276dd318980 SHA256 dbcb798764827a0f74be738662ecb516705cf520330cd3d7b2640fdffa499eb2
+DIST coreutils-7.5-patches-2.tar.lzma 8370 RMD160 fef456359dd907c8264686720676ea1dabb90b63 SHA1 55f1b88bfeca34cd09c4ba305f6c0d45cfa3fd3f SHA256 1ee33146c960671f6cb54ca4916f6a828db904dae84841ec690eae7c0205e9a2
+DIST coreutils-7.5.tar.gz 9956013 RMD160 17785526e6820705aa5790454af1bd3d0d4104aa SHA1 97e1486a33bf42eb7686d8f131c80ab533f1f683 SHA256 341f49b9434f83ca9a8b6c2266813092ef08a5fca25f15dcc1a0ba82fc18c3c1
diff --git a/sys-apps/coreutils/coreutils-8.20.ebuild b/sys-apps/coreutils/coreutils-7.5-r1.ebuild
similarity index 64%
rename from sys-apps/coreutils/coreutils-8.20.ebuild
rename to sys-apps/coreutils/coreutils-7.5-r1.ebuild
index 670cd6e..a94e1e8 100644
--- a/sys-apps/coreutils/coreutils-8.20.ebuild
+++ b/sys-apps/coreutils/coreutils-7.5-r1.ebuild
@@ -1,47 +1,45 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/coreutils-8.20.ebuild,v 1.8 2012/12/08 19:40:53 vapier Exp $
-
-EAPI="3"
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/coreutils-7.5-r1.ebuild,v 1.3 2009/11/09 22:54:34 vapier Exp $
 
 inherit eutils flag-o-matic toolchain-funcs
 
-PATCH_VER="1.1"
+PATCH_VER="2"
 DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
 HOMEPAGE="http://www.gnu.org/software/coreutils/"
-SRC_URI="mirror://gnu-alpha/coreutils/${P}.tar.xz
-	mirror://gnu/${PN}/${P}.tar.xz
-	mirror://gentoo/${P}.tar.xz
-	mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
-	http://dev.gentoo.org/~ryao/dist/${P}-patches-${PATCH_VER}.tar.xz"
+SRC_URI="ftp://alpha.gnu.org/gnu/coreutils/${P}.tar.gz
+	mirror://gnu/${PN}/${P}.tar.gz
+	mirror://gentoo/${P}.tar.gz
+	mirror://gentoo/${P}-patches-${PATCH_VER}.tar.lzma
+	http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.lzma"
 
 LICENSE="GPL-3"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd"
-IUSE="acl caps gmp nls selinux static userland_BSD vanilla xattr"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="acl caps gmp nls selinux static vanilla xattr"
 
-LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
-	caps? ( sys-libs/libcap )
-	gmp? ( dev-libs/gmp[static-libs] )
-	xattr? ( !userland_BSD? ( sys-apps/attr[static-libs] ) )"
-RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
+RDEPEND="caps? ( sys-libs/libcap )
+	gmp? ( dev-libs/gmp )
 	selinux? ( sys-libs/libselinux )
+	acl? ( sys-apps/acl )
+	xattr? ( sys-apps/attr )
 	nls? ( >=sys-devel/gettext-0.15 )
-	!app-misc/realpath
 	!<sys-apps/util-linux-2.13
 	!sys-apps/stat
 	!net-mail/base64
 	!sys-apps/mktemp
 	!<app-forensics/tct-1.18-r1
 	!<net-fs/netatalk-2.0.3-r4
-	!<sci-chemistry/ccp4-6.1.1"
+	!<sci-chemistry/ccp4-6.1.1
+	>=sys-libs/ncurses-5.3-r5"
 DEPEND="${RDEPEND}
-	static? ( ${LIB_DEPEND} )
-	app-arch/xz-utils"
+	|| ( app-arch/xz-utils app-arch/lzma-utils )"
 
-src_prepare() {
+src_unpack() {
+	unpack ${A}
+	cd "${S}"
+
 	if ! use vanilla ; then
-		use_if_iuse unicode || rm -f "${WORKDIR}"/patch/000_all_coreutils-i18n.patch
 		EPATCH_SUFFIX="patch" \
 		PATCHDIR="${WORKDIR}/patch" \
 		EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \
@@ -54,33 +52,15 @@
 	# Also, it's not like we changed the usage on any of these things,
 	# so let's just update the timestamps and skip the help2man step.
 	set -- man/*.x
-	touch ${@/%x/1}
-
-	# Avoid perl dep for compiled in dircolors default #348642
-	if ! has_version dev-lang/perl ; then
-		touch src/dircolors.h
-		touch ${@/%x/1}
-	fi
+	tc-is-cross-compiler && touch ${@/%x/1}
 }
 
-src_configure() {
-	local myconf=''
-	if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
-		export fu_cv_sys_stat_statfs2_bsize=yes #311569
-		export gl_cv_func_realpath_works=yes #416629
-	fi
-
-	export gl_cv_func_mknod_works=yes #409919
-	use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' configure #321821
-	use selinux || export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
-	use userland_BSD && myconf="${myconf} -program-prefix=g --program-transform-name=s/stat/nustat/"
+src_compile() {
+	use static && append-ldflags -static
 	# kill/uptime - procps
 	# groups/su   - shadow
 	# hostname    - net-tools
 	econf \
-		--with-packager="Gentoo" \
-		--with-packager-version="${PVR} (p${PATCH_VER:-0})" \
-		--with-packager-bug-reports="http://bugs.gentoo.org/" \
 		--enable-install-program="arch" \
 		--enable-no-install-program="groups,hostname,kill,su,uptime" \
 		--enable-largefile \
@@ -89,7 +69,8 @@
 		$(use_enable acl) \
 		$(use_enable xattr) \
 		$(use_with gmp) \
-		${myconf}
+		|| die "econf"
+	emake || die "emake"
 }
 
 src_test() {
@@ -163,15 +144,4 @@
 			rm -f "${ROOT}/bin/dircolors"
 		fi
 	fi
-
-	# Help out users using experimental filesystems
-	if grep -qs btrfs "${ROOT}"/etc/fstab /proc/mounts ; then
-		case $(uname -r) in
-		2.6.[12][0-9]|2.6.3[0-7]*)
-			ewarn "You are running a system with a buggy btrfs driver."
-			ewarn "Please upgrade your kernel to avoid silent corruption."
-			ewarn "See: https://bugs.gentoo.org/353907"
-			;;
-		esac
-	fi
 }