Index: lsof-4.85-r2.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-process/lsof/lsof-4.85-r2.ebuild,v retrieving revision 1.4 diff -u -r1.4 lsof-4.85-r2.ebuild --- lsof-4.85-r2.ebuild 24 Apr 2012 06:24:52 -0000 1.4 +++ lsof-4.85-r2.ebuild 24 Apr 2012 09:13:09 -0000 @@ -2,7 +2,7 @@ # 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.4 2012/04/24 06:24:52 jdhore Exp $ -EAPI="2" +EAPI="3" inherit eutils flag-o-matic toolchain-funcs @@ -15,7 +15,7 @@ LICENSE="lsof" SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x64-solaris ~x86-solaris" IUSE="examples ipv6 rpc selinux static" RDEPEND="rpc? ( net-libs/libtirpc ) @@ -32,6 +32,7 @@ src_prepare() { epatch "${FILESDIR}"/${P}-arg.c.patch #388555 + epatch "${FILESDIR}"/${PN}-4.85-aixgcc.patch #405973 # 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:' \ @@ -39,7 +40,16 @@ Configure || die } -target() { usex kernel_FreeBSD freebsd linux ; } +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 @@ -76,3 +86,13 @@ doman lsof.8 || die 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 +} Index: files/lsof-4.85-aixgcc.patch =================================================================== RCS file: files/lsof-4.85-aixgcc.patch diff -N files/lsof-4.85-aixgcc.patch --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/lsof-4.85-aixgcc.patch 24 Apr 2012 09:13:09 -0000 @@ -0,0 +1,78 @@ +Improve support for gcc on AIX. + +* Configure: + - Detect version of gcc even if LSOF_CC was set. + - Use linker flag '-bnolibpath' even with gcc. + - Need to avoid undefined printf warning. + +* dialects/aix/machine.h: + - Need to avoid undefined bzero warning. + +--- Configure.orig 2012-04-24 09:29:35 +0200 ++++ Configure 2012-04-24 10:43:45 +0200 +@@ -434,11 +434,14 @@ + if test "X$LSOF_TGT" = "Xaixgcc" # { + then + LSOF_CC=gcc +- LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'` + else + LSOF_CC=cc + fi # } + fi # } ++ if test "X$LSOF_TGT" = "Xaixgcc" -a "X$LSOF_CCV" = "X" # { ++ then ++ LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'` ++ fi # } + LSOF_TGT="aix" + echo $LSOF_CC | grep gcc > /dev/null + if test $? -eq 0 # { +@@ -544,10 +547,12 @@ + then + LSOF_CFGF="$LSOF_CFGF -DHAS_NFS" + fi # } +- echo $LSOF_CC | grep cc | grep -v gcc > /dev/null +- if test $? -eq 0 -a $LSOF_VERS -ge 4140 -a $LSOF_VERS -lt 5000 # { ++ if test $LSOF_VERS -ge 4140 -a $LSOF_VERS -lt 5000 # { + then +- LSOF_CFGL="$LSOF_CFGL -bnolibpath" ++ case $LSOF_CC in # { ++ *gcc*) LSOF_CFGL="$LSOF_CFGL -Wl,-bnolibpath" ;; ++ *cc*) LSOF_CFGL="$LSOF_CFGL -bnolibpath" ;; ++ esac # } + fi # } + if test -r ${LSOF_INCLUDE}/sys/socket.h # { + then +@@ -662,11 +667,10 @@ + + # This is AIX >= 5 on Power architecture. + +- echo $LSOF_CC | grep cc | grep -v gcc > /dev/null +- if test $? -eq 0 # { +- then +- LSOF_CFGL="$LSOF_CFGL -bnolibpath" +- fi # } ++ case $LSOF_CC in # { ++ *gcc*) LSOF_CFGL="$LSOF_CFGL -Wl,-bnolibpath" ;; ++ *cc*) LSOF_CFGL="$LSOF_CFGL -bnolibpath" ;; ++ esac # } + if test "X$AIX_KERNBITS" = "X" # { + then + +@@ -675,6 +679,7 @@ + + rm -f ${LSOF_TMPC}.* + echo "#include " > ${LSOF_TMPC}.c ++ echo "#include " >> ${LSOF_TMPC}.c + echo '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 +--- dialects/aix/machine.h.orig 2012-04-24 10:46:36 +0200 ++++ dialects/aix/machine.h 2012-04-24 10:47:33 +0200 +@@ -68,6 +68,7 @@ + # endif /* AIXV>=4300 */ + + #include ++#include /* for bzero */ + + # if AIXA>0 + #include