Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-process/lsof/
Date: Sat, 28 Feb 2015 19:57:11
Message-Id: 1425153534.452eb2ecc72cc3ea1fc30e3532fb7f9e2289ad2c.blueness@gentoo
1 commit: 452eb2ecc72cc3ea1fc30e3532fb7f9e2289ad2c
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 28 19:58:54 2015 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 28 19:58:54 2015 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=452eb2ec
7
8 sys-process/lsof: update to 4.87
9
10 ---
11 sys-process/lsof/lsof-4.87-r99.ebuild | 98 +++++++++++++++++++++++++++++++++++
12 1 file changed, 98 insertions(+)
13
14 diff --git a/sys-process/lsof/lsof-4.87-r99.ebuild b/sys-process/lsof/lsof-4.87-r99.ebuild
15 new file mode 100644
16 index 0000000..9cda930
17 --- /dev/null
18 +++ b/sys-process/lsof/lsof-4.87-r99.ebuild
19 @@ -0,0 +1,98 @@
20 +# Copyright 1999-2014 Gentoo Foundation
21 +# Distributed under the terms of the GNU General Public License v2
22 +# $Header: /var/cvsroot/gentoo-x86/sys-process/lsof/lsof-4.87-r1.ebuild,v 1.13 2014/12/06 16:38:45 ago Exp $
23 +
24 +EAPI="4"
25 +
26 +inherit eutils flag-o-matic toolchain-funcs
27 +
28 +MY_P=${P/-/_}
29 +DESCRIPTION="Lists open files for running Unix processes"
30 +HOMEPAGE="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
31 +SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
32 + ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD/${MY_P}.tar.bz2"
33 +
34 +LICENSE="lsof"
35 +SLOT="0"
36 +KEYWORDS="alpha amd64 arm ~arm64 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"
37 +IUSE="examples ipv6 rpc selinux static"
38 +
39 +RDEPEND="rpc? ( net-libs/libtirpc )
40 + selinux? ( sys-libs/libselinux )"
41 +DEPEND="${RDEPEND}
42 + rpc? ( virtual/pkgconfig )"
43 +
44 +S=${WORKDIR}/${MY_P}/${MY_P}_src
45 +
46 +src_unpack() {
47 + unpack ${A}
48 + cd ${MY_P}
49 + unpack ./${MY_P}_src.tar
50 +}
51 +
52 +src_prepare() {
53 + epatch "${FILESDIR}"/${PN}-4.85-fix-missing-netinet_tcp_h.patch #for musl
54 + epatch "${FILESDIR}"/${PN}-4.85-cross.patch #432120
55 + # convert `test -r header.h` into a compile test
56 + sed -i -r \
57 + -e 's:test -r \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\1>" | ${LSOF_CC} ${LSOF_CFGF} -E - >/dev/null 2>\&1:' \
58 + -e 's:grep (.*) \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\2>" | ${LSOF_CC} ${LSOF_CFGF} -E -P -dD - 2>/dev/null | grep \1:' \
59 + Configure || die
60 +}
61 +
62 +target() {
63 + case ${CHOST} in
64 + *-darwin*) echo darwin ;;
65 + *-freebsd*) echo freebsd ;;
66 + *-solaris*) echo solaris ;;
67 + *-aix*) echo aixgcc ;;
68 + *) echo linux ;;
69 + esac
70 +}
71 +
72 +src_configure() {
73 + use static && append-ldflags -static
74 +
75 + append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H")
76 + append-cppflags $(usex ipv6 -{D,U}HASIPv6)
77 +
78 + export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \
79 + $(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)"
80 +
81 + # Set LSOF_INCLUDE to a dummy location so the script doesn't poke
82 + # around in it and mix /usr/include paths with cross-compile/etc.
83 + touch .neverInv
84 + LINUX_HASSELINUX=$(usex selinux y n) \
85 + LSOF_INCLUDE=${T} \
86 + LSOF_CC=$(tc-getCC) \
87 + LSOF_AR="$(tc-getAR) rc" \
88 + LSOF_RANLIB=$(tc-getRANLIB) \
89 + LSOF_CFGF="${CFLAGS} ${CPPFLAGS}" \
90 + ./Configure -n $(target) || die
91 +}
92 +
93 +src_compile() {
94 + emake DEBUG="" all
95 +}
96 +
97 +src_install() {
98 + dobin lsof
99 +
100 + if use examples ; then
101 + insinto /usr/share/lsof/scripts
102 + doins scripts/*
103 + fi
104 +
105 + doman lsof.8
106 + dodoc 00*
107 +}
108 +
109 +pkg_postinst() {
110 + if [[ ${CHOST} == *-solaris* ]] ; then
111 + einfo "Note: to use lsof on Solaris you need read permissions on"
112 + einfo "/dev/kmem, i.e. you need to be root, or to be in the group sys"
113 + elif [[ ${CHOST} == *-aix* ]] ; then
114 + einfo "Note: to use lsof on AIX you need read permissions on /dev/mem and"
115 + einfo "/dev/kmem, i.e. you need to be root, or to be in the group system"
116 + fi
117 +}