summaryrefslogtreecommitdiff
path: root/sys-process/lsof
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-process/lsof
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-process/lsof')
-rw-r--r--sys-process/lsof/Manifest12
-rw-r--r--sys-process/lsof/files/lsof-4.85-cross.patch37
-rw-r--r--sys-process/lsof/files/lsof-4.88-linux.dnode.c.patch21
-rw-r--r--sys-process/lsof/lsof-4.87-r1.ebuild96
-rw-r--r--sys-process/lsof/lsof-4.88-r1.ebuild101
-rw-r--r--sys-process/lsof/lsof-4.89-r1.ebuild105
-rw-r--r--sys-process/lsof/lsof-4.89.ebuild101
-rw-r--r--sys-process/lsof/metadata.xml11
8 files changed, 484 insertions, 0 deletions
diff --git a/sys-process/lsof/Manifest b/sys-process/lsof/Manifest
new file mode 100644
index 000000000000..7e91f15e6db7
--- /dev/null
+++ b/sys-process/lsof/Manifest
@@ -0,0 +1,12 @@
+AUX lsof-4.85-cross.patch 1061 SHA256 3bd94ea0d47e01626c3c6e7bbf4b25245cb221d8700194f01e93e264903abd60 SHA512 9326a2708910a39ba3b81253c21149f8e4fa44b207e4c2a88f86c9322d2b50e6360760fcb13e00f644aba57ad207106c280db00ebc2d1f3d49405b54681548e8 WHIRLPOOL 900bb6f38c83405e9315894af570669d96d2bbcd6240dbf65a78462471ef505ad1d30ee578ef6689d6b4aae4cb2ab212ef7cea3259003a060f5c08d41556e5ab
+AUX lsof-4.88-linux.dnode.c.patch 494 SHA256 8c824fe2ac4f4cb492a2d4539e8a921d50e337235c4f42650bade3728487b34b SHA512 253c0b3e3d50f805ffde21ba214e0a56fa554eb98fd126fd3edc4aa0401e24c2fbb72e30288fe8cc371a3f615f5365e6fc753e7dc2aa0a8367f132c7411b28f1 WHIRLPOOL 31aa05df4e7b3a1b0f9c8f37544a2c3d6be3d596a6ef844855cd3e99fb53291ded85e61690e91e274f5edcf805c73e7663723e8c43458d3a70e3abb6689fe2eb
+DIST lsof_4.87.tar.bz2 773664 SHA256 dfdd3709d82bc79ccdf3e404b84aafa9aede5948642a824ecaefd0aac589da2c SHA512 5e811225dd65366e3ef49628d567864fadda1dbda2d66a5e473123e73c468f5a3a577ae4e1b701a55ac49c2a759dab5c413663121c260a2804fca10ece902766 WHIRLPOOL 4ef01b855dbd8418e1533ebb293c3faacfa38c7a3cd30436d0a8174a974b7cd0eebfb79b23c4c3f13b66a65813a6fbdf5aa483d3f8d2689325fe7d0f48bfb5eb
+DIST lsof_4.88.tar.bz2 778563 SHA256 fe6f9b0e26b779ccd0ea5a0b6327c2b5c38d207a6db16f61ac01bd6c44e5c99b SHA512 acf3901ac08bac5acaa123af835de03fcf86c1cb851a2cba5bb6d08c53dff62570e4129c18ffa241ae84a83d5e6fc5207fb12e43b5ff5a21a0c1967ca117848b WHIRLPOOL 74d85794e5f05920ac83b160b02e510442ebe3f390a8f30bbf514f31bb8ff74ad191f89bed5b3eee47033cc7d6fe01ba4d9d812050d7132e041899d96264076f
+DIST lsof_4.89.tar.bz2 784560 SHA256 81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718 SHA512 cafb0209143c7863e5cebe7efc33a2520d36f9e26222350e4edfa18debbcfb5c81f42f71469e5913fb21f49a7562bbe761b72dfc8f297dadf75ac619cdcb318c WHIRLPOOL e269b5bff958461b0f522b9baa64efc64e04cb71a1fa3ca5b17564b9d180fa8984b74238d4769ff5e4d453bc76cb5d9c4652d080b7d26571326fab4b0bbaf4ac
+EBUILD lsof-4.87-r1.ebuild 2749 SHA256 1e7c8e794c019f12f51534f1c7f70bf89c6cea15adafe5e361e0b2bdf9ed3480 SHA512 13a86d48c4755a6aeedf170874f5c7181458ea15b89b3c4db7f467a3147a13d031cfa7660885242428c4a3347f4efb0d81075add39815da0de301a5b5b244ba4 WHIRLPOOL e7df1ae5d9148336ffb26bd8be07771d03e90d76c107fcd2ed6c4402fd54237c3a88f50377f63abcdafc4e3b393719310af2f76f3ae3b6866a133ab71a0a85b2
+EBUILD lsof-4.88-r1.ebuild 2933 SHA256 25abf40bd1985a9f93faaf6ca44c311c9cc8b4bbfc511a1b245a122513d64a00 SHA512 80737257fb08e8f41d76bb1c2f36cf190d2b08fa431174a607ee39632c749fecaba0662f8596e8ec3a85fb4a2d45af71dbd764498f21d7cbac2a6766676cf4cd WHIRLPOOL c2d41219982da80f0ec1c783ac37414d7cef0dfa91f033afa49fad32da0aaacab873e5a12f7506b5f62e3cb7201429f78fcc286f645246a39208c3ffbf73a9cd
+EBUILD lsof-4.89-r1.ebuild 3252 SHA256 a487ed6aaddeca6cebaeedf80281566edca377b6388718ccbfba3313bb7f4b3c SHA512 f44b786019ecf0cf041f51725a8a5ee742b01723638ed215b60988b48a98c164aaee7beb4dcd906f836d383630edc6fe805910082f9782adf6734b2ee16e58e5 WHIRLPOOL 15ea59c6ebf637a4db8cf14ee3bf71911f26f311b02f336c8ce785bf546361e27d63c071292a7bc842e754b5ed19a31512cf1e10e8083a18aeab3be83c70dd34
+EBUILD lsof-4.89.ebuild 2980 SHA256 6cfc68bf915a3d3d8313f67224e3d65495cac03f593b98d984c1f10944490824 SHA512 3b3d5ce06f3123aca989c683d8c3ef165eafc488258e87e429c96159f5c402326cbfee8426594b89b3106c36d7c2c80e3a501c4d2f4dddd6c8fb2687017772b1 WHIRLPOOL 4187b05be1b1c266a3554762366636d3998f33c71128bb6bfbfbc8bddf6acb0809bc11a3e85c493870fd67cb494adaa5fafcffbe352f53a66329b2bdd953b3a4
+MISC ChangeLog 4051 SHA256 16f7c274c2e3ea0b505cfd19be491ed6fbb6996d5a09e161d94662cfd60ac62a SHA512 68911b6e5dbee7a6a6b76851b06879e37f8f7652fbcc7636bc8c05b94afec6d28350031256cc8b174ed85dc9c4e4d3fdd94f74b47cd3d7adb4bfa90cb684a383 WHIRLPOOL 8c520e36755344e97cac9467bf11573e854f671928ab6a7d17d7c533dd8cad524b1cddcad2ea431b90b3e2936ef4e38c6b16a412e06f467f8886d95fce2c7dbf
+MISC ChangeLog-2015 18846 SHA256 a875bcf3981662398df5ec316a288ccf49ba98b6c17c1d6003c51e0417e5d04e SHA512 8cfbb8f725019d8ee29f9416a5b20e1317fb824984519d80aadca097881f736d4d4d926a1542347d3743988101bac50884a57ac7f38f2f6256732bdb5157797b WHIRLPOOL 3932c65a684c4bdb0a80d106fce6b4c0a2aac96fef5570b7682855a98823f61f0fe678027f317452b03e39fbe3b396b8900e1cf74bfe70d077fb803590c06cd6
+MISC metadata.xml 327 SHA256 be9246f94d3a616b0eed2cfe506c6673aafefb5d2bd85946ec462c2ff3f49494 SHA512 c8c0efc3b339063936d805d533cf3528e1a4e1a84829c0e0f993fd3268751f4d7d4713f45cc6fec2956101b611e6e344e0c0336eb8d1b769a47481d72088fb98 WHIRLPOOL fa94b6d626e8e3d55b5f90ed6a9dbcfdb806cadf43ebdf5086c3dcdf08138f75cf7c14442edd4c5825571a5264d1dc666d4e0c6e242a450f5c8d2424d22416c6
diff --git a/sys-process/lsof/files/lsof-4.85-cross.patch b/sys-process/lsof/files/lsof-4.85-cross.patch
new file mode 100644
index 000000000000..c2c73ccb563f
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-cross.patch
@@ -0,0 +1,37 @@
+let the preprocessor work its magic rather than executing the code
+
+https://bugs.gentoo.org/432120
+
+make sure to use -P here
+
+https://bugs.gentoo.org/546636
+
+--- a/Configure
++++ b/Configure
+@@ -2730,20 +2730,17 @@ LOCKF_OWNER4
+ rm -f ${LSOF_TMPC}.*
+ cat > $LSOF_TMPC.c << .LSOF_END_HERE_DOC1
+ #include <features.h>
+-main() {
++#undef XXX
+ #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+-printf("-DGLIBCV=%d\n",__GLIBC__*100+__GLIBC_MINOR__);
++XXX: __GLIBC__ * 100 + __GLIBC_MINOR__
+ #elif defined(__GLIBC__)
+-printf("-DGLIBCV=%d00\n",__GLIBC__);
+-#else
+-printf("\n");
++XXX: __GLIBC__ * 100
+ #endif
+-return(0); }
+ .LSOF_END_HERE_DOC1
+- $LINUX_CONF_CC ${LSOF_TMPC}.c -I$LSOF_INCLUDE -o ${LSOF_TMPC}.x > /dev/null 2>&1
++ $LINUX_CONF_CC ${LSOF_TMPC}.c -E -P -I$LSOF_INCLUDE 2>/dev/null | sed -n '/^XXX:/s|.*:||p' > ${LSOF_TMPC}.x
+- if test -x ${LSOF_TMPC}.x # {
++ if test -s ${LSOF_TMPC}.x # {
+ then
+- LINUX_CLIB=`${LSOF_TMPC}.x`
++ LINUX_CLIB="-DGLIBCV=$(( `cat ${LSOF_TMPC}.x` ))"
+ LSOF_TMP=$?
+ else
+ LINUX_CLIB=""
diff --git a/sys-process/lsof/files/lsof-4.88-linux.dnode.c.patch b/sys-process/lsof/files/lsof-4.88-linux.dnode.c.patch
new file mode 100644
index 000000000000..28640a9e65ed
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.88-linux.dnode.c.patch
@@ -0,0 +1,21 @@
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/patches/4.88/linux.dnode.c.patch
+
+*** dnode.c
+--- lsof_4.88_src/dialects/linux/dnode.c
+***************
+*** 580,586 ****
+ Lf->inp_ty = 1;
+
+ #if defined(HASEPTOPTS)
+! if (Lf->ntype == N_FIFO) {
+ (void) enter_pinfo();
+ Lf->sf |= SELPINFO;
+ }
+--- 580,586 ----
+ Lf->inp_ty = 1;
+
+ #if defined(HASEPTOPTS)
+! if ((Lf->ntype == N_FIFO) && FpipeE) {
+ (void) enter_pinfo();
+ Lf->sf |= SELPINFO;
+ }
diff --git a/sys-process/lsof/lsof-4.87-r1.ebuild b/sys-process/lsof/lsof-4.87-r1.ebuild
new file mode 100644
index 000000000000..1ff04cdc9b14
--- /dev/null
+++ b/sys-process/lsof/lsof-4.87-r1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+MY_P=${P/-/_}
+DESCRIPTION="Lists open files for running Unix processes"
+HOMEPAGE="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
+SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
+ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD/${MY_P}.tar.bz2"
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples ipv6 rpc selinux static"
+
+RDEPEND="rpc? ( net-libs/libtirpc )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ rpc? ( virtual/pkgconfig )"
+
+S=${WORKDIR}/${MY_P}/${MY_P}_src
+
+src_unpack() {
+ unpack ${A}
+ cd ${MY_P}
+ unpack ./${MY_P}_src.tar
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.85-cross.patch #432120
+ # convert `test -r header.h` into a compile test
+ sed -i -r \
+ -e 's:test -r \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\1>" | ${LSOF_CC} ${LSOF_CFGF} -E - >/dev/null 2>\&1:' \
+ -e 's:grep (.*) \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\2>" | ${LSOF_CC} ${LSOF_CFGF} -E -P -dD - 2>/dev/null | grep \1:' \
+ Configure || die
+}
+
+target() {
+ case ${CHOST} in
+ *-darwin*) echo darwin ;;
+ *-freebsd*) echo freebsd ;;
+ *-solaris*) echo solaris ;;
+ *-aix*) echo aixgcc ;;
+ *) echo linux ;;
+ esac
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H")
+ append-cppflags $(usex ipv6 -{D,U}HASIPv6)
+
+ export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \
+ $(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)"
+
+ # Set LSOF_INCLUDE to a dummy location so the script doesn't poke
+ # around in it and mix /usr/include paths with cross-compile/etc.
+ touch .neverInv
+ LINUX_HASSELINUX=$(usex selinux y n) \
+ LSOF_INCLUDE=${T} \
+ LSOF_CC=$(tc-getCC) \
+ LSOF_AR="$(tc-getAR) rc" \
+ LSOF_RANLIB=$(tc-getRANLIB) \
+ LSOF_CFGF="${CFLAGS} ${CPPFLAGS}" \
+ ./Configure -n $(target) || die
+}
+
+src_compile() {
+ emake DEBUG="" all
+}
+
+src_install() {
+ dobin lsof
+
+ if use examples ; then
+ insinto /usr/share/lsof/scripts
+ doins scripts/*
+ fi
+
+ doman lsof.8
+ dodoc 00*
+}
+
+pkg_postinst() {
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ einfo "Note: to use lsof on Solaris you need read permissions on"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group sys"
+ elif [[ ${CHOST} == *-aix* ]] ; then
+ einfo "Note: to use lsof on AIX you need read permissions on /dev/mem and"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group system"
+ fi
+}
diff --git a/sys-process/lsof/lsof-4.88-r1.ebuild b/sys-process/lsof/lsof-4.88-r1.ebuild
new file mode 100644
index 000000000000..f9371208a23a
--- /dev/null
+++ b/sys-process/lsof/lsof-4.88-r1.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+MY_P=${P/-/_}
+DESCRIPTION="Lists open files for running Unix processes"
+HOMEPAGE="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
+SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
+ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD/${MY_P}.tar.bz2"
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples ipv6 rpc selinux static"
+
+RDEPEND="rpc? ( net-libs/libtirpc )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ rpc? ( virtual/pkgconfig )"
+
+S=${WORKDIR}/${MY_P}/${MY_P}_src
+
+src_unpack() {
+ unpack ${A}
+ cd ${MY_P}
+ unpack ./${MY_P}_src.tar
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.85-cross.patch #432120
+ epatch "${FILESDIR}"/${P}-linux.dnode.c.patch
+ # fix POSIX compliance with `echo`
+ sed -i \
+ -e 's:echo -n:printf:' \
+ AFSConfig Configure Customize Inventory tests/CkTestDB || die
+ # convert `test -r header.h` into a compile test
+ sed -i -r \
+ -e 's:test -r \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\1>" | ${LSOF_CC} ${LSOF_CFGF} -E - >/dev/null 2>\&1:' \
+ -e 's:grep (.*) \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\2>" | ${LSOF_CC} ${LSOF_CFGF} -E -P -dD - 2>/dev/null | grep \1:' \
+ Configure || die
+}
+
+target() {
+ case ${CHOST} in
+ *-darwin*) echo darwin ;;
+ *-freebsd*) echo freebsd ;;
+ *-solaris*) echo solaris ;;
+ *-aix*) echo aixgcc ;;
+ *) echo linux ;;
+ esac
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H")
+ append-cppflags $(usex ipv6 -{D,U}HASIPv6)
+
+ export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \
+ $(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)"
+
+ # Set LSOF_INCLUDE to a dummy location so the script doesn't poke
+ # around in it and mix /usr/include paths with cross-compile/etc.
+ touch .neverInv
+ LINUX_HASSELINUX=$(usex selinux y n) \
+ LSOF_INCLUDE=${T} \
+ LSOF_CC=$(tc-getCC) \
+ LSOF_AR="$(tc-getAR) rc" \
+ LSOF_RANLIB=$(tc-getRANLIB) \
+ LSOF_CFGF="${CFLAGS} ${CPPFLAGS}" \
+ ./Configure -n $(target) || die
+}
+
+src_compile() {
+ emake DEBUG="" all
+}
+
+src_install() {
+ dobin lsof
+
+ if use examples ; then
+ insinto /usr/share/lsof/scripts
+ doins scripts/*
+ fi
+
+ doman lsof.8
+ dodoc 00*
+}
+
+pkg_postinst() {
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ einfo "Note: to use lsof on Solaris you need read permissions on"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group sys"
+ elif [[ ${CHOST} == *-aix* ]] ; then
+ einfo "Note: to use lsof on AIX you need read permissions on /dev/mem and"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group system"
+ fi
+}
diff --git a/sys-process/lsof/lsof-4.89-r1.ebuild b/sys-process/lsof/lsof-4.89-r1.ebuild
new file mode 100644
index 000000000000..0fc565391989
--- /dev/null
+++ b/sys-process/lsof/lsof-4.89-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+MY_P=${P/-/_}
+DESCRIPTION="Lists open files for running Unix processes"
+HOMEPAGE="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
+SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
+ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD/${MY_P}.tar.bz2
+ http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2"
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples ipv6 rpc selinux static"
+
+RDEPEND="rpc? ( net-libs/libtirpc )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ rpc? ( virtual/pkgconfig )"
+
+S=${WORKDIR}/${MY_P}/${MY_P}_src
+
+src_unpack() {
+ unpack ${A}
+ cd ${MY_P} || die
+ unpack ./${MY_P}_src.tar
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.85-cross.patch #432120
+ # fix POSIX compliance with `echo`
+ sed -i \
+ -e 's:echo -n:printf:' \
+ AFSConfig Configure Customize Inventory tests/CkTestDB || die
+ # Convert `test -r header.h` into a compile test.
+ # Make sure we convert `test ... -a ...` into two `test` commands
+ # so we can then convert both over into a compile test. #601432
+ sed -i -E \
+ -e '/if test .* -a /s: -a : \&\& test :g' \
+ -e '/test -r/s:test -r \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\1>" | ${LSOF_CC} ${LSOF_CFGF} -E - >/dev/null 2>\&1:g' \
+ -e 's:grep (.*) \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\2>" | ${LSOF_CC} ${LSOF_CFGF} -E -P -dD - 2>/dev/null | grep \1:' \
+ Configure || die
+}
+
+target() {
+ case ${CHOST} in
+ *-darwin*) echo darwin ;;
+ *-freebsd*) echo freebsd ;;
+ *-solaris*) echo solaris ;;
+ *-aix*) echo aixgcc ;;
+ *) echo linux ;;
+ esac
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H")
+ append-cppflags $(usex ipv6 -{D,U}HASIPv6)
+ [[ ${CHOST} == *-solaris2.11 ]] && append-cppflags -DHAS_PAD_MUTEX
+
+ export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \
+ $(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)"
+
+ # Set LSOF_INCLUDE to a dummy location so the script doesn't poke
+ # around in it and mix /usr/include paths with cross-compile/etc.
+ touch .neverInv
+ LINUX_HASSELINUX=$(usex selinux y n) \
+ LSOF_INCLUDE=${T} \
+ LSOF_CC=$(tc-getCC) \
+ LSOF_AR="$(tc-getAR) rc" \
+ LSOF_RANLIB=$(tc-getRANLIB) \
+ LSOF_CFGF="${CFLAGS} ${CPPFLAGS}" \
+ ./Configure -n $(target) || die
+}
+
+src_compile() {
+ emake DEBUG="" all
+}
+
+src_install() {
+ dobin lsof
+
+ if use examples ; then
+ insinto /usr/share/lsof/scripts
+ doins scripts/*
+ fi
+
+ doman lsof.8
+ dodoc 00*
+}
+
+pkg_postinst() {
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ einfo "Note: to use lsof on Solaris you need read permissions on"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group sys"
+ elif [[ ${CHOST} == *-aix* ]] ; then
+ einfo "Note: to use lsof on AIX you need read permissions on /dev/mem and"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group system"
+ fi
+}
diff --git a/sys-process/lsof/lsof-4.89.ebuild b/sys-process/lsof/lsof-4.89.ebuild
new file mode 100644
index 000000000000..38ea4bcd1155
--- /dev/null
+++ b/sys-process/lsof/lsof-4.89.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils flag-o-matic toolchain-funcs
+
+MY_P=${P/-/_}
+DESCRIPTION="Lists open files for running Unix processes"
+HOMEPAGE="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
+SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
+ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD/${MY_P}.tar.bz2
+ http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2"
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples ipv6 rpc selinux static"
+
+RDEPEND="rpc? ( net-libs/libtirpc )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ rpc? ( virtual/pkgconfig )"
+
+S=${WORKDIR}/${MY_P}/${MY_P}_src
+
+src_unpack() {
+ unpack ${A}
+ cd ${MY_P} || die
+ unpack ./${MY_P}_src.tar
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.85-cross.patch #432120
+ # fix POSIX compliance with `echo`
+ sed -i \
+ -e 's:echo -n:printf:' \
+ AFSConfig Configure Customize Inventory tests/CkTestDB || die
+ # convert `test -r header.h` into a compile test
+ sed -i -r \
+ -e 's:test -r \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\1>" | ${LSOF_CC} ${LSOF_CFGF} -E - >/dev/null 2>\&1:' \
+ -e 's:grep (.*) \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\2>" | ${LSOF_CC} ${LSOF_CFGF} -E -P -dD - 2>/dev/null | grep \1:' \
+ Configure || die
+}
+
+target() {
+ case ${CHOST} in
+ *-darwin*) echo darwin ;;
+ *-freebsd*) echo freebsd ;;
+ *-solaris*) echo solaris ;;
+ *-aix*) echo aixgcc ;;
+ *) echo linux ;;
+ esac
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H")
+ append-cppflags $(usex ipv6 -{D,U}HASIPv6)
+
+ export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \
+ $(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)"
+
+ # Set LSOF_INCLUDE to a dummy location so the script doesn't poke
+ # around in it and mix /usr/include paths with cross-compile/etc.
+ touch .neverInv
+ LINUX_HASSELINUX=$(usex selinux y n) \
+ LSOF_INCLUDE=${T} \
+ LSOF_CC=$(tc-getCC) \
+ LSOF_AR="$(tc-getAR) rc" \
+ LSOF_RANLIB=$(tc-getRANLIB) \
+ LSOF_CFGF="${CFLAGS} ${CPPFLAGS}" \
+ ./Configure -n $(target) || die
+}
+
+src_compile() {
+ emake DEBUG="" all
+}
+
+src_install() {
+ dobin lsof
+
+ if use examples ; then
+ insinto /usr/share/lsof/scripts
+ doins scripts/*
+ fi
+
+ doman lsof.8
+ dodoc 00*
+}
+
+pkg_postinst() {
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ einfo "Note: to use lsof on Solaris you need read permissions on"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group sys"
+ elif [[ ${CHOST} == *-aix* ]] ; then
+ einfo "Note: to use lsof on AIX you need read permissions on /dev/mem and"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group system"
+ fi
+}
diff --git a/sys-process/lsof/metadata.xml b/sys-process/lsof/metadata.xml
new file mode 100644
index 000000000000..4f913c0bcab0
--- /dev/null
+++ b/sys-process/lsof/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<use>
+ <flag name="rpc">support looking up RPC service info</flag>
+</use>
+</pkgmetadata>