summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-10-05 23:26:57 +0000
committerMike Frysinger <vapier@gentoo.org>2007-10-05 23:26:57 +0000
commit5d652a469e1b5e822759a5a6279435e3b4c82935 (patch)
treef57dc437dfeef056c0086907f2d20302778de452 /sys-apps/util-linux
parentVersion bump to 0.6.5069 (diff)
downloadgentoo-2-5d652a469e1b5e822759a5a6279435e3b4c82935.tar.gz
gentoo-2-5d652a469e1b5e822759a5a6279435e3b4c82935.tar.bz2
gentoo-2-5d652a469e1b5e822759a5a6279435e3b4c82935.zip
Add fix from upstream for `script` breakage with SIGWINCH #191452 by Eric Augustus. Add security fix from upstream. Fix from Petr Pisar for swap on cryptoloop #182031. Add by in loop-aes support via USE=crypt #193088 by Hank Leininger and Alon Bar-Lev.
(Portage version: 2.1.3.11)
Diffstat (limited to 'sys-apps/util-linux')
-rw-r--r--sys-apps/util-linux/ChangeLog19
-rwxr-xr-xsys-apps/util-linux/files/crypto-loop.initd4
-rw-r--r--sys-apps/util-linux/files/digest-util-linux-2.12r-r812
-rw-r--r--sys-apps/util-linux/files/digest-util-linux-2.13-r26
-rw-r--r--sys-apps/util-linux/files/util-linux-2.13-script-SIGWINCH.patch56
-rw-r--r--sys-apps/util-linux/files/util-linux-2.13-setuid-checks.patch52
-rw-r--r--sys-apps/util-linux/util-linux-2.12r-r8.ebuild208
-rw-r--r--sys-apps/util-linux/util-linux-2.13-r2.ebuild88
8 files changed, 442 insertions, 3 deletions
diff --git a/sys-apps/util-linux/ChangeLog b/sys-apps/util-linux/ChangeLog
index ed74d03e02e3..d03d749b07f2 100644
--- a/sys-apps/util-linux/ChangeLog
+++ b/sys-apps/util-linux/ChangeLog
@@ -1,6 +1,23 @@
# ChangeLog for sys-apps/util-linux
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.202 2007/09/04 00:12:44 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.203 2007/10/05 23:26:56 vapier Exp $
+
+*util-linux-2.13-r2 (05 Oct 2007)
+
+ 05 Oct 2007; Mike Frysinger <vapier@gentoo.org>
+ +files/util-linux-2.13-script-SIGWINCH.patch,
+ +files/util-linux-2.13-setuid-checks.patch, files/crypto-loop.initd,
+ +util-linux-2.13-r2.ebuild:
+ Add fix from upstream for `script` breakage with SIGWINCH #191452 by
+ Eric Augustus. Add security fix from upstream. Fix from Petr Pisar
+ for swap on cryptoloop #182031. Add by in loop-aes support via USE=crypt
+ #193088 by Hank Leininger and Alon Bar-Lev.
+
+*util-linux-2.12r-r8 (05 Oct 2007)
+
+ 05 Oct 2007; Mike Frysinger <vapier@gentoo.org>
+ +files/util-linux-2.13-setuid-checks.patch, +util-linux-2.12r-r8.ebuild:
+ Add security fix from upstream.
04 Sep 2007; Mike Frysinger <vapier@gentoo.org>
+files/util-linux-2.13-ioprio-syscalls.patch, util-linux-2.13-r1.ebuild:
diff --git a/sys-apps/util-linux/files/crypto-loop.initd b/sys-apps/util-linux/files/crypto-loop.initd
index ff5f63b0f97d..21e0ef9525b0 100755
--- a/sys-apps/util-linux/files/crypto-loop.initd
+++ b/sys-apps/util-linux/files/crypto-loop.initd
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/files/crypto-loop.initd,v 1.1 2005/04/29 23:54:25 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/files/crypto-loop.initd,v 1.2 2007/10/05 23:26:57 vapier Exp $
depend() {
need checkroot modules
@@ -51,7 +51,7 @@ stop() {
for loop in $(ls /dev/loop[0-9]) ; do
losetup ${loop} &> /dev/null
if [[ $? == 0 ]] ; then
- umount ${loop} &>/dev/null
+ umount ${loop} &>/dev/null || swapoff "${loop}" &>/dev/null
if ! /sbin/losetup -d ${loop} &> /dev/null ; then
ewarn "Failure deconfiguring ${loop}."
status=1
diff --git a/sys-apps/util-linux/files/digest-util-linux-2.12r-r8 b/sys-apps/util-linux/files/digest-util-linux-2.12r-r8
new file mode 100644
index 000000000000..91a63b37ea77
--- /dev/null
+++ b/sys-apps/util-linux/files/digest-util-linux-2.12r-r8
@@ -0,0 +1,12 @@
+MD5 1020b93d723f1d573bacfe4a3362fc25 loop-AES-v3.1f.tar.bz2 173423
+RMD160 7490e3d90727621fde3052fd1747af338518b158 loop-AES-v3.1f.tar.bz2 173423
+SHA256 f744f3dd74b554d1a2e3788752c4a63049647bfd2bae71d9fff2427c0e175ca7 loop-AES-v3.1f.tar.bz2 173423
+MD5 dee120b17425e1edf0a0c64f0e249c20 util-linux-2.12i-cryptoapi-losetup.patch.bz2 4800
+RMD160 82e54aedd691aa93b67de9dfb9049a3f012a29f7 util-linux-2.12i-cryptoapi-losetup.patch.bz2 4800
+SHA256 565a0cc6c3c148a66969276ae9d34dc34f19fbd45df2740343793ee067b3700f util-linux-2.12i-cryptoapi-losetup.patch.bz2 4800
+MD5 6e0deccf97db98d2ae751577d019efa4 util-linux-2.12i.tar.gz 1975468
+RMD160 f055a94ad247dc59293f7b933c12bdda135159fc util-linux-2.12i.tar.gz 1975468
+SHA256 28e2fc70d7507e158d8861c958461aef1c4bbf4157a8ebbc237943944e5a8c4a util-linux-2.12i.tar.gz 1975468
+MD5 af9d9e03038481fbf79ea3ac33f116f9 util-linux-2.12r.tar.bz2 1370907
+RMD160 51950aafd5cbcb574e69fbd6b28d15a106147e64 util-linux-2.12r.tar.bz2 1370907
+SHA256 b8e499b338ce9fbd1fb315194b26540ec823c0afc46c9e145ac7a3e38ad57e6b util-linux-2.12r.tar.bz2 1370907
diff --git a/sys-apps/util-linux/files/digest-util-linux-2.13-r2 b/sys-apps/util-linux/files/digest-util-linux-2.13-r2
new file mode 100644
index 000000000000..35f8c626232c
--- /dev/null
+++ b/sys-apps/util-linux/files/digest-util-linux-2.13-r2
@@ -0,0 +1,6 @@
+MD5 601caadc3248fcd6b5911fc6339451e9 util-linux-ng-2.13-1.diff.bz2 40468
+RMD160 defb0fa7abb39963d1d168c4fbf8352ceb2a916c util-linux-ng-2.13-1.diff.bz2 40468
+SHA256 6606666808f510cc8aeead408e14d3226b06219b0752ca3badea7acd154929cd util-linux-ng-2.13-1.diff.bz2 40468
+MD5 2175a6e64ba0cf8ff05402eaee33e4b0 util-linux-ng-2.13.tar.bz2 2702618
+RMD160 499b1c5c2060b23d8bf504122a22122af99eb7fa util-linux-ng-2.13.tar.bz2 2702618
+SHA256 002412e93d8e85b1796fdbe65bbb0a4d193d0317a7155fda4270667e08bdfbfc util-linux-ng-2.13.tar.bz2 2702618
diff --git a/sys-apps/util-linux/files/util-linux-2.13-script-SIGWINCH.patch b/sys-apps/util-linux/files/util-linux-2.13-script-SIGWINCH.patch
new file mode 100644
index 000000000000..e8ed571be2ee
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.13-script-SIGWINCH.patch
@@ -0,0 +1,56 @@
+commit 2b8bbb5fb0f024ea3917fedbbbaf0fab1c1f6555
+Author: Karel Zak <kzak@redhat.com>
+Date: Fri Oct 5 12:22:13 2007 +0200
+
+ script: dies on SIGWINCH
+
+ The "doinput" process doesn't make a difference between SIGWINCH and
+ SIGCHILD. This process also sends unnecessary SIGWINCH to child (the
+ signal is ignored by child). Fixed.
+
+ Signed-off-by: Karel Zak <kzak@redhat.com>
+
+diff --git a/misc-utils/script.c b/misc-utils/script.c
+index d3272df..3b957d8 100644
+--- a/misc-utils/script.c
++++ b/misc-utils/script.c
+@@ -99,6 +99,7 @@ int tflg = 0;
+ static char *progname;
+
+ int die;
++int resized;
+
+ static void
+ die_if_link(char *fn) {
+@@ -235,8 +236,14 @@ doinput() {
+ if (die == 0 && child && kill(child, 0) == -1 && errno == ESRCH)
+ die = 1;
+
+- while (die == 0 && (cc = read(0, ibuf, BUFSIZ)) > 0)
+- (void) write(master, ibuf, cc);
++ while (die == 0) {
++ if ((cc = read(0, ibuf, BUFSIZ)) > 0)
++ (void) write(master, ibuf, cc);
++ else if (cc == -1 && errno == EINTR && resized)
++ resized = 0;
++ else
++ break;
++ }
+
+ done();
+ }
+@@ -255,11 +262,10 @@ finish(int dummy) {
+
+ void
+ resize(int dummy) {
++ resized = 1;
+ /* transmit window change information to the child */
+ (void) ioctl(0, TIOCGWINSZ, (char *)&win);
+ (void) ioctl(slave, TIOCSWINSZ, (char *)&win);
+-
+- kill(child, SIGWINCH);
+ }
+
+ /*
+
+
diff --git a/sys-apps/util-linux/files/util-linux-2.13-setuid-checks.patch b/sys-apps/util-linux/files/util-linux-2.13-setuid-checks.patch
new file mode 100644
index 000000000000..a3758ddbd64d
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.13-setuid-checks.patch
@@ -0,0 +1,52 @@
+From: Ludwig Nussel <ludwig.nussel@suse.de>
+Date: Thu, 20 Sep 2007 12:57:20 +0000 (+0200)
+Subject: mount: doesn't drop privileges properly when calling helpers
+X-Git-Url: http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=ebbeb2c7ac1b00b6083905957837a271e80b187e
+
+mount: doesn't drop privileges properly when calling helpers
+
+{,u}mount calls setuid() and setgid() in the wrong order and doesn't checking
+the return value of set{u,g}id(() when running helpers like mount.nfs.
+
+Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+
+diff --git a/mount/mount.c b/mount/mount.c
+index 40699f3..5bc2b30 100644
+--- a/mount/mount.c
++++ b/mount/mount.c
+@@ -634,8 +634,12 @@ check_special_mountprog(const char *spec, const char *node, const char *type, in
+ char *oo, *mountargs[10];
+ int i = 0;
+
+- setuid(getuid());
+- setgid(getgid());
++ if(setgid(getgid()) < 0)
++ die(EX_FAIL, _("mount: cannot set group id: %s"), strerror(errno));
++
++ if(setuid(getuid()) < 0)
++ die(EX_FAIL, _("mount: cannot set user id: %s"), strerror(errno));
++
+ oo = fix_opts_string (flags, extra_opts, NULL);
+ mountargs[i++] = mountprog; /* 1 */
+ mountargs[i++] = (char *) spec; /* 2 */
+diff --git a/mount/umount.c b/mount/umount.c
+index b3100c9..3221619 100644
+--- a/mount/umount.c
++++ b/mount/umount.c
+@@ -102,8 +102,12 @@ check_special_umountprog(const char *spec, const char *node,
+ char *umountargs[8];
+ int i = 0;
+
+- setuid(getuid());
+- setgid(getgid());
++ if(setgid(getgid()) < 0)
++ die(EX_FAIL, _("umount: cannot set group id: %s"), strerror(errno));
++
++ if(setuid(getuid()) < 0)
++ die(EX_FAIL, _("umount: cannot set user id: %s"), strerror(errno));
++
+ umountargs[i++] = umountprog;
+ umountargs[i++] = xstrdup(node);
+ if (nomtab)
diff --git a/sys-apps/util-linux/util-linux-2.12r-r8.ebuild b/sys-apps/util-linux/util-linux-2.12r-r8.ebuild
new file mode 100644
index 000000000000..58939bcef263
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.12r-r8.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.12r-r8.ebuild,v 1.1 2007/10/05 23:26:56 vapier Exp $
+
+inherit eutils flag-o-matic toolchain-funcs
+
+OLD_CRYPT_VER=2.12i
+LOOP_AES_VER=3.1f
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+SRC_URI="mirror://kernel/linux/utils/${PN}/${P}.tar.bz2
+ old-crypt? (
+ mirror://kernel/linux/utils/${PN}/${PN}-${OLD_CRYPT_VER}.tar.gz
+ mirror://gentoo/util-linux-${OLD_CRYPT_VER}-cryptoapi-losetup.patch.bz2
+ )
+ crypt? ( http://loop-aes.sourceforge.net/loop-AES/loop-AES-v${LOOP_AES_VER}.tar.bz2 )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="crypt old-crypt nls static selinux perl"
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2
+ >=sys-fs/e2fsprogs-1.34
+ selinux? ( sys-libs/libselinux )
+ crypt? ( app-crypt/hashalot )
+ perl? ( dev-lang/perl )
+ amd64? ( sys-apps/setarch )
+ mips? ( sys-apps/setarch )
+ ppc? ( sys-apps/setarch )
+ ppc64? ( sys-apps/setarch )
+ sparc? ( sys-apps/setarch )
+ !sys-apps/more"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/os-headers"
+
+OLD_CRYPT_P=${WORKDIR}/${PN}-${OLD_CRYPT_VER}
+
+yesno() { useq $1 && echo yes || echo no; }
+
+src_unpack() {
+ unpack ${A}
+
+ # Old crypt support
+ if use old-crypt ; then
+ cd "${OLD_CRYPT_P}"
+ ewarn "You should update your system as USE=old-crypt"
+ ewarn "support will be dropped in future versions."
+ epatch "${WORKDIR}"/util-linux-${OLD_CRYPT_VER}-cryptoapi-losetup.patch
+ fi
+
+ cd "${S}"
+
+ sed -i '/LDFLAGS.*-s/d' configure #191112
+
+ # crypto support
+ use crypt && epatch "${WORKDIR}"/loop-AES-v${LOOP_AES_VER}/${P}.diff
+
+ # Fall back to cracklib if default words file doesnt exist #114416
+ epatch "${FILESDIR}"/${PN}-2.12r-cracklib-words.patch
+
+ # Fix rare failures with -j4 or higher
+ epatch "${FILESDIR}"/${PN}-2.11z-parallel-make.patch
+
+ # Fix -f usage with -a and in general
+ epatch "${FILESDIR}"/${PN}-2.12q-more-fake-checks-v2.patch
+
+ # Fix mtab updates with `mount --move /foo /bar` #104697
+ epatch "${FILESDIR}"/${PN}-2.12q-update-mtab-when-moving.patch
+
+ # Respect -n with -r and umount #98675
+ epatch "${FILESDIR}"/${PN}-2.12q-umount-dont-write-mtab-with-remount.patch
+
+ # A few fixes to beat update_mtab() into submission.
+ epatch "${FILESDIR}"/${PN}-2.12q-update_mtab-fixes.patch
+
+ # Use update_mtab() to avoid dups in mtab for 'mount -f'
+ epatch "${FILESDIR}"/${PN}-2.12q-use-update_mtab-for-fake.patch
+
+ # Fix unreadable df output when using devfs ... this check is kind of
+ # a hack, but whatever, the output isnt critical at all :P
+ [[ -e /dev/.devfsd ]] && epatch "${FILESDIR}"/no-symlink-resolve.patch
+
+ # Add the O option to agetty to display DNS domainname in the issue
+ # file, thanks to Marius Mauch <genone@genone.de>, bug #22275.
+ #
+ # NOTE: Removing this will break future baselayout, so PLEASE
+ # consult with me before doing so.
+ epatch "${FILESDIR}"/${PN}-2.11z-agetty-domainname-option.patch
+
+ # Fix french translation typo #75693
+ epatch "${FILESDIR}"/${PN}-2.12q-i18n-update.patch
+
+ # Add NFS4 support (kernel 2.5/2.6)
+ epatch "${FILESDIR}"/${PN}-2.12i-nfsv4.patch
+
+ # ignore managed/kudzu options #70873
+ epatch "${FILESDIR}"/${PN}-2.12i-ignore-managed.patch
+
+ # swapon gets confused by symlinks in /dev #69162
+ epatch "${FILESDIR}"/${PN}-2.12p-swapon-check-symlinks.patch
+
+ # fix simple buffer overflow (from Debian)
+ epatch "${FILESDIR}"/${PN}-2.12q-debian-10cfdisk.patch
+
+ # don't build fdisk on m68k
+ epatch "${FILESDIR}"/${PN}-2.12q-no-m68k-fdisk.patch
+
+ # don't force umask to 022 #93671
+ epatch "${FILESDIR}"/${PN}-2.12q-dont-umask.patch
+
+ # fix cal display when using featureless terminals #112406
+ epatch "${FILESDIR}"/${PN}-2.12r-cal-dumb-terminal.patch
+
+ # Bug #108988 unable to always seek when omiting frame pointers
+ epatch "${FILESDIR}"/${PN}-2.12r-fdisk-frame-pointers.patch
+
+ # don't treat sparc/arm specially
+ epatch "${FILESDIR}"/${PN}-2.12r-umount-no-special.patch
+
+ # Patches from Fedora
+ epatch "${FILESDIR}"/${PN}-2.12r-umount-nosysfs.patch
+
+ # fix mips n32 (no llseek syscall)
+ epatch "${FILESDIR}"/${PN}-2.12-mips-lseek.patch
+
+ epatch "${FILESDIR}"/${PN}-2.13-setuid-checks.patch
+ epatch "${FILESDIR}"/${PN}-2.12r-no-_syscall.patch #150852
+ epatch "${FILESDIR}"/${PN}-2.12r-HAVE_asm_page_h.patch #168278
+ use crypt && epatch "${FILESDIR}"/${PN}-2.12r-HAVE_asm_page_h-loop-aes.patch
+
+ # Enable random features
+ local mconfigs="MCONFIG"
+ use old-crypt && mconfigs="${mconfigs} ${OLD_CRYPT_P}/MCONFIG"
+ sed -i \
+ -e "/^HAVE_SELINUX=/s:no:$(yesno selinux):" \
+ -e "/^DISABLE_NLS=/s:no:$(yesno !nls):" \
+ -e "/^HAVE_KILL=/s:no:yes:" \
+ -e "/^HAVE_SLN=/s:no:yes:" \
+ -e "/^HAVE_TSORT/s:no:yes:" \
+ -e "s:-pipe -O2 \$(CPUOPT) -fomit-frame-pointer:${CFLAGS}:" \
+ -e "s:CPU=.*:CPU=${CHOST%%-*}:" \
+ -e "s:SUIDMODE=.*4755:SUIDMODE=4711:" \
+ ${mconfigs} || die "MCONFIG sed"
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ export CC="$(tc-getCC)"
+
+ econf || die "configure failed"
+ emake || die "emake failed"
+
+ cd partx
+ has_version '>=sys-kernel/linux-headers-2.6' && \
+ has_version '<sys-kernel/linux-headers-2.6.18' \
+ && append-flags -include linux/compiler.h
+ emake CFLAGS="${CFLAGS}" || die "make partx failed"
+
+ if use old-crypt ; then
+ cd "${OLD_CRYPT_P}"
+ econf || die "old configure failed"
+ emake -C lib || die "old lib failed"
+ emake -C mount losetup mount || die "old make failed"
+ fi
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die "install failed"
+ dosym ../man8/agetty.8 /usr/share/man/man1/getty.1
+ dosbin partx/{addpart,delpart,partx} || die "dosbin"
+ use perl || rm -f "${D}"/usr/bin/chkdupexe
+ # required by autotools
+ dosym /bin/arch /usr/bin/arch
+
+ if use crypt || use old-crypt ; then
+ newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop
+ newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop
+ fi
+
+ # man-pages installs renice(1p) but util-linux does renice(8)
+ dosym ../man8/renice.8 /usr/share/man/man1/renice.1
+ # nfs-utils provides nfs(5) now
+ rm "${D}"/usr/share/man/man5/nfs.5 || die
+
+ dodoc HISTORY MAINTAINER README VERSION
+ docinto examples
+ dodoc example.files/*
+
+ if use old-crypt ; then
+ cd "${OLD_CRYPT_P}"/mount
+ into /
+ newbin mount mount-old-crypt || die
+ newbin losetup losetup-old-crypt || die
+ fperms 4711 /bin/{mount,losetup}-old-crypt
+ fi
+}
+
+pkg_postinst() {
+ if ! use old-crypt && use crypt ; then
+ ewarn "This version of util-linux includes crypto support"
+ ewarn "for loop-aes instead of the old cryptoapi."
+ ewarn "If you need the older support, please re-emerge"
+ ewarn "util-linux with USE=old-crypt. This will create"
+ ewarn "/sbin/mount-old-crypt and /sbin/losetup-old-crypt."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.13-r2.ebuild b/sys-apps/util-linux/util-linux-2.13-r2.ebuild
new file mode 100644
index 000000000000..1795343829fb
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.13-r2.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.13-r2.ebuild,v 1.1 2007/10/05 23:26:56 vapier Exp $
+
+EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git"
+inherit eutils
+[[ ${PV} == "9999" ]] && inherit git
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-ng-${MY_PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux-ng/"
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+else
+ SRC_URI="http://www.kernel.org/pub/linux/utils/util-linux-ng/v${PV:0:4}/${MY_P}.tar.bz2
+ crypt? ( http://loop-aes.sourceforge.net/updates/${MY_P}-1.diff.bz2 )"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="crypt nls old-linux selinux"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ >=sys-libs/ncurses-5.2-r2
+ >=sys-fs/e2fsprogs-1.34
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/os-headers"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git_src_unpack
+ cd "${S}"
+ ./autogen.sh || die
+ else
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-locale.patch #191111
+ epatch "${FILESDIR}"/${P}-ioprio-syscalls.patch #190613
+ epatch "${FILESDIR}"/${P}-setuid-checks.patch
+ epatch "${FILESDIR}"/${P}-script-SIGWINCH.patch #191452
+ use crypt && epatch "${WORKDIR}"/${MY_P}-1.diff
+ sed -i '/#include <asm\/page.h>/d' mount/swapon.c || die
+ fi
+}
+
+src_compile() {
+ export localedir="/usr/share/locale" #190895
+ econf \
+ --with-fsprobe=blkid \
+ $(use_enable nls) \
+ --enable-agetty \
+ --enable-cramfs \
+ $(use_enable old-linux elvtune) \
+ --disable-init \
+ --disable-kill \
+ --disable-last \
+ --disable-mesg \
+ --enable-partx \
+ --enable-raw \
+ --enable-rdev \
+ --enable-rename \
+ --disable-reset \
+ --disable-login-utils \
+ --enable-schedutils \
+ --disable-wall \
+ --enable-write \
+ --without-pam \
+ $(use_with selinux) \
+ || die "configure failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "install failed"
+ dodoc AUTHORS NEWS README* TODO docs/*
+
+ if use crypt ; then
+ newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop || die
+ newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop || die
+ fi
+}