[gentoo-commits] repo/gentoo:master commit in: sys-process/lsof/files/, sys-process/lsof/

2023-07-19 Thread Sam James
commit: 1e505057e5ec18ae8b98d22d9cf1955ce0a46fad
Author: Sam James  gentoo  org>
AuthorDate: Wed Jul 19 22:42:28 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jul 19 22:42:28 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e505057

sys-process/lsof: backport strftime fix

Closes: https://bugs.gentoo.org/910547
Signed-off-by: Sam James  gentoo.org>

 .../lsof-4.98.0-fix-common-include-strftime.patch  | 28 +++
 sys-process/lsof/lsof-4.98.0-r1.ebuild | 58 ++
 2 files changed, 86 insertions(+)

diff --git 
a/sys-process/lsof/files/lsof-4.98.0-fix-common-include-strftime.patch 
b/sys-process/lsof/files/lsof-4.98.0-fix-common-include-strftime.patch
new file mode 100644
index ..4b22dbfb8a02
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.98.0-fix-common-include-strftime.patch
@@ -0,0 +1,28 @@
+https://bugs.gentoo.org/910547
+https://github.com/lsof-org/lsof/commit/437824cf35daf5a505bed5b619bef95af090ecc4
+
+From 437824cf35daf5a505bed5b619bef95af090ecc4 Mon Sep 17 00:00:00 2001
+From: Kalin KOZHUHAROV 
+Date: Wed, 19 Jul 2023 15:23:13 +0200
+Subject: [PATCH] src/util.cadd proper includes (#294)
+
+* src/util.c   add proper includes
+
+Fixes #293 for lsof-org/lsof
+
+Signed-off-by: Kalin KOZHUHAROV 
+
+-
+
+Signed-off-by: Kalin KOZHUHAROV 
+Co-authored-by: Jiajie Chen 
+--- a/util.c
 b/util.c
+@@ -35,6 +35,7 @@
+  * 4. This notice may not be removed or altered.
+  */
+ 
++#include "lsof.h"
+ 
+ #if   defined(HAS_STRFTIME)
+ #include 

diff --git a/sys-process/lsof/lsof-4.98.0-r1.ebuild 
b/sys-process/lsof/lsof-4.98.0-r1.ebuild
new file mode 100644
index ..aef7b5fff4a8
--- /dev/null
+++ b/sys-process/lsof/lsof-4.98.0-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic
+
+MY_P="${P/-/_}"
+DESCRIPTION="Lists open files for running Unix processes"
+HOMEPAGE="https://github.com/lsof-org/lsof;
+SRC_URI="https://github.com/lsof-org/lsof/releases/download/${PV}/${P}.tar.gz;
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86"
+IUSE="rpc selinux"
+
+RDEPEND="
+   rpc? ( net-libs/libtirpc )
+   selinux? ( sys-libs/libselinux )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+   sys-apps/groff
+   rpc? ( virtual/pkgconfig )
+"
+
+# Needs fixing first for sandbox
+RESTRICT="test"
+
+PATCHES=(
+   "${FILESDIR}"/${P}-fix-common-include-strftime.patch
+)
+
+src_configure() {
+   # TODO: drop after 4.98.0: 
https://github.com/lsof-org/lsof/commit/4fbe0b78f63ce115f25cf7a49756745e3bf47fea
+   export ac_cv_header_selinux_selinux_h=$(usex selinux)
+
+   # TODO: drop after 4.98.0: 
https://github.com/lsof-org/lsof/commit/22d9cedfca4672601f35f7683907373cd5124121
+   [[ ${CHOST} == *-solaris2.11 ]] && append-cppflags -DHAS_PAD_MUTEX
+
+   local myeconfargs=(
+   $(use_with rpc libtirpc)
+   )
+
+   econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+   emake DEBUG="" all
+}
+
+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"
+   fi
+}



[gentoo-commits] repo/gentoo:master commit in: sys-process/lsof/files/, sys-process/lsof/

2023-06-10 Thread Sam James
commit: dd7e0c59bbebb6948aa7acb3b778630d1740847d
Author: Sam James  gentoo  org>
AuthorDate: Sat Jun  3 02:14:22 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Jun 10 10:24:02 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd7e0c59

sys-process/lsof: drop 4.96.3, 4.96.4

Signed-off-by: Sam James  gentoo.org>

 sys-process/lsof/Manifest|   2 -
 sys-process/lsof/files/lsof-4.85-cross.patch |  37 -
 sys-process/lsof/lsof-4.96.3.ebuild  | 112 ---
 sys-process/lsof/lsof-4.96.4.ebuild  | 111 --
 4 files changed, 262 deletions(-)

