* [gentoo-commits] proj/hardened-dev:musl commit in: sys-process/lsof/, sys-process/lsof/files/
@ 2014-02-21 21:01 Anthony G. Basile
0 siblings, 0 replies; 2+ messages in thread
From: Anthony G. Basile @ 2014-02-21 21:01 UTC (permalink / raw
To: gentoo-commits
commit: f28c91a01b2104286a53b239db475081e44856e5
Author: layman <layman <AT> localhost>
AuthorDate: Fri Feb 21 20:23:58 2014 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Feb 21 20:23:58 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=f28c91a0
sys-process/lsof: add missing include <netinet/tcp.h>
Package-Manager: portage-2.2.7
RepoMan-Options: --force
---
sys-process/lsof/files/lsof-4.85-arg.c.patch | 30 ++++++++
sys-process/lsof/files/lsof-4.85-cross.patch | 33 +++++++++
.../lsof-4.85-fix-missing-netinet_tcp_h.patch | 11 +++
sys-process/lsof/lsof-4.85-r99.ebuild | 81 ++++++++++++++++++++++
sys-process/lsof/metadata.xml | 8 +++
5 files changed, 163 insertions(+)
diff --git a/sys-process/lsof/files/lsof-4.85-arg.c.patch b/sys-process/lsof/files/lsof-4.85-arg.c.patch
new file mode 100644
index 0000000..98838cd
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-arg.c.patch
@@ -0,0 +1,30 @@
+arg.c.patch Patches: lsof_4.85_src/arg.c
+
+ Importance: major for all dialects supporting
+ the +|-e option (e.g., Linux)
+
+ Function: this patch corrects a bug in the
+ accumulation of multiple +|-e
+ option values
+
+*** /tmp/T0iAaaeo Thu Oct 20 14:08:43 2011
+--- arg.c Thu Oct 20 14:03:49 2011
+***************
+*** 778,785 ****
+ ep->pathl = i;
+ ep->rdlnk = rdlnk;
+ ep->mp = (struct mounts *)NULL;
+! if (!(ep->next = Efsysl))
+! Efsysl = ep;
+ return(0);
+ }
+ #endif /* defined(HASEOPT) */
+--- 778,785 ----
+ ep->pathl = i;
+ ep->rdlnk = rdlnk;
+ ep->mp = (struct mounts *)NULL;
+! ep->next = Efsysl;
+! Efsysl = ep;
+ return(0);
+ }
+ #endif /* defined(HASEOPT) */
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 0000000..186c6d8
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-cross.patch
@@ -0,0 +1,33 @@
+let the preprocessor work its magic rather than executing the code
+
+https://bugs.gentoo.org/432120
+
+--- 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 -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.85-fix-missing-netinet_tcp_h.patch b/sys-process/lsof/files/lsof-4.85-fix-missing-netinet_tcp_h.patch
new file mode 100644
index 0000000..919c7ae
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-fix-missing-netinet_tcp_h.patch
@@ -0,0 +1,11 @@
+diff -Naur lsof_4.85.orig/lsof_4.85_src/lsof.h lsof_4.85/lsof_4.85_src/lsof.h
+--- lsof_4.85.orig/lsof_4.85_src/lsof.h 2011-09-07 19:14:10.000000000 +0000
++++ lsof_4.85/lsof_4.85_src/lsof.h 2014-02-21 19:31:43.322452780 +0000
+@@ -53,6 +53,7 @@
+ #include <locale.h>
+ # endif /* defined(HASSETLOCALE) */
+
++#include <netinet/tcp.h>
+ #include <netdb.h>
+ #include <pwd.h>
+ #include <stdio.h>
diff --git a/sys-process/lsof/lsof-4.85-r99.ebuild b/sys-process/lsof/lsof-4.85-r99.ebuild
new file mode 100644
index 0000000..4fdb585
--- /dev/null
+++ b/sys-process/lsof/lsof-4.85-r99.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/lsof/lsof-4.85-r2.ebuild,v 1.12 2014/01/20 06:40:56 vapier Exp $
+
+EAPI="2"
+
+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://vic.cc.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
+ ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/${MY_P}.tar.bz2"
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+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}"/${P}-fix-missing-netinet_tcp_h.patch #for musl
+ epatch "${FILESDIR}"/${P}-arg.c.patch #388555
+ 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() { usex kernel_FreeBSD freebsd linux ; }
+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 || die
+}
+
+src_install() {
+ dobin lsof || die
+
+ if use examples ; then
+ insinto /usr/share/lsof/scripts
+ doins scripts/* || die
+ fi
+
+ doman lsof.8 || die
+ dodoc 00*
+}
diff --git a/sys-process/lsof/metadata.xml b/sys-process/lsof/metadata.xml
new file mode 100644
index 0000000..49fb858
--- /dev/null
+++ b/sys-process/lsof/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>
+<use>
+ <flag name='rpc'>support looking up RPC service info</flag>
+</use>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/hardened-dev:musl commit in: sys-process/lsof/, sys-process/lsof/files/
@ 2014-02-21 21:04 Anthony G. Basile
0 siblings, 0 replies; 2+ messages in thread
From: Anthony G. Basile @ 2014-02-21 21:04 UTC (permalink / raw
To: gentoo-commits
commit: 584bee63b3a7cce1330adf2a219989388c3af827
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 21 20:23:58 2014 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Feb 21 21:04:40 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=584bee63
sys-process/lsof: add missing include <netinet/tcp.h>
Package-Manager: portage-2.2.7
RepoMan-Options: --force
---
sys-process/lsof/files/lsof-4.85-arg.c.patch | 30 ++++++++
sys-process/lsof/files/lsof-4.85-cross.patch | 33 +++++++++
.../lsof-4.85-fix-missing-netinet_tcp_h.patch | 11 +++
sys-process/lsof/lsof-4.85-r99.ebuild | 81 ++++++++++++++++++++++
sys-process/lsof/metadata.xml | 8 +++
5 files changed, 163 insertions(+)
diff --git a/sys-process/lsof/files/lsof-4.85-arg.c.patch b/sys-process/lsof/files/lsof-4.85-arg.c.patch
new file mode 100644
index 0000000..98838cd
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-arg.c.patch
@@ -0,0 +1,30 @@
+arg.c.patch Patches: lsof_4.85_src/arg.c
+
+ Importance: major for all dialects supporting
+ the +|-e option (e.g., Linux)
+
+ Function: this patch corrects a bug in the
+ accumulation of multiple +|-e
+ option values
+
+*** /tmp/T0iAaaeo Thu Oct 20 14:08:43 2011
+--- arg.c Thu Oct 20 14:03:49 2011
+***************
+*** 778,785 ****
+ ep->pathl = i;
+ ep->rdlnk = rdlnk;
+ ep->mp = (struct mounts *)NULL;
+! if (!(ep->next = Efsysl))
+! Efsysl = ep;
+ return(0);
+ }
+ #endif /* defined(HASEOPT) */
+--- 778,785 ----
+ ep->pathl = i;
+ ep->rdlnk = rdlnk;
+ ep->mp = (struct mounts *)NULL;
+! ep->next = Efsysl;
+! Efsysl = ep;
+ return(0);
+ }
+ #endif /* defined(HASEOPT) */
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 0000000..186c6d8
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-cross.patch
@@ -0,0 +1,33 @@
+let the preprocessor work its magic rather than executing the code
+
+https://bugs.gentoo.org/432120
+
+--- 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 -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.85-fix-missing-netinet_tcp_h.patch b/sys-process/lsof/files/lsof-4.85-fix-missing-netinet_tcp_h.patch
new file mode 100644
index 0000000..919c7ae
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-fix-missing-netinet_tcp_h.patch
@@ -0,0 +1,11 @@
+diff -Naur lsof_4.85.orig/lsof_4.85_src/lsof.h lsof_4.85/lsof_4.85_src/lsof.h
+--- lsof_4.85.orig/lsof_4.85_src/lsof.h 2011-09-07 19:14:10.000000000 +0000
++++ lsof_4.85/lsof_4.85_src/lsof.h 2014-02-21 19:31:43.322452780 +0000
+@@ -53,6 +53,7 @@
+ #include <locale.h>
+ # endif /* defined(HASSETLOCALE) */
+
++#include <netinet/tcp.h>
+ #include <netdb.h>
+ #include <pwd.h>
+ #include <stdio.h>
diff --git a/sys-process/lsof/lsof-4.85-r99.ebuild b/sys-process/lsof/lsof-4.85-r99.ebuild
new file mode 100644
index 0000000..4fdb585
--- /dev/null
+++ b/sys-process/lsof/lsof-4.85-r99.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/lsof/lsof-4.85-r2.ebuild,v 1.12 2014/01/20 06:40:56 vapier Exp $
+
+EAPI="2"
+
+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://vic.cc.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
+ ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/${MY_P}.tar.bz2"
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+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}"/${P}-fix-missing-netinet_tcp_h.patch #for musl
+ epatch "${FILESDIR}"/${P}-arg.c.patch #388555
+ 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() { usex kernel_FreeBSD freebsd linux ; }
+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 || die
+}
+
+src_install() {
+ dobin lsof || die
+
+ if use examples ; then
+ insinto /usr/share/lsof/scripts
+ doins scripts/* || die
+ fi
+
+ doman lsof.8 || die
+ dodoc 00*
+}
diff --git a/sys-process/lsof/metadata.xml b/sys-process/lsof/metadata.xml
new file mode 100644
index 0000000..49fb858
--- /dev/null
+++ b/sys-process/lsof/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>
+<use>
+ <flag name='rpc'>support looking up RPC service info</flag>
+</use>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-21 21:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-21 21:04 [gentoo-commits] proj/hardened-dev:musl commit in: sys-process/lsof/, sys-process/lsof/files/ Anthony G. Basile
-- strict thread matches above, loose matches on Subject: below --
2014-02-21 21:01 Anthony G. Basile
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox