7b3d76781e6d4d8fa7230f3b0ff62023211469b3
[gentoo.git] / sys-process / psmisc / psmisc-23.1-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 DESCRIPTION="A set of tools that use the proc filesystem"
7 HOMEPAGE="http://psmisc.sourceforge.net/"
8 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
9
10 LICENSE="GPL-2"
11 SLOT="0"
12 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
13 IUSE="ipv6 nls selinux X"
14
15 RDEPEND=">=sys-libs/ncurses-5.7-r7:0=
16         nls? ( virtual/libintl )
17         selinux? ( sys-libs/libselinux )"
18 DEPEND="${RDEPEND}
19         >=sys-devel/libtool-2.2.6b
20         nls? ( sys-devel/gettext )"
21
22 DOCS=( AUTHORS ChangeLog NEWS README )
23
24 src_configure() {
25         local myeconfargs=(
26                 $(use_enable selinux)
27                 --disable-harden-flags
28                 $(use_enable ipv6)
29                 $(use_enable nls)
30         )
31         econf "${myeconfargs[@]}"
32 }
33
34 src_compile() {
35         # peekfd is a fragile crap hack #330631
36         nonfatal emake -C src peekfd || touch src/peekfd{.o,}
37         emake
38 }
39
40 src_install() {
41         default
42
43         use X || rm -f "${ED%/}"/usr/bin/pstree.x11
44
45         [[ -s ${ED%/}/usr/bin/peekfd ]] || rm -f "${ED%/}"/usr/bin/peekfd
46         [[ -e ${ED%/}/usr/bin/peekfd ]] || rm -f "${ED%/}"/usr/share/man/man1/peekfd.1
47
48         # fuser is needed by init.d scripts; use * wildcard for #458250
49         dodir /bin
50         mv "${ED%/}"/usr/bin/*fuser "${ED%/}"/bin || die
51 }