diff --git a/sys-process/lsof/Manifest b/sys-process/lsof/Manifest
index 448c9e9aa29f..7767d56a6339 100644
--- a/sys-process/lsof/Manifest
+++ b/sys-process/lsof/Manifest
@@ -1,3 +1 @@
-DIST lsof-4.96.3.tar.gz 1342843 BLAKE2B 
79e276d0db5138c356cc8bfa32e6f991ce8860644eb5d02f49ba04ce08076232f0fb8b10e143ee135205de5c64bd053d7bf021e48d666b65ffc01c0a47b76116
 SHA512 
ad17a73590ffb154a13b8b5de8ada738ce343fcc833012b2a5e9b3bda587785b09ae8bf090a99fba8e84b788c2a6d61eaa7359f939bfa68d2423e604801e2a98
-DIST lsof-4.96.4.tar.gz 1342514 BLAKE2B 
c420e2f928ffa8148a62298ba7176f860b15f9e78f4c2dc299162614a1d9b94a85c42ee93ef5e92b8a99f1c67e496cf2c848874b844c22c287aab53bfe211c58
 SHA512 
06f8005e1eb72324c1fd603d8b8287a61ad6fdec182e9da833991a8915aaa69c416af1564d3b1087cb08b3504ef9b15cdffec7051605e89d945d6750ec8da985
 DIST lsof-4.98.0.tar.gz 734232 BLAKE2B 
2f4ba4d179e8061e5bcff7dda4a0981616530bd5577fc73904e2699e6e982efee9e4270d3f2d3c68751d73cb98bfed0fd49d4c6bd967d15b4e06dcb72494d024
 SHA512 
6fde12497ce9cbba698be624b45e8392d551626c3e46b50ec23e661b322438ef7162dbac0d06829d56f074c7d934fa1ca98aa50ee1487125c93bebfe8eb2a2e8

