mtools: upgraded package to upstream

Upgraded sys-fs/mtools to version 4.0.23 for all.
This includes a runtime locking fix.
Upstream has integrated our patches, and fix a timing error in the lock
logic.  Upgrade to get them all.

This is needed to fix build_image failure by syslinux on old branches.

BUG=chromium:953993
TEST=precq is happy

Change-Id: I8459371fce2ba6386362eb57ec8268687d26b976
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/1589395
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
(cherry picked from commit 4660e27bf817c340061bcbbfb58ef639cb8b3472)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/1596325
diff --git a/sys-fs/mtools/Manifest b/sys-fs/mtools/Manifest
index 577556d..0156d84 100644
--- a/sys-fs/mtools/Manifest
+++ b/sys-fs/mtools/Manifest
@@ -1 +1 @@
-DIST mtools-4.0.15.tar.bz2 386339 RMD160 a5b06e65e1d1772dcb88cb88d8a0e34f82261828 SHA1 c7d6864832522ade5a921d870b1a27d11b6e12e1 SHA256 290defca107cc183a17c98d3f7d00db02228b724084a2a818f1dd6ea86973899
+DIST mtools-4.0.23.tar.bz2 418592 BLAKE2B 442f552087a5d53ef0ead6161cdad7997dc45a3e210c2cb442a8b2ba42866152f93e4a1f5b58df8d68316168374ea034b390bcf4c607ac3a1c477c4ec5e7842c SHA512 c8c48adedc3f3e4eeafead27ce80172c9cb9690b575618842001ed16aa0011dcd2bc517882ea4bf01a73810ba151aa4b86f8ce2f97d6e8a0177d09be71a6d1ed
\ No newline at end of file
diff --git a/sys-fs/mtools/metadata.xml b/sys-fs/mtools/metadata.xml
index 96a2d58..56c1244 100644
--- a/sys-fs/mtools/metadata.xml
+++ b/sys-fs/mtools/metadata.xml
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-<herd>base-system</herd>
+<maintainer type="project">
+	<email>base-system@gentoo.org</email>
+	<name>Gentoo Base System</name>
+</maintainer>
 </pkgmetadata>
diff --git a/sys-fs/mtools/mtools-4.0.15.ebuild b/sys-fs/mtools/mtools-4.0.15.ebuild
deleted file mode 100644
index 59d100d..0000000
--- a/sys-fs/mtools/mtools-4.0.15.ebuild
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/mtools/mtools-4.0.15.ebuild,v 1.8 2011/06/19 16:59:24 armin76 Exp $
-
-EAPI="2"
-
-inherit autotools
-
-DESCRIPTION="utilities to access MS-DOS disks from Unix without mounting them"
-HOMEPAGE="http://mtools.linux.lu/"
-SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="*"
-IUSE="X"
-
-DEPEND="
-	X? (
-		x11-libs/libICE
-		x11-libs/libXau
-		x11-libs/libSM
-		x11-libs/libX11
-		x11-libs/libXt
-	)"
-RDEPEND="${DEPEND}"
-
-src_prepare() {
-	eautoconf #341443
-}
-
-src_configure() {
-	econf \
-		--sysconfdir=/etc/mtools \
-		$(use_with X x)
-}
-
-src_install() {
-	emake -j1 DESTDIR="${D}" install || die
-	insinto /etc/mtools
-	doins mtools.conf || die
-	dosed '/^SAMPLE FILE$/s:^:#:' /etc/mtools/mtools.conf # default is fine
-	dodoc README* Release.notes
-}
diff --git a/sys-fs/mtools/mtools-4.0.23.ebuild b/sys-fs/mtools/mtools-4.0.23.ebuild
new file mode 100644
index 0000000..8ea3081
--- /dev/null
+++ b/sys-fs/mtools/mtools-4.0.23.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit flag-o-matic
+
+DESCRIPTION="utilities to access MS-DOS disks from Unix without mounting them"
+HOMEPAGE="https://www.gnu.org/software/mtools/ https://savannah.gnu.org/projects/mtools"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="*"
+IUSE="X elibc_glibc"
+
+RDEPEND="
+	!elibc_glibc? ( virtual/libiconv )
+	X? (
+		x11-libs/libICE
+		x11-libs/libXau
+		x11-libs/libSM
+		x11-libs/libX11
+		x11-libs/libXt
+	)"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+	default
+
+	# Don't throw errors on existing directories
+	sed -i -e "s:mkdir:mkdir -p:" mkinstalldirs || die
+}
+
+src_configure() {
+	# 447688
+	use !elibc_glibc && use !elibc_musl && append-libs "-liconv"
+	local myeconfargs=(
+		--sysconfdir="${EPREFIX%/}"/etc/mtools
+		$(use_with X x)
+	)
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	local -a DOCS=( README* Release.notes )
+	default
+
+	insinto /etc/mtools
+	doins mtools.conf
+
+	# default is fine
+	sed -i -e '/^SAMPLE FILE$/s:^:#:' "${ED%/}"/etc/mtools/mtools.conf || die
+}