summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-process/psmisc
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-process/psmisc')
-rw-r--r--sys-process/psmisc/Manifest3
-rw-r--r--sys-process/psmisc/files/psmisc-22.16-fuser-pic.patch17
-rw-r--r--sys-process/psmisc/files/psmisc-22.20-selinux.patch263
-rw-r--r--sys-process/psmisc/files/psmisc-22.21-fuser_typo_fix.patch44
-rw-r--r--sys-process/psmisc/metadata.xml8
-rw-r--r--sys-process/psmisc/psmisc-22.16.ebuild56
-rw-r--r--sys-process/psmisc/psmisc-22.20.ebuild56
-rw-r--r--sys-process/psmisc/psmisc-22.21-r2.ebuild56
8 files changed, 503 insertions, 0 deletions
diff --git a/sys-process/psmisc/Manifest b/sys-process/psmisc/Manifest
new file mode 100644
index 000000000000..e2c163e4cc35
--- /dev/null
+++ b/sys-process/psmisc/Manifest
@@ -0,0 +1,3 @@
+DIST psmisc-22.16-r1.tar.gz 468223 SHA256 38ba34e9ddbfa755f9b7c54a4e1733e12d65121891dacda941f21d856ab41da8 SHA512 f6805f2fdd07f06a1f2ad70be065636a842dd73f4ec176b8173d7486d737561330a52392cf8712aa509fa303a174775a41a0fd73e89dad3a2958fa1d7e5b97f9 WHIRLPOOL 056dff216ac303e18af7fa1ed0a4fc97d91b701a7e69cce599079a13a478206107521d7fc2693eaca97c7c65c9417475c8c499b59a74f9d275a47afdd6a04254
+DIST psmisc-22.20.tar.gz 432501 SHA256 b17224e2385f6a799ffebba27eb7870771d42555e86814ef56b6d7e955765514 SHA512 5565163651c90afeb146c3305fddefc544bcd4cd5e98917fd57a9920e76c22e4bc0a197618539475a1410cfec9dd168b69983b2210a3ad9fc54368e9220503a6 WHIRLPOOL 97826e7d6d5def8a631a0726c3c1c8f67ab4f5f5b39e67d4a915f2741d8914b6c83d69293daacf25e92cef37990e1463ef7dc0843b47d5b0bfb1e3745fde669d
+DIST psmisc-22.21.tar.gz 457702 SHA256 97323cad619210845b696d7d722c383852b2acb5c49b5b0852c4f29c77a8145a SHA512 766aeb45687090b88b17176c5117a603e83fe92a13c013aea72c8ee80048adf02e18c7daa52ddfb8b2135f7c9a1bcae38896cdfb8d0158728d85a446c5e0d5ae WHIRLPOOL cbd4af3e54ce01f43558184b57a24e44dfb6e05d8438bd11e2308ee62535bb93dc417b08e66603966cc5912d7fa88c29df1529995a42e2a8b7c3da663b01681f
diff --git a/sys-process/psmisc/files/psmisc-22.16-fuser-pic.patch b/sys-process/psmisc/files/psmisc-22.16-fuser-pic.patch
new file mode 100644
index 000000000000..40a3c0c0d35f
--- /dev/null
+++ b/sys-process/psmisc/files/psmisc-22.16-fuser-pic.patch
@@ -0,0 +1,17 @@
+http://bugs.gentoo.org/401851
+http://sourceforge.net/tracker/?func=detail&aid=3504801&group_id=15273&atid=115273
+
+the x86 asm code is not PIC friendly, so disable it and fall back to the
+gcc builtin for doing prefetching
+
+--- src/lists.h
++++ src/lists.h
+@@ -68,7 +68,7 @@
+ asm volatile ("lfetch [%0]" :: "r" (x))
+ #elif defined(__powerpc64__)
+ asm volatile ("dcbt 0,%0" :: "r" (x))
+-#elif !defined(__CYGWIN__) && defined(__i386__)
++#elif !defined(__CYGWIN__) && !defined(__PIC__) && defined(__i386__)
+ asm volatile ("661:\n\t"
+ ".byte 0x8d,0x74,0x26,0x00\n"
+ "\n662:\n"
diff --git a/sys-process/psmisc/files/psmisc-22.20-selinux.patch b/sys-process/psmisc/files/psmisc-22.20-selinux.patch
new file mode 100644
index 000000000000..b4ac010ac8dc
--- /dev/null
+++ b/sys-process/psmisc/files/psmisc-22.20-selinux.patch
@@ -0,0 +1,263 @@
+From 89fa40f0a55096a62809e852244d7db3f445b0cd Mon Sep 17 00:00:00 2001
+From: Craig Small <csmall@enc.com.au>
+Date: Sun, 7 Oct 2012 10:52:46 +1100
+Subject: [PATCH] pstree compiles with SE Linux
+
+pstree failed to compile with SE Linux enabled because one of the
+scontext was missed and without it enabled the bug doesn't appear.
+
+pstree is now re-worked so scontext is defined as a dummy meaning
+most of the code except the reall SE Linux specific stuff is compilied
+meaning this sort of thing shouldn't happen too much again.
+
+Bug-Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=437332
+Bug-Sourceforge: https://sourceforge.net/p/psmisc/bugs/54/
+---
+ src/pstree.c | 69 ++++++------------------------------------------------------
+ 1 file changed, 6 insertions(+), 63 deletions(-)
+
+diff --git a/src/pstree.c b/src/pstree.c
+index db57244..b9a01cf 100644
+--- a/src/pstree.c
++++ b/src/pstree.c
+@@ -47,6 +47,8 @@
+
+ #ifdef WITH_SELINUX
+ #include <selinux/selinux.h>
++#else
++typedef void* security_context_t; /* DUMMY to remove most ifdefs */
+ #endif /*WITH_SELINUX */
+
+ extern const char *__progname;
+@@ -81,9 +83,7 @@ typedef struct _proc {
+ pid_t pid;
+ pid_t pgid;
+ uid_t uid;
+-#ifdef WITH_SELINUX
+ security_context_t scontext;
+-#endif /*WITH_SELINUX */
+ char flags;
+ struct _child *children;
+ struct _proc *parent;
+@@ -131,16 +131,14 @@ static int *more = NULL;
+
+ static int print_args = 0, compact = 1, user_change = 0, pids = 0, pgids = 0,
+ show_parents = 0, by_pid = 0, trunc = 1, wait_end = 0;
+-#ifdef WITH_SELINUX
+ static int show_scontext = 0;
+-#endif /*WITH_SELINUX */
+ static int output_width = 132;
+ static int cur_x = 1;
+ static char last_char = 0;
+ static int dumped = 0; /* used by dump_by_user */
+ static int charlen = 0; /* length of character */
+
+-static void fix_orphans(void);
++static void fix_orphans(security_context_t scontext);
+ /*
+ * Allocates additional buffer space for width and more as needed.
+ * The first call will allocate the first buffer.
+@@ -229,15 +227,12 @@ static int out_int(int x)
+ return digits;
+ }
+
+-#ifdef WITH_SELINUX
+ static void out_scontext(security_context_t scontext)
+ {
+ out_string("`");
+ out_string(scontext);
+ out_string("'");
+ }
+-#endif /*WITH_SELINUX */
+-
+
+ static void out_newline(void)
+ {
+@@ -259,12 +254,8 @@ static PROC *find_proc(pid_t pid)
+ return NULL;
+ }
+
+-#ifdef WITH_SELINUX
+ static PROC *new_proc(const char *comm, pid_t pid, uid_t uid,
+ security_context_t scontext)
+-#else /*WITH_SELINUX */
+-static PROC *new_proc(const char *comm, pid_t pid, uid_t uid)
+-#endif /*WITH_SELINUX */
+ {
+ PROC *new;
+
+@@ -279,9 +270,7 @@ static PROC *new_proc(const char *comm, pid_t pid, uid_t uid)
+ new->flags = 0;
+ new->argc = 0;
+ new->argv = NULL;
+-#ifdef WITH_SELINUX
+ new->scontext = scontext;
+-#endif /*WITH_SELINUX */
+ new->children = NULL;
+ new->parent = NULL;
+ new->next = list;
+@@ -364,24 +353,14 @@ rename_proc(PROC *this, const char *comm, uid_t uid)
+ }
+ }
+ }
+-#ifdef WITH_SELINUX
+ static void
+ add_proc(const char *comm, pid_t pid, pid_t ppid, pid_t pgid, uid_t uid,
+ const char *args, int size, char isthread, security_context_t scontext)
+-#else /*WITH_SELINUX */
+-static void
+-add_proc(const char *comm, pid_t pid, pid_t ppid, pid_t pgid, uid_t uid,
+- const char *args, int size, char isthread)
+-#endif /*WITH_SELINUX */
+ {
+ PROC *this, *parent;
+
+ if (!(this = find_proc(pid)))
+-#ifdef WITH_SELINUX
+ this = new_proc(comm, pid, uid, scontext);
+-#else /*WITH_SELINUX */
+- this = new_proc(comm, pid, uid);
+-#endif /*WITH_SELINUX */
+ else {
+ rename_proc(this, comm, uid);
+ }
+@@ -393,11 +372,7 @@ add_proc(const char *comm, pid_t pid, pid_t ppid, pid_t pgid, uid_t uid,
+ if (isthread)
+ this->flags |= PFLAG_THREAD;
+ if (!(parent = find_proc(ppid))) {
+-#ifdef WITH_SELINUX
+ parent = new_proc("?", ppid, 0, scontext);
+-#else /*WITH_SELINUX */
+- parent = new_proc("?", ppid, 0);
+-#endif
+ }
+ if (pid != 0) {
+ add_child(parent, this);
+@@ -494,12 +469,10 @@ dump_tree(PROC * current, int level, int rep, int leaf, int last,
+ else
+ (void) out_int(current->uid);
+ }
+-#ifdef WITH_SELINUX
+ if (show_scontext) {
+ out_char(info++ ? ',' : '(');
+ out_scontext(current->scontext);
+ }
+-#endif /*WITH_SELINUX */
+ if ((swapped && print_args && current->argc < 0) || (!swapped && info))
+ out_char(')');
+ if ((current->flags & PFLAG_HILIGHT) && (tmp = tgetstr("me", NULL)))
+@@ -520,11 +493,7 @@ dump_tree(PROC * current, int level, int rep, int leaf, int last,
+ }
+ }
+ }
+-#ifdef WITH_SELINUX
+ if (show_scontext || print_args || !current->children)
+-#else /*WITH_SELINUX */
+- if (print_args || !current->children)
+-#endif /*WITH_SELINUX */
+ {
+ while (closing--)
+ out_char(']');
+@@ -533,11 +502,7 @@ dump_tree(PROC * current, int level, int rep, int leaf, int last,
+ ensure_buffer_capacity(level);
+ more[level] = !last;
+
+-#ifdef WITH_SELINUX
+ if (show_scontext || print_args)
+-#else /*WITH_SELINUX */
+- if (print_args)
+-#endif /*WITH_SELINUX */
+ {
+ width[level] = swapped + (comm_len > 1 ? 0 : -1);
+ count=0;
+@@ -653,8 +618,8 @@ static void read_proc(void)
+ pid_t pid, ppid, pgid;
+ int fd, size;
+ int empty;
+-#ifdef WITH_SELINUX
+ security_context_t scontext = NULL;
++#ifdef WITH_SELINUX
+ int selinux_enabled = is_selinux_enabled() > 0;
+ #endif /*WITH_SELINUX */
+
+@@ -726,21 +691,12 @@ static void read_proc(void)
+ while ((dt = readdir(taskdir)) != NULL) {
+ if ((thread = atoi(dt->d_name)) != 0) {
+ if (thread != pid) {
+-#ifdef WITH_SELINUX
+ if (print_args)
+ add_proc(threadname, thread, pid, pgid, st.st_uid,
+ threadname, strlen (threadname) + 1, 1,scontext);
+ else
+ add_proc(threadname, thread, pid, pgid, st.st_uid,
+ NULL, 0, 1, scontext);
+-#else /*WITH_SELINUX */
+- if (print_args)
+- add_proc(threadname, thread, pid, pgid, st.st_uid,
+- threadname, strlen (threadname) + 1, 1);
+- else
+- add_proc(threadname, thread, pid, pgid, st.st_uid,
+- NULL, 0, 1);
+-#endif /*WITH_SELINUX */
+ }
+ }
+ }
+@@ -749,11 +705,7 @@ static void read_proc(void)
+ }
+ free(taskpath);
+ if (!print_args)
+-#ifdef WITH_SELINUX
+ add_proc(comm, pid, ppid, pgid, st.st_uid, NULL, 0, 0, scontext);
+-#else /*WITH_SELINUX */
+- add_proc(comm, pid, ppid, pgid, st.st_uid, NULL, 0, 0);
+-#endif /*WITH_SELINUX */
+ else {
+ sprintf(path, "%s/%d/cmdline", PROC_BASE, pid);
+ if ((fd = open(path, O_RDONLY)) < 0) {
+@@ -770,13 +722,8 @@ static void read_proc(void)
+ size--;
+ if (size)
+ buffer[size++] = 0;
+-#ifdef WITH_SELINUX
+ add_proc(comm, pid, ppid, pgid, st.st_uid,
+ buffer, size, 0, scontext);
+-#else /*WITH_SELINUX */
+- add_proc(comm, pid, ppid, pgid, st.st_uid,
+- buffer, size, 0);
+-#endif /*WITH_SELINUX */
+ }
+ }
+ }
+@@ -787,7 +734,7 @@ static void read_proc(void)
+ }
+ }
+ (void) closedir(dir);
+- fix_orphans();
++ fix_orphans(scontext);
+ if (print_args)
+ free(buffer);
+ if (empty) {
+@@ -796,7 +743,7 @@ static void read_proc(void)
+ }
+ }
+
+-static void fix_orphans(void)
++static void fix_orphans(security_context_t scontext)
+ {
+ /* When using kernel 3.3 with hidepid feature enabled on /proc
+ * then we need fake root pid and gather all the orphan processes
+@@ -807,11 +754,7 @@ static void fix_orphans(void)
+ PROC *root, *walk;
+
+ if (!(root = find_proc(ROOT_PID))) {
+-#ifdef WITH_SELINUX
+ root = new_proc("?", ROOT_PID, 0, scontext);
+-#else /*WITH_SELINUX */
+- root = new_proc("?", ROOT_PID, 0);
+-#endif
+ }
+ for (walk = list; walk; walk = walk->next) {
+ if (walk->pid == 1 || walk->pid == 0)
+--
+1.7.12
+
diff --git a/sys-process/psmisc/files/psmisc-22.21-fuser_typo_fix.patch b/sys-process/psmisc/files/psmisc-22.21-fuser_typo_fix.patch
new file mode 100644
index 000000000000..5c5fd990f9ca
--- /dev/null
+++ b/sys-process/psmisc/files/psmisc-22.21-fuser_typo_fix.patch
@@ -0,0 +1,44 @@
+From 3638cc55b4d08851faba46635d737b24d016665b Mon Sep 17 00:00:00 2001
+From: Brad Jorsch <anomie@users.sourceforge.net>
+Date: Fri, 28 Feb 2014 21:55:02 +1100
+Subject: [PATCH] Typo in fuser makes -M on all the time
+
+Brad found that fuser had the -M option on all the time.
+A simple but significant typo caused this, thanks the the patch.
+
+Bug-Debian: http://bugs.debian.org/740275
+
+Signed-off-by: Craig Small <csmall@enc.com.au>
+---
+ ChangeLog | 4 ++++
+ src/fuser.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index fd1cccf..e5f784c 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++Changes in 22.22
++================
++ * Fixed typo in fuser which has -M on Debian #740275
++
+ Changes in 22.21
+ ================
+ * Missing comma in fuser(1) added Debian #702391
+diff --git a/src/fuser.c b/src/fuser.c
+index b485f65..389b302 100644
+--- a/src/fuser.c
++++ b/src/fuser.c
+@@ -1174,7 +1174,7 @@ int main(int argc, char *argv[])
+ usage(_("No process specification given"));
+
+ /* Check if -M flag was used and if so check mounts */
+- if (opts * OPT_ISMOUNTPOINT) {
++ if (opts & OPT_ISMOUNTPOINT) {
+ check_mountpoints(&mounts, &names_head, &names_tail);
+ }
+
+--
+2.2.2
+
diff --git a/sys-process/psmisc/metadata.xml b/sys-process/psmisc/metadata.xml
new file mode 100644
index 000000000000..8be3e0d684ec
--- /dev/null
+++ b/sys-process/psmisc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <upstream>
+ <remote-id type="sourceforge">psmisc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-process/psmisc/psmisc-22.16.ebuild b/sys-process/psmisc/psmisc-22.16.ebuild
new file mode 100644
index 000000000000..162bdec84980
--- /dev/null
+++ b/sys-process/psmisc/psmisc-22.16.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="A set of tools that use the proc filesystem"
+HOMEPAGE="http://psmisc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/psmisc/${P}.tar.gz -> ${P}-r1.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~ia64-linux ~x86-linux"
+IUSE="ipv6 nls selinux X"
+
+RDEPEND=">=sys-libs/ncurses-5.7-r7
+ nls? ( virtual/libintl )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2.2.6b
+ nls? ( sys-devel/gettext )"
+
+DOCS="AUTHORS ChangeLog NEWS README"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-22.16-fuser-pic.patch #394443
+}
+
+src_configure() {
+ econf \
+ $(use_enable selinux) \
+ --disable-harden-flags \
+ $(use_enable ipv6) \
+ $(use_enable nls)
+}
+
+src_compile() {
+ # peekfd is a fragile crap hack #330631
+ nonfatal emake -C src peekfd || touch src/peekfd{.o,}
+ emake
+}
+
+src_install() {
+ default
+
+ use X || rm -f "${ED}"/usr/bin/pstree.x11
+
+ [[ -s ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/bin/peekfd
+ [[ -e ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/share/man/man1/peekfd.1
+
+ # fuser is needed by init.d scripts
+ dodir /bin
+ mv "${ED}"/usr/bin/fuser "${ED}"/bin || die
+}
diff --git a/sys-process/psmisc/psmisc-22.20.ebuild b/sys-process/psmisc/psmisc-22.20.ebuild
new file mode 100644
index 000000000000..21d2d44ee9df
--- /dev/null
+++ b/sys-process/psmisc/psmisc-22.20.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="A set of tools that use the proc filesystem"
+HOMEPAGE="http://psmisc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="ipv6 nls selinux X"
+
+RDEPEND=">=sys-libs/ncurses-5.7-r7
+ nls? ( virtual/libintl )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2.2.6b
+ nls? ( sys-devel/gettext )"
+
+DOCS="AUTHORS ChangeLog NEWS README"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-selinux.patch #437332
+}
+
+src_configure() {
+ econf \
+ $(use_enable selinux) \
+ --disable-harden-flags \
+ $(use_enable ipv6) \
+ $(use_enable nls)
+}
+
+src_compile() {
+ # peekfd is a fragile crap hack #330631
+ nonfatal emake -C src peekfd || touch src/peekfd{.o,}
+ emake
+}
+
+src_install() {
+ default
+
+ use X || rm -f "${ED}"/usr/bin/pstree.x11
+
+ [[ -s ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/bin/peekfd
+ [[ -e ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/share/man/man1/peekfd.1
+
+ # fuser is needed by init.d scripts; use * wildcard for #458250
+ dodir /bin
+ mv "${ED}"/usr/bin/*fuser "${ED}"/bin || die
+}
diff --git a/sys-process/psmisc/psmisc-22.21-r2.ebuild b/sys-process/psmisc/psmisc-22.21-r2.ebuild
new file mode 100644
index 000000000000..febfaa74edee
--- /dev/null
+++ b/sys-process/psmisc/psmisc-22.21-r2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="A set of tools that use the proc filesystem"
+HOMEPAGE="http://psmisc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="ipv6 nls selinux X"
+
+RDEPEND=">=sys-libs/ncurses-5.7-r7
+ nls? ( virtual/libintl )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2.2.6b
+ nls? ( sys-devel/gettext )"
+
+DOCS="AUTHORS ChangeLog NEWS README"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-fuser_typo_fix.patch"
+}
+
+src_configure() {
+ econf \
+ $(use_enable selinux) \
+ --disable-harden-flags \
+ $(use_enable ipv6) \
+ $(use_enable nls)
+}
+
+src_compile() {
+ # peekfd is a fragile crap hack #330631
+ nonfatal emake -C src peekfd || touch src/peekfd{.o,}
+ emake
+}
+
+src_install() {
+ default
+
+ use X || rm -f "${ED}"/usr/bin/pstree.x11
+
+ [[ -s ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/bin/peekfd
+ [[ -e ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/share/man/man1/peekfd.1
+
+ # fuser is needed by init.d scripts; use * wildcard for #458250
+ dodir /bin
+ mv "${ED}"/usr/bin/*fuser "${ED}"/bin || die
+}