diff --git a/sys-process/lsof/files/lsof-4.85-cross.patch 
b/sys-process/lsof/files/lsof-4.85-cross.patch
deleted file mode 100644
index c2c73ccb563f..
--- a/sys-process/lsof/files/lsof-4.85-cross.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-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 
--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/lsof-4.96.3.ebuild 
b/sys-process/lsof/lsof-4.96.3.ebuild
deleted file mode 100644
index aa2ed67f1fc4..
--- a/sys-process/lsof/lsof-4.96.3.ebuild
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit flag-o-matic toolchain-funcs
-
-MY_P="${P/-/_}"
-DESCRIPTION="Lists open files for running Unix processes"
-HOMEPAGE="https://github.com/lsof-org/lsof;
-SRC_URI="https://github.com/lsof-org/lsof/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="lsof"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 
sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
-IUSE="examples ipv6 rpc selinux"
-
-RDEPEND="rpc? ( net-libs/libtirpc )
-   selinux? ( sys-libs/libselinux )"
-DEPEND="${RDEPEND}"
-BDEPEND="sys-apps/groff
-   rpc? ( virtual/pkgconfig )"
-
-# Needs fixing first
-RESTRICT="test"
-
-PATCHES=(
-   "${FILESDIR}"/${PN}-4.85-cross.patch # bug #432120
-)
-
-src_prepare() {
-   default
-
-   # 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 

[gentoo-commits] repo/gentoo:master commit in: sys-process/lsof/files/, sys-process/lsof/

2022-09-12 Thread Sam James
commit: 8069922c8c22acaae7dde8ac2a479864b47f2294
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 12 18:04:04 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 12 18:04:16 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8069922c

sys-process/lsof: fix configure tests with Clang 15

Signed-off-by: Sam James  gentoo.org>

 .../files/lsof-4.95.0-clang-15-configure.patch | 134 +
 sys-process/lsof/lsof-4.95.0-r1.ebuild | 116 ++
 2 files changed, 250 insertions(+)

diff --git a/sys-process/lsof/files/lsof-4.95.0-clang-15-configure.patch 
b/sys-process/lsof/files/lsof-4.95.0-clang-15-configure.patch
new file mode 100644
index ..2e81a089e273
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.95.0-clang-15-configure.patch
@@ -0,0 +1,134 @@
+https://github.com/lsof-org/lsof/pull/248
+
+From 52f2c48790ced81aeef98807363ec94a867bbd88 Mon Sep 17 00:00:00 2001
+From: Sam James 
+Date: Mon, 12 Sep 2022 19:02:14 +0100
+Subject: [PATCH] Configure: fix configure tests broken with Clang 15
+ (-Wimplicit-int)
+
+Clang 15 makes -Wimplicit-int an error by default.
+
+Before this fix, configure would think localtime() and strftime() support
+was not present.
+
+Signed-off-by: Sam James 
+--- a/Configure
 b/Configure
+@@ -681,7 +681,7 @@ case $LSOF_TGT in  # {
+ 
+ rm -f ${LSOF_TMPC}.*
+ echo "#include " > ${LSOF_TMPC}.c
+-echo 'main(){ if (__KERNEL_32()) printf("32\\n");' >> ${LSOF_TMPC}.c
++echo 'int main(){ if (__KERNEL_32()) printf("32\\n");' >> 
${LSOF_TMPC}.c
+ echo 'else if (__KERNEL_64()) printf("64\\n");' >> ${LSOF_TMPC}.c
+ echo 'else printf("0\\n");' >> ${LSOF_TMPC}.c
+ echo "return(0); }" >> ${LSOF_TMPC}.c
+@@ -778,7 +778,7 @@ case $LSOF_TGT in  # {
+ rm -f ${LSOF_TMPC}.*
+ echo "#include " > ${LSOF_TMPC}.c
+ echo "#include " >> ${LSOF_TMPC}.c
+-echo "main(){exit((offsetof(struct user, U_irss) & 0x7) ? 1 : 0);}" 
>>${LSOF_TMPC}.c
++echo "int main(){exit((offsetof(struct user, U_irss) & 0x7) ? 1 : 
0);}" >>${LSOF_TMPC}.c
+ echo "Testing user.h with $LSOF_CC"
+ $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x
+ if ! ${LSOF_TMPC}.x   # {
+@@ -811,7 +811,7 @@ case $LSOF_TGT in  # {
+   # Get xlc version number
+ 
+   rm -f ${LSOF_TMPC}.*
+-  echo "main(){}" > ${LSOF_TMPC}.c
++  echo "int main(){}" > ${LSOF_TMPC}.c
+   echo "Getting version number of ${LSOF_CC}."
+   $LSOF_CC -c ${LSOF_TMPC}.c -I${LSOF_INCLUDE} -o ${LSOF_TMPC}.o -qlist > 
/dev/null 2>&1
+   LSOF_CCV=`head -1 ${LSOF_TMPC}.lst | sed 's/\(.*\) ---.*/\1/'`
+@@ -1783,7 +1783,7 @@ kernel generation process.
+ cat > ${LSOF_TMPC}.c << .LSOF_END_HERE_DOC3
+ #undef _KERNEL
+ #include 
+-main() {
++int main() {
+ cpumask_t c;
+ }
+ .LSOF_END_HERE_DOC3
+@@ -2400,7 +2400,7 @@ LOCKF_OWNER4
+ # Test for "const void" support.
+ 
+ rm -f ${LSOF_TMPC}.*
+-echo "main() { const void *x; return(0); }" >> $LSOF_TMPC.c
++echo "int main() { const void *x; return(0); }" >> $LSOF_TMPC.c
+ $LSOF_CC $LSOF_TMPC.c -o $LSOF_TMPC.x > /dev/null 2>&1
+ if test $? -eq 0  # {
+ then
+@@ -2532,7 +2532,7 @@ LOCKF_OWNER4
+ echo ""
+ echo "Testing $LSOF_CC for 64 bit support"
+ rm -f ${LSOF_TMPC}.*
+-echo "main(){}" > ${LSOF_TMPC}.c
++echo "int main(){}" > ${LSOF_TMPC}.c
+ LSOF_TMP1=""
+ $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1
+ if test $? -eq 0  # {
+@@ -4605,7 +4605,7 @@ return(0); }
+   rm -f ${LSOF_TMPC}.*
+   echo "#define _KMEMUSER" > ${LSOF_TMPC}.c
+   echo "#include " >> ${LSOF_TMPC}.c
+-  echo "main(){" >> ${LSOF_TMPC}.c
++  echo "int main(){" >> ${LSOF_TMPC}.c
+   echo "enum prnodetype p=PR_GWINDOWS;}" >> ${LSOF_TMPC}.c
+   echo "Testing prdata.h for PR_GWINDOWS, using $LSOF_CC"
+   echo $LSOF_CC | grep gcc > /dev/null
+@@ -4630,7 +4630,7 @@ return(0); }
+   rm -f ${LSOF_TMPC}.*
+   echo "#define _KMEMUSER" > ${LSOF_TMPC}.c
+   echo "#include " >> ${LSOF_TMPC}.c
+-  echo "main(){" >> ${LSOF_TMPC}.c
++  echo "int main(){" >> ${LSOF_TMPC}.c
+   echo "enum prnodetype p=PR_LDT;}" >> ${LSOF_TMPC}.c
+   echo "Testing prdata.h for PR_LDT, using $LSOF_CC"
+   echo $LSOF_CC | grep gcc > /dev/null
+@@ -4675,7 +4675,7 @@ return(0); }
+ 
+   echo "Testing $LSOF_CC for 64 bit support"
+   rm -f ${LSOF_TMPC}.*
+-  echo "main(){}" > ${LSOF_TMPC}.c
++  echo "int main(){}" > ${LSOF_TMPC}.c
+   LSOF_TMP1=""
+ 
+   # First try gcc's -m64 option -- it's the most current possibility.
+@@ -4695,7 +4695,7 @@ return(0); }
+ 
+   # Try using the older -mcpu=v9 option with gcc instead of -m64.
+ 
+-echo "main(){}" > ${LSOF_TMPC}.c
++echo "int main(){}" > 

[gentoo-commits] repo/gentoo:master commit in: sys-process/lsof/files/, sys-process/lsof/

2022-06-21 Thread David Seifert
commit: 984c598ad12bf8109d4b062236326d32a716f11f
Author: David Seifert  gentoo  org>
AuthorDate: Tue Jun 21 09:41:01 2022 +
Commit: David Seifert  gentoo  org>
CommitDate: Tue Jun 21 09:41:01 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=984c598a

sys-process/lsof: drop 4.94.0-r1

Signed-off-by: David Seifert  gentoo.org>

 sys-process/lsof/Manifest  |   1 -
 .../lsof/files/lsof-4.94-arm-sigbus-fix.patch  |  63 ---
 sys-process/lsof/lsof-4.94.0-r1.ebuild | 117 -
 3 files changed, 181 deletions(-)

diff --git a/sys-process/lsof/Manifest b/sys-process/lsof/Manifest
index e5fde09f82fe..b1aaf692109b 100644
--- a/sys-process/lsof/Manifest
+++ b/sys-process/lsof/Manifest
@@ -1,2 +1 @@
-DIST lsof-4.94.0.tar.gz 1340224 BLAKE2B 
b3d3c4707dac22c5431ac37c6a9f28ba5057b9a8dce65038934f1148209ef4615012ed887e263ec648679d0d95a06c78ed83a7d76cc8d97c05c013c563938793
 SHA512 
852b12e621e1dbf71e5f7fd848a200339ca278fbe8c39dcd33f745d1aea4e61552c0f30a3f6469ad9d4b86a9163e677f8c95298159ebd647357734225aa06c0c
 DIST lsof-4.95.0.tar.gz 1343380 BLAKE2B 
ffb0a656463f8f0e84ddcba36d78a94a8b4b883f0ff043c3821b3236274fb11e04b8c82f84f4e67ab922f021769c2711c1e97716aef3190d640fc321110521a3
 SHA512 
09c5c4b0ea0530e23b98b96df8485f37c2594028b604097a816aee216a8b1a7bc887071e8727cbaf3c765d0992314a5aa49723572cfe926f88806be18a6b8aef

diff --git a/sys-process/lsof/files/lsof-4.94-arm-sigbus-fix.patch 
b/sys-process/lsof/files/lsof-4.94-arm-sigbus-fix.patch
deleted file mode 100644
index 95bad206372e..
--- a/sys-process/lsof/files/lsof-4.94-arm-sigbus-fix.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-https://bugs.gentoo.org/797358
-
-From 21cb1dad1243f4c0a427d893babab12e48b60f0e Mon Sep 17 00:00:00 2001
-From: Masatake YAMATO 
-Date: Sun, 20 Jun 2021 21:40:55 +0900
-Subject: [PATCH] Adjust alignment of buffer passed to stat()
-
-Close #160.
-
-The original code passes char[] buffer to stat().
-This can be cause a SIGBUS.
-
-#160 reported an actual crash on armv7a + glibc-2.33 platform.
-See also https://sourceware.org/bugzilla/show_bug.cgi?id=27993.
-
-The issue is reported by @10ne1.
-
-Signed-off-by: Masatake YAMATO 
-[Adrian: Backported to 4.94]
-Signed-off-by: Adrian Ratiu 
 a/misc.c
