diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-09-17 22:55:13 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-09-17 22:55:13 +0000 |
commit | 6ebce03f5ac988c8094cec6fb498fd3752d60e05 (patch) | |
tree | cd998c8008815548ed5ea808294eb62134ca2786 /sys-process | |
parent | Add support for varnish plugin and fix bug 380297 (diff) | |
download | historical-6ebce03f5ac988c8094cec6fb498fd3752d60e05.tar.gz historical-6ebce03f5ac988c8094cec6fb498fd3752d60e05.tar.bz2 historical-6ebce03f5ac988c8094cec6fb498fd3752d60e05.zip |
Clean up build logic by testing the compiler rather than poking around the filesystem. Support USE=ipv6. Support building with libtirpc rather than glibc and do so with USE=rpc #370833 by kabel.
Package-Manager: portage-2.2.0_alpha58/cvs/Linux x86_64
Diffstat (limited to 'sys-process')
-rw-r--r-- | sys-process/lsof/ChangeLog | 12 | ||||
-rw-r--r-- | sys-process/lsof/Manifest | 16 | ||||
-rw-r--r-- | sys-process/lsof/files/lsof-4.84-rpc.patch | 282 | ||||
-rw-r--r-- | sys-process/lsof/lsof-4.84-r1.ebuild | 77 | ||||
-rw-r--r-- | sys-process/lsof/metadata.xml | 3 |
5 files changed, 386 insertions, 4 deletions
diff --git a/sys-process/lsof/ChangeLog b/sys-process/lsof/ChangeLog index 222aff8d7f8c..dd59da50d69b 100644 --- a/sys-process/lsof/ChangeLog +++ b/sys-process/lsof/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-process/lsof -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/lsof/ChangeLog,v 1.78 2010/08/29 18:12:39 armin76 Exp $ +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/lsof/ChangeLog,v 1.79 2011/09/17 22:55:12 vapier Exp $ + +*lsof-4.84-r1 (17 Sep 2011) + + 17 Sep 2011; Mike Frysinger <vapier@gentoo.org> +lsof-4.84-r1.ebuild, + +files/lsof-4.84-rpc.patch, metadata.xml: + Clean up build logic by testing the compiler rather than poking around the + filesystem. Support USE=ipv6. Support building with libtirpc rather than + glibc and do so with USE=rpc #370833 by kabel. 29 Aug 2010; Raúl Porcel <armin76@gentoo.org> lsof-4.83.ebuild: alpha/ia64/m68k/s390/sh/sparc stable wrt #331143 diff --git a/sys-process/lsof/Manifest b/sys-process/lsof/Manifest index d1392011977d..71571a7dd1f7 100644 --- a/sys-process/lsof/Manifest +++ b/sys-process/lsof/Manifest @@ -1,8 +1,20 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +AUX lsof-4.84-rpc.patch 7293 RMD160 ca0d8a0bd21d8f35cb4e0ab3c2c3461a31722cd5 SHA1 1eac4890fb4cfcce8b949b0c01137f6f818a7c64 SHA256 465080c325f5e6a64cd51e4bbefbce6136368e034cf0dd4a4e65424f687b19a1 DIST lsof_4.82.tar.bz2 793919 RMD160 de7e8441ec80ce13ba7dbf8b023a6403bd670841 SHA1 200aaf7494bddab4c47eea2466c65e57ef2f3786 SHA256 cbfa9fb6ce21b77f1be8a9c0b7fa245965120d968876212697b92617c2b0bd0f DIST lsof_4.83.tar.bz2 753094 RMD160 9a03b41362d68f93d9e7c2db824c8af6df978aa1 SHA1 1aee4c8de6959d84613030a65e90855a922493bf SHA256 b89f930bbe36b970e3cd070b9860ee701d8c7285ffedf2fbcec0e5fa3cb1f544 DIST lsof_4.84.tar.bz2 758615 RMD160 c7df81cb9c83d4e03db395397912138953529510 SHA1 b4fd6011fc183c0602bbba2116b8335a0c57917b SHA256 20893a2d9b443fba519602f05692d5f72054a9f6dc1236bcb2616cc5330dc725 EBUILD lsof-4.82.ebuild 1564 RMD160 d451bf9bbf6318334a8e50f4b1d2ae50e38c327b SHA1 1a61666e103094593ca8af48af34e161a43bb95b SHA256 ac4cdea0e1eda34519b941d1c683de9e4b0d67180ee3d0581dfb40dd180263e9 EBUILD lsof-4.83.ebuild 1448 RMD160 147c474f1ae07368acd3896ec6f292abe7000e2e SHA1 9f5c74270d5dc5e48677f6722ff33fb89dfdb6f1 SHA256 4bbeb0a560aed53ac126fb73acb1bba70daba2b1de4a5a7dc8d031ffcb6bab4b +EBUILD lsof-4.84-r1.ebuild 2301 RMD160 d319902f9f28d8a001dd6f59b0408210d7c279d9 SHA1 f3a579c5dbf91874378f643cf049380c0da0d0ad SHA256 d23f45467e684650db4c414f0b9262243be1bd838e5faf365acb64e3b6583231 EBUILD lsof-4.84.ebuild 1455 RMD160 e5e3839ad68d999b73adb619d1bfd8b91bfc74f3 SHA1 77db0f08cd793614322f2ca1e03580d7e158f428 SHA256 1a14c9fddadb2c80100da2b85d6cb2d641bfeab61d67b342382d0cf6773198f9 -MISC ChangeLog 13088 RMD160 9ca3c6051606498e876e496faa131c58d87a9d8c SHA1 9ee38cfe21bf737ad1b0317e8546f3bab2f1ecd8 SHA256 ed78c2ea0cc696a6e77bbd5ef53880656d8875aa7ad4ed2a7536f195cc767807 -MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 +MISC ChangeLog 13434 RMD160 8ab25ef112e04d823308b368d81a2a9a655fbd4b SHA1 82411da8b21282f719d6e008a7c3cf04b05b963c SHA256 1545074629128e0dcf1107e5fc0bc31bb35fa870aec1e08b392552d23dcc37af +MISC metadata.xml 238 RMD160 c0918b440085b691a6da31dba31384758ae4d214 SHA1 2cae35a26364573c7399f53668fb73dd6923b09f SHA256 27f27d7c7ba9fb670a6867a79ff8af354e48735f9bd672d387d96b4bd49d415b +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.17 (GNU/Linux) + +iF4EAREIAAYFAk51JVcACgkQaC/OocHi7JbkhgD+LOAXvhmTPQD7vDeP4LXzAG5q +CXRIr4mzYn0n26NKN2gA/3lLQwPjqfsGBA3shn38M8NQSsCJn+ttjsXBrtfBRSxO +=ZvhK +-----END PGP SIGNATURE----- diff --git a/sys-process/lsof/files/lsof-4.84-rpc.patch b/sys-process/lsof/files/lsof-4.84-rpc.patch new file mode 100644 index 000000000000..3dd3ce2005cf --- /dev/null +++ b/sys-process/lsof/files/lsof-4.84-rpc.patch @@ -0,0 +1,282 @@ +--- lsof_4.84_src/Configure ++++ lsof_4.84_src/Configure +@@ -2740,6 +2740,13 @@ + LSOF_CFGF="$LSOF_CFGF -DHASIPv6" + fi # } + ++ # Test for rpc/rpc.h ++ ++ if ! test -r ${LSOF_INCLUDE}/rpc/rpc.h # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASNOTRPC" ++ fi # } ++ + # Test for SELinux support. + + LSOF_TMP1=0 +--- lsof_4.84_src/dialects/linux/dlsof.h ++++ lsof_4.84_src/dialects/linux/dlsof.h +@@ -56,8 +56,10 @@ + #include <linux/tcp.h> + # endif /* defined(GLIBCV) || defined(__UCLIBC__) */ + ++# if !defined(HASNOTRPC) + #include <rpc/rpc.h> + #include <rpc/pmap_prot.h> ++# endif /* !defined(HASNOTRPC) */ + + #if defined(HASSELINUX) + #include <selinux/selinux.h> +--- lsof_4.84_src/lsof.h ++++ lsof_4.84_src/lsof.h +@@ -609,7 +609,9 @@ + extern int Foffset; + extern int Fovhd; + extern int Fport; ++#if !defined(HASNOTRPC) + extern int FportMap; ++#endif /* !defined(HASNOTRPC) */ + extern int Fpgid; + extern int Fppid; + extern int Fsize; +--- lsof_4.84_src/main.c ++++ lsof_4.84_src/main.c +@@ -154,7 +154,7 @@ + * Create option mask. + */ + (void) snpf(options, sizeof(options), +- "?a%sbc:D:d:%sf:F:g:hi:%s%slL:%sMnNo:Op:Pr:%ss:S:tT:u:UvVwx:%s%s%s", ++ "?a%sbc:D:d:%sf:F:g:hi:%s%slL:%s%snNo:Op:Pr:%ss:S:tT:u:UvVwx:%s%s%s", + + #if defined(HAS_AFS) && defined(HASAOPT) + "A:", +@@ -186,6 +186,12 @@ + "", + #endif /* defined(HASMOPT) || defined(HASMNTSUP) */ + ++#if !defined(HASNOTRPC) ++ "M", ++#else /* defined(HASNOTRPC) */ ++ "", ++#endif /* defined(HASNOTRPC) */ ++ + #if defined(HASPPID) + "R", + #else /* !defined(HASPPID) */ +@@ -643,9 +649,11 @@ + break; + #endif /* defined(HASMOPT) || defined(HASMNTSUP) */ + ++#if !defined(HASNOTRPC) + case 'M': + FportMap = (GOp == '+') ? 1 : 0; + break; ++#endif /* !defined(HASNOTRPC) */ + case 'n': + Fhost = (GOp == '-') ? 0 : 1; + break; +--- lsof_4.84_src/print.c ++++ lsof_4.84_src/print.c +@@ -67,8 +67,11 @@ + struct porttab *next; + }; + +- ++#if defined(HASNOTRPC) ++static struct porttab **Pth[2] = { NULL, NULL }; ++#else /* !defined(HASNOTRPC) */ + static struct porttab **Pth[4] = { NULL, NULL, NULL, NULL }; ++#endif /* !defined(HASNOTRPC) */ + /* port hash buckets: + * Pth[0] for TCP service names + * Pth[1] for UDP service names +@@ -78,12 +81,14 @@ + #define HASHPORT(p) (((((int)(p)) * 31415) >> 3) & (PORTHASHBUCKETS - 1)) + + ++#if !defined(HASNOTRPC) + _PROTOTYPE(static void fill_portmap,(void)); ++_PROTOTYPE(static void update_portmap,(struct porttab *pt, char *pn)); ++#endif /* !defined(HASNOTRPC) */ + _PROTOTYPE(static void fill_porttab,(void)); + _PROTOTYPE(static char *lkup_port,(int p, int pr, int src)); + _PROTOTYPE(static char *lkup_svcnam,(int h, int p, int pr, int ss)); + _PROTOTYPE(static int printinaddr,(void)); +-_PROTOTYPE(static void update_portmap,(struct porttab *pt, char *pn)); + + + /* +@@ -104,6 +109,7 @@ + } + + ++#if !defined(HASNOTRPC) + /* + * fill_portmap() -- fill the RPC portmap program name table via a conversation + * with the portmapper +@@ -267,6 +273,7 @@ + } + clnt_destroy(c); + } ++#endif /* !defined(HASNOTRPC) */ + + + /* +@@ -468,8 +475,12 @@ + * If the hash buckets haven't been allocated, do so. + */ + if (!Pth[0]) { ++#if defined(HASNOTRPC) ++ for (h = 0; h < 2; h++) { ++#else /* !defined(HASNOTRPC) */ + nh = FportMap ? 4 : 2; + for (h = 0; h < nh; h++) { ++#endif /* !defined(HASNOTRPC) */ + if (!(Pth[h] = (struct porttab **)calloc(PORTHASHBUCKETS, + sizeof(struct porttab *)))) + { +@@ -483,6 +494,7 @@ + } + } + } ++#if !defined(HASNOTRPC) + /* + * If we're looking up program names for portmapped ports, make sure the + * portmap table has been loaded. +@@ -491,11 +503,13 @@ + (void) fill_portmap(); + pm++; + } ++#endif /* !defined(HASNOTRPC) */ + /* + * Hash the port and see if its name has been cached. Look for a local + * port first in the portmap, if portmap searching is enabled. + */ + h = HASHPORT(p); ++#if !defined(HASNOTRPC) + if (!src && FportMap) { + for (pt = Pth[pr+2][h]; pt; pt = pt->next) { + if (pt->port != p) +@@ -511,6 +525,7 @@ + return(pt->name); + } + } ++#endif /* !defined(HASNOTRPC) */ + for (pt = Pth[pr][h]; pt; pt = pt->next) { + if (pt->port == p) + return(pt->name); +@@ -1154,7 +1169,11 @@ + * Process the port number. + */ + if (Lf->li[i].p > 0) { +- if (Fport || FportMap) { ++ if (Fport ++#if !defined(HASNOTRPC) ++ || FportMap ++#endif /* !defined(HASNOTRPC) */ ++ ) { + + /* + * If converting port numbers to service names, or looking +@@ -1167,9 +1186,10 @@ + * loopback address 127.0.0.1. (Test 2 may not always work + * -- e.g., on hosts with multiple interfaces.) + */ ++#if !defined(HASNOTRPC) + if ((src = i) && FportMap) { + +-#if defined(HASIPv6) ++# if defined(HASIPv6) + if (Lf->li[0].af == AF_INET6) { + if (IN6_IS_ADDR_LOOPBACK(&Lf->li[i].ia.a6) + || IN6_ARE_ADDR_EQUAL(&Lf->li[0].ia.a6, +@@ -1177,7 +1197,7 @@ + ) + src = 0; + } else +-#endif /* defined(HASIPv6) */ ++# endif /* defined(HASIPv6) */ + + if (Lf->li[0].af == AF_INET) { + if (Lf->li[i].ia.a4.s_addr == htonl(INADDR_LOOPBACK) +@@ -1186,6 +1206,7 @@ + src = 0; + } + } ++#endif /* !defined(HASNOTRPC) */ + if (strcasecmp(Lf->iproto, "TCP") == 0) + port = lkup_port(Lf->li[i].p, 0, src); + else if (strcasecmp(Lf->iproto, "UDP") == 0) +@@ -2748,6 +2769,7 @@ + } + + ++#if !defined(HASNOTRPC) + /* + * update_portmap() - update a portmap entry with its port number or service + * name +@@ -2780,3 +2802,4 @@ + pt->nl = nl; + pt->ss = 1; + } ++#endif /* !defined(HASNOTRPC) */ +--- lsof_4.84_src/store.c ++++ lsof_4.84_src/store.c +@@ -156,11 +156,13 @@ + int Fovhd = 0; /* -O option status */ + int Fport = 1; /* -P option status */ + +-#if defined(HASPMAPENABLED) ++#if !defined(HASNOTRPC) ++# if defined(HASPMAPENABLED) + int FportMap = 1; /* +|-M option status */ +-#else /* !defined(HASPMAPENABLED) */ ++# else /* !defined(HASPMAPENABLED) */ + int FportMap = 0; /* +|-M option status */ +-#endif /* defined(HASPMAPENABLED) */ ++# endif /* defined(HASPMAPENABLED) */ ++#endif /* !defined(HASNOTRPC) */ + + int Fpgid = 0; /* -g option status */ + int Fppid = 0; /* -R option status */ +--- lsof_4.84_src/usage.c ++++ lsof_4.84_src/usage.c +@@ -453,8 +453,12 @@ + ); + #endif /* defined(HASMOPT) || defined(HASMNTSUP) */ + ++#if !defined(HASNOTRPC) ++ (void) fprintf(stderr, " [+|-M]"); ++#endif /* !defined(HASNOTRPC) */ ++ + (void) fprintf(stderr, +- " [+|-M] [-o [o]] [-p s]\n[+|-r [t]]%s [-S [t]] [-T [t]]", ++ " [-o [o]] [-p s]\n[+|-r [t]]%s [-S [t]] [-T [t]]", + + #if defined(HASTCPUDPSTATE) + " [-s [p:s]]" +@@ -690,16 +694,19 @@ + # endif /* defined(HASMNTSUP) */ + #endif /* defined(HASMOPT) || defined(HASMNTSUP) */ + ++#if !defined(HASNOTRPC) + (void) snpf(buf, sizeof(buf), "+|-M portMap registration (%s)", +- +-#if defined(HASPMAPENABLED) ++# if defined(HASPMAPENABLED) + "+" +-#else /* !defined(HASPMAPENABLED) */ ++# else /* !defined(HASPMAPENABLED) */ + "-" +-#endif /* defined(HASPMAPENABLED) */ +- ++# endif /* defined(HASPMAPENABLED) */ + ); ++#else /* defined(HASNOTRPC) */ ++ buf[0] = '\0'; ++#endif /* defined(HASNOTRPC) */ + (void) fprintf(stderr, " %-36.36s", buf); ++ + (void) snpf(buf, sizeof(buf), "-o o o 0t offset digits (%d)", + OFFDECDIG); + (void) fprintf(stderr, " %s\n", buf); diff --git a/sys-process/lsof/lsof-4.84-r1.ebuild b/sys-process/lsof/lsof-4.84-r1.ebuild new file mode 100644 index 000000000000..d9d9ea808c66 --- /dev/null +++ b/sys-process/lsof/lsof-4.84-r1.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/lsof/lsof-4.84-r1.ebuild,v 1.1 2011/09/17 22:55:12 vapier Exp $ + +EAPI="2" + +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://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="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="ipv6 rpc selinux static" + +RDEPEND="rpc? ( net-libs/libtirpc ) + selinux? ( sys-libs/libselinux )" +DEPEND="${RDEPEND}" + +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.84-rpc.patch #370833 + # 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 +} + +usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; } +target() { usex kernel_FreeBSD freebsd linux ; } +src_configure() { + use static && append-ldflags -static + + append-cppflags $(usex rpc "$($(tc-getPKG_CONFIG) libtirpc --cflags)" -DHASNOTRPC) + 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 + + insinto /usr/share/lsof/scripts + doins scripts/* || die + + doman lsof.8 || die + dodoc 00* +} diff --git a/sys-process/lsof/metadata.xml b/sys-process/lsof/metadata.xml index 96a2d586367d..49fb858fab9c 100644 --- a/sys-process/lsof/metadata.xml +++ b/sys-process/lsof/metadata.xml @@ -2,4 +2,7 @@ <!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> |