-+++ b/misc.c
-@@ -293,7 +293,15 @@ doinchild(fn, fp, rbuf, rbln)
-*/
- 
-   int r_al, r_rbln;
--  char r_arg[MAXPATHLEN+1], r_rbuf[MAXPATHLEN+1];
-+  char r_arg[MAXPATHLEN+1];
-+  union {
-+  char r_rbuf[MAXPATHLEN+1];
-+  /*
-+   * This field is only for adjusting the alignment 
of r_rbuf that
-+   * can be used as an argument for stat().
-+   */
-+  struct stat _;
-+  } r;
-   int (*r_fn)();
-   /*
-* Close sufficient open file descriptors except Pipes[0] and
-@@ -358,16 +366,16 @@ doinchild(fn, fp, rbuf, rbln)
-   ||  read(Pipes[0], r_arg, r_al) != r_al
-   ||  read(Pipes[0], (char *)_rbln, sizeof(r_rbln))
-   != (int)sizeof(r_rbln)
--  ||  r_rbln < 1 || r_rbln > (int)sizeof(r_rbuf))
-+  ||  r_rbln < 1 || r_rbln > (int)sizeof(r.r_rbuf))
-   break;
--  zeromem (r_rbuf, r_rbln);
--  rv = r_fn(r_arg, r_rbuf, r_rbln);
-+  zeromem (r.r_rbuf, r_rbln);
-+  rv = r_fn(r_arg, r.r_rbuf, r_rbln);
-   en = errno;
-   if (write(Pipes[3], (char *), sizeof(rv))
-   != sizeof(rv)
-   ||  write(Pipes[3], (char *), sizeof(en))
-   != sizeof(en)
--  ||  write(Pipes[3], r_rbuf, r_rbln) != r_rbln)
-+  ||  write(Pipes[3], r.r_rbuf, r_rbln) != r_rbln)
-   break;
-   }
-   (void) _exit(0);
--- 
-2.32.0
-

diff --git a/sys-process/lsof/lsof-4.94.0-r1.ebuild 
b/sys-process/lsof/lsof-4.94.0-r1.ebuild
deleted file mode 100644
index f90987e76701..
--- a/sys-process/lsof/lsof-4.94.0-r1.ebuild
+++ /dev/null
@@ -1,117 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit flag-o-matic toolchain-funcs
-
-MY_P="${P/-/_}"
-DESCRIPTION="Lists open files for running Unix processes"
-HOMEPAGE="https://github.com/lsof-org/lsof;
-SRC_URI="https://github.com/lsof-org/lsof/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="lsof"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 
sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris 
~x64-solaris ~x86-solaris"

[gentoo-commits] repo/gentoo:master commit in: sys-process/lsof/files/, sys-process/lsof/

2022-04-27 Thread Sam James
commit: 33f06d887425c79e8318bd02e41e26c8071dfec0
Author: Sam James  gentoo  org>
AuthorDate: Thu Apr 28 01:34:09 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Apr 28 01:34:09 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33f06d88

sys-process/lsof: add 4.95.0

Signed-off-by: Sam James  gentoo.org>

 sys-process/lsof/Manifest  |   1 +
 sys-process/lsof/files/lsof-4.95.0-test-typo.patch |  25 +
 sys-process/lsof/lsof-4.95.0.ebuild| 115 +
 3 files changed, 141 insertions(+)

diff --git a/sys-process/lsof/Manifest b/sys-process/lsof/Manifest
index dde851268b03..e5fde09f82fe 100644
--- a/sys-process/lsof/Manifest
+++ b/sys-process/lsof/Manifest
@@ -1 +1,2 @@
 DIST lsof-4.94.0.tar.gz 1340224 BLAKE2B 
b3d3c4707dac22c5431ac37c6a9f28ba5057b9a8dce65038934f1148209ef4615012ed887e263ec648679d0d95a06c78ed83a7d76cc8d97c05c013c563938793
 SHA512 
852b12e621e1dbf71e5f7fd848a200339ca278fbe8c39dcd33f745d1aea4e61552c0f30a3f6469ad9d4b86a9163e677f8c95298159ebd647357734225aa06c0c
+DIST lsof-4.95.0.tar.gz 1343380 BLAKE2B 
ffb0a656463f8f0e84ddcba36d78a94a8b4b883f0ff043c3821b3236274fb11e04b8c82f84f4e67ab922f021769c2711c1e97716aef3190d640fc321110521a3
 SHA512 
09c5c4b0ea0530e23b98b96df8485f37c2594028b604097a816aee216a8b1a7bc887071e8727cbaf3c765d0992314a5aa49723572cfe926f88806be18a6b8aef

diff --git a/sys-process/lsof/files/lsof-4.95.0-test-typo.patch 
b/sys-process/lsof/files/lsof-4.95.0-test-typo.patch
new file mode 100644
index ..f35b71e749fa
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.95.0-test-typo.patch
@@ -0,0 +1,25 @@
+https://github.com/lsof-org/lsof/commit/60e292652879a45ecaa20987e755e218c1396311
+
+From 60e292652879a45ecaa20987e755e218c1396311 Mon Sep 17 00:00:00 2001
+From: Masatake YAMATO 
+Date: Thu, 28 Apr 2022 08:03:02 +0900
+Subject: [PATCH] [linux] test case: fix a typo
+
+Signed-off-by: Masatake YAMATO 
+---
+ dialects/linux/tests/case-10-ux-socket-state.bash | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dialects/linux/tests/case-10-ux-socket-state.bash 
b/dialects/linux/tests/case-10-ux-socket-state.bash
+index 2c080d6..d58826e 100755
+--- a/dialects/linux/tests/case-10-ux-socket-state.bash
 b/dialects/linux/tests/case-10-ux-socket-state.bash
+@@ -4,7 +4,7 @@ name=$(basename $0 .bash)
+ lsof=$1
+ report=$2
+ 
+-if ! [ -r "/proc/$self/stack" ]; then
++if ! [ -r "/proc/self/stack" ]; then
+ echo "this platform doesn't allow to access /proc/\$PID/stack" >> $report
+ exit 2
+ fi

diff --git a/sys-process/lsof/lsof-4.95.0.ebuild 
b/sys-process/lsof/lsof-4.95.0.ebuild
new file mode 100644
index ..4d4956a7f95d
--- /dev/null
+++ b/sys-process/lsof/lsof-4.95.0.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs
+
+MY_P="${P/-/_}"
+DESCRIPTION="Lists open files for running Unix processes"
+HOMEPAGE="https://github.com/lsof-org/lsof;
+SRC_URI="https://github.com/lsof-org/lsof/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv 
~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris 
~x64-solaris ~x86-solaris"
+IUSE="examples ipv6 rpc selinux"
+
+RDEPEND="rpc? ( net-libs/libtirpc )
+   selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}"
+BDEPEND="sys-apps/groff
+   rpc? ( virtual/pkgconfig )"
+
+# Needs fixing first
+RESTRICT="test"
+
+PATCHES=(
+   "${FILESDIR}"/${PN}-4.85-cross.patch # bug #432120
+   "${FILESDIR}"/${P}-test-typo.patch
+)
+
+src_prepare() {
+   default
+   # 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
+
+   # "create" man-page (bug #689462)
+   # inspired by shipped "makeman" ksh script
+   soelim < Lsof.8 > lsof.8 || die
+}
+
+target() {
+   case ${CHOST} in
+   *-darwin*)  echo darwin  ;;
+   *-freebsd*) echo freebsd ;;
+   *-solaris*) echo solaris ;;
+   *-aix*) echo aixgcc  ;;
+   *)  echo linux   ;;
+   esac
+}
+
+src_configure() {
+   append-cppflags $(use rpc 

[gentoo-commits] repo/gentoo:master commit in: sys-process/lsof/files/, sys-process/lsof/

2021-06-21 Thread Sam James
commit: 6639b5025d4c120c30022cb2993832fcf0c2e928
Author: Adrian Ratiu  collabora  com>
AuthorDate: Mon Jun 21 09:21:40 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jun 21 13:26:52 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6639b502

sys-process/lsof: backport arm sigbus crash fix

This backports an upstream fix for a crash which happens on
armv7a + glibc 2.33 due to a buffer misalignment.

Upstream issue: https://github.com/lsof-org/lsof/issues/160
Upstream commit: 21cb1dad1243f4c0a427d893babab12e48b60f0e
Bug: https://bugs.gentoo.org/797358
Closes: https://github.com/gentoo/gentoo/pull/21354
Acked-by: David Seifert  gentoo.org>
Signed-off-by: Adrian Ratiu  collabora.com>
Signed-off-by: Sam James  gentoo.org>

 .../lsof/files/lsof-4.94-arm-sigbus-fix.patch  | 63 ++
 .../{lsof-4.94.0.ebuild => lsof-4.94.0-r1.ebuild}  |  1 +
 2 files changed, 64 insertions(+)

diff --git a/sys-process/lsof/files/lsof-4.94-arm-sigbus-fix.patch 
b/sys-process/lsof/files/lsof-4.94-arm-sigbus-fix.patch
new file mode 100644
index 000..95bad206372
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.94-arm-sigbus-fix.patch
@@ -0,0 +1,63 @@
+https://bugs.gentoo.org/797358
+
+From 21cb1dad1243f4c0a427d893babab12e48b60f0e Mon Sep 17 00:00:00 2001
+From: Masatake YAMATO 
+Date: Sun, 20 Jun 2021 21:40:55 +0900
+Subject: [PATCH] Adjust alignment of buffer passed to stat()
+
+Close #160.
+
+The original code passes char[] buffer to stat().
+This can be cause a SIGBUS.
+
+#160 reported an actual crash on armv7a + glibc-2.33 platform.
+See also https://sourceware.org/bugzilla/show_bug.cgi?id=27993.
+
+The issue is reported by @10ne1.
+
+Signed-off-by: Masatake YAMATO 
+[Adrian: Backported to 4.94]
+Signed-off-by: Adrian Ratiu 
+--- a/misc.c
 b/misc.c
+@@ -293,7 +293,15 @@ doinchild(fn, fp, rbuf, rbln)
+*/
+ 
+   int r_al, r_rbln;
+-  char r_arg[MAXPATHLEN+1], r_rbuf[MAXPATHLEN+1];
++  char r_arg[MAXPATHLEN+1];
++  union {
++  char r_rbuf[MAXPATHLEN+1];
++  /*
++   * This field is only for adjusting the alignment 
of r_rbuf that
++   * can be used as an argument for stat().
++   */
++  struct stat _;
++  } r;
+   int (*r_fn)();
+   /*
+* Close sufficient open file descriptors except Pipes[0] and
+@@ -358,16 +366,16 @@ doinchild(fn, fp, rbuf, rbln)
+   ||  read(Pipes[0], r_arg, r_al) != r_al
+   ||  read(Pipes[0], (char *)_rbln, sizeof(r_rbln))
+   != (int)sizeof(r_rbln)
+-  ||  r_rbln < 1 || r_rbln > (int)sizeof(r_rbuf))
++  ||  r_rbln < 1 || r_rbln > (int)sizeof(r.r_rbuf))
+   break;
+-  zeromem (r_rbuf, r_rbln);
+-  rv = r_fn(r_arg, r_rbuf, r_rbln);
++  zeromem (r.r_rbuf, r_rbln);
++  rv = r_fn(r_arg, r.r_rbuf, r_rbln);
+   en = errno;
+   if (write(Pipes[3], (char *), sizeof(rv))
+   != sizeof(rv)
+   ||  write(Pipes[3], (char *), sizeof(en))
+   != sizeof(en)
+-  ||  write(Pipes[3], r_rbuf, r_rbln) != r_rbln)
++  ||  write(Pipes[3], r.r_rbuf, r_rbln) != r_rbln)
+   break;
+   }
+   (void) _exit(0);
+-- 
+2.32.0
+

diff --git a/sys-process/lsof/lsof-4.94.0.ebuild 
b/sys-process/lsof/lsof-4.94.0-r1.ebuild
similarity index 98%
rename from sys-process/lsof/lsof-4.94.0.ebuild
rename to sys-process/lsof/lsof-4.94.0-r1.ebuild
index e71171a60c4..f90987e7670 100644
--- a/sys-process/lsof/lsof-4.94.0.ebuild
+++ b/sys-process/lsof/lsof-4.94.0-r1.ebuild
@@ -28,6 +28,7 @@ RESTRICT="test"
 
 PATCHES=(
"${FILESDIR}"/${PN}-4.85-cross.patch #432120
+   "${FILESDIR}"/${PN}-4.94-arm-sigbus-fix.patch
 )
 
 src_prepare() {



[gentoo-commits] repo/gentoo:master commit in: sys-process/lsof/files/, sys-process/lsof/

2020-07-03 Thread Lars Wendler
commit: 1da5d9f95352d54311a57579e05504fbb1c235ba
Author: Lars Wendler  gentoo  org>
AuthorDate: Fri Jul  3 06:13:08 2020 +
Commit: Lars Wendler  gentoo  org>
CommitDate: Fri Jul  3 06:13:19 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1da5d9f9

sys-process/lsof: Removed old

Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Lars Wendler  gentoo.org>

 sys-process/lsof/Manifest  |   1 -
 .../lsof/files/lsof-4.90-darwin-cppfix.patch   |  12 ---
 sys-process/lsof/lsof-4.91.ebuild  | 117 -
 3 files changed, 130 deletions(-)

diff --git a/sys-process/lsof/Manifest b/sys-process/lsof/Manifest
index 2ea65705ba4..d8e31733fa7 100644
--- a/sys-process/lsof/Manifest
+++ b/sys-process/lsof/Manifest
@@ -1,2 +1 @@
 DIST lsof-4.93.2.tar.gz 1319222 BLAKE2B 
3b1756e7b72a0b0a2a11bce82a9b386f6dc5727d7837a4d544e2e33a98be3bfb46af50f0d8cc7b4a4bc419148d13f86d0f34cf806d90ba5d31312f426f81b7e9
 SHA512 
3c4a4d503391b1a648a08a4947c2e72a9629b169eddf50738b16a16a82f2a26967e4db2902e4a9157de5a73ae638db48e392117ffbd591e9fafd6b1725cd01a0
-DIST lsof_4.91.tar.bz2 791734 BLAKE2B 
cd6211caedea34fdbb89266fd78a70902117eda6d4d7fa69115426f4a6f5cb5296fa09bbd946648d8d93483881e4ea4e2190f090be155c1081850e8366cfd05a
 SHA512 
49f811941dd6303f7cb0655fddb8b1177af5d1b18f2bd1edfab09d2c128aea73daecf09c7a5375979c66ba764c88a6e70c9086b55c3634e3be01ab1aa12e9f92

diff --git a/sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch 
b/sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch
deleted file mode 100644
index fcbfeba410a..000
--- a/sys-process/lsof/files/lsof-4.90-darwin-cppfix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur a/dialects/darwin/libproc/dfile.c b/dialects/darwin/libproc/dfile.c
 a/dialects/darwin/libproc/dfile.c  2018-02-19 15:04:26.011578124 +0800
-+++ b/dialects/darwin/libproc/dfile.c  2018-02-19 15:04:45.006502653 +0800
-@@ -43,7 +43,7 @@
- #include "lsof.h"
- 
- #if   defined(PROC_FP_GUARDED)
--#extern   struct pff_tab  Pgf_tab[];
-+externstruct pff_tab  Pgf_tab[];
- #endif/* defined(PROC_FP_GUARDED) */
- 
- 

diff --git a/sys-process/lsof/lsof-4.91.ebuild 
b/sys-process/lsof/lsof-4.91.ebuild
deleted file mode 100644
index 76e427ccb6b..000
--- a/sys-process/lsof/lsof-4.91.ebuild
+++ /dev/null
@@ -1,117 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit 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 sparc 
x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris 
~x64-solaris ~x86-solaris"
-IUSE="examples ipv6 rpc selinux"
-
-RDEPEND="rpc? ( net-libs/libtirpc )
-   selinux? ( sys-libs/libselinux )"
-DEPEND="${RDEPEND}
-   rpc? ( virtual/pkgconfig )"
-
-S="${WORKDIR}/${MY_P}/${MY_P}_src"
-
-PATCHES=(
-   "${FILESDIR}"/${PN}-4.85-cross.patch #432120
-   "${FILESDIR}"/${PN}-4.90-darwin-cppfix.patch #648084
-)
-
-src_unpack() {
-   unpack ${A}
-   cd ${MY_P} || die
-   unpack ./${MY_P}_src.tar
-}
-
-src_prepare() {
-   default
-   # 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() {
-   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
-   if [[ ${CHOST} == *-darwin* ]] ; then
-   # make sys/proc_info.h 

[gentoo-commits] repo/gentoo:master commit in: sys-process/lsof/files/, sys-process/lsof/

2018-02-16 Thread Lars Wendler
commit: 4c4c1f37075b12f21759616f3e6a5a46b704054b
Author: Lars Wendler  gentoo  org>
AuthorDate: Fri Feb 16 10:30:20 2018 +
Commit: Lars Wendler  gentoo  org>
CommitDate: Fri Feb 16 10:33:42 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c4c1f37

sys-process/lsof: Removed old.

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 sys-process/lsof/Manifest  |   2 -
 .../lsof/files/lsof-4.88-linux.dnode.c.patch   |  21 -
 sys-process/lsof/lsof-4.87-r1.ebuild   |  96 
 sys-process/lsof/lsof-4.88-r1.ebuild   | 101 -
 4 files changed, 220 deletions(-)

diff --git a/sys-process/lsof/Manifest b/sys-process/lsof/Manifest
index 3b37d7d5486..b44111bb28c 100644
--- a/sys-process/lsof/Manifest
+++ b/sys-process/lsof/Manifest
@@ -1,4 +1,2 @@
-DIST lsof_4.87.tar.bz2 773664 BLAKE2B 
39ccc2ed9545c0e37ce21fae0330394110807f181bc2c35be3ca1e72062df8359163edec4a47f9f9edfeb2e87af27a40fe16d12436a10e521d595877d02786ed
 SHA512 
5e811225dd65366e3ef49628d567864fadda1dbda2d66a5e473123e73c468f5a3a577ae4e1b701a55ac49c2a759dab5c413663121c260a2804fca10ece902766
-DIST lsof_4.88.tar.bz2 778563 BLAKE2B 
376f4474a1a113b76fd40a542a2b2e797f1b181286935f66f10f37474a07f30b55feac4700789a923774be09f9ceded312e94e866e1156f7dee188adc5eb3fdd
 SHA512 
acf3901ac08bac5acaa123af835de03fcf86c1cb851a2cba5bb6d08c53dff62570e4129c18ffa241ae84a83d5e6fc5207fb12e43b5ff5a21a0c1967ca117848b
 DIST lsof_4.89.tar.bz2 784560 BLAKE2B 
375ad53fd5c26a79559295fc8bcb6c495c00bf546019001b498f064dbd111f3581d60a577c199ce2cbd49dac0c061cdaea99de56d6bf069dceb0dd8b2f836942
 SHA512 
cafb0209143c7863e5cebe7efc33a2520d36f9e26222350e4edfa18debbcfb5c81f42f71469e5913fb21f49a7562bbe761b72dfc8f297dadf75ac619cdcb318c
 DIST lsof_4.90.tar.bz2 791758 BLAKE2B 
250025eb553ee4574cadadcc57fa52bd97d8ce4432e25e9e028d3eec4033be54d5cbab5f02e0a04365033b5d179ca50efa591efe4ac28077f63513edee131084
 SHA512 
8c1481ab72867488d800ad68c9de5c936f034f044c90eeed220fb5683f68ba8efa3dd0efe1e23b4d4968750255b475150ad08ae8627dd9aa0a5025498418351a

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
deleted file mode 100644
index 28640a9e65e..000
--- a/sys-process/lsof/files/lsof-4.88-linux.dnode.c.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-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
deleted file mode 100644
index 1ff04cdc9b1..000
--- a/sys-process/lsof/lsof-4.87-r1.ebuild
+++ /dev/null
@@ -1,96 +0,0 @@
-# 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)