| 6 |
6 |
# Keep an eye on Fedora's packaging (https://src.fedoraproject.org/rpms/libcap-ng/tree/rawhide) for patches
|
| 7 |
7 |
# Same maintainer in Fedora as upstream
|
| 8 |
8 |
PYTHON_COMPAT=( python3_{11..14} )
|
| 9 |
|
inherit autotools dot-a flag-o-matic out-of-source-utils python-r1
|
|
9 |
inherit autotools dot-a flag-o-matic linux-info out-of-source-utils python-r1
|
| 10 |
10 |
|
| 11 |
11 |
DESCRIPTION="POSIX 1003.1e capabilities"
|
| 12 |
12 |
HOMEPAGE="https://people.redhat.com/sgrubb/libcap-ng/"
|
| 13 |
|
SRC_URI="https://people.redhat.com/sgrubb/${PN}/${P}.tar.gz"
|
|
13 |
SRC_URI="https://github.com/stevegrubb/libcap-ng/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
|
| 14 |
14 |
|
| 15 |
15 |
LICENSE="GPL-2+ LGPL-2.1+"
|
| 16 |
16 |
SLOT="0"
|
| 17 |
17 |
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
|
| 18 |
|
IUSE="python static-libs"
|
|
18 |
IUSE="bpf deprecated python static-libs"
|
| 19 |
19 |
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
| 20 |
20 |
|
| 21 |
|
RDEPEND="python? ( ${PYTHON_DEPS} )"
|
|
21 |
RDEPEND="
|
|
22 |
bpf? (
|
|
23 |
dev-libs/libbpf:=
|
|
24 |
sys-process/audit
|
|
25 |
)
|
|
26 |
python? ( ${PYTHON_DEPS} )
|
|
27 |
"
|
| 22 |
28 |
DEPEND="
|
| 23 |
29 |
${RDEPEND}
|
| 24 |
30 |
sys-kernel/linux-headers
|
|
31 |
bpf? ( dev-util/bpftool )
|
|
32 |
"
|
|
33 |
BDEPEND="
|
|
34 |
bpf? (
|
|
35 |
llvm-core/clang[llvm_targets_BPF(-)]
|
|
36 |
virtual/pkgconfig
|
|
37 |
)
|
|
38 |
python? ( >=dev-lang/swig-2 )
|
| 25 |
39 |
"
|
| 26 |
|
BDEPEND="python? ( >=dev-lang/swig-2 )"
|
| 27 |
40 |
|
| 28 |
41 |
PATCHES=(
|
| 29 |
|
"${FILESDIR}"/${P}-python.patch
|
|
42 |
"${FILESDIR}"/${PN}-0.9.3-audit-out-of-source-build.patch
|
| 30 |
43 |
)
|
| 31 |
44 |
|
|
45 |
pkg_pretend() {
|
|
46 |
# bug 972898
|
|
47 |
if use bpf && [[ ${MERGE_TYPE} != binary ]] ; then
|
|
48 |
if [[ ! -f /sys/kernel/btf/vmlinux ]] ; then
|
|
49 |
local err="Cannot read /sys/kernel/btf/vmlinux, which is required by bpftool.\n"
|
|
50 |
err+=" Typically this means that your kernel is missing the DEBUG_INFO_BTF option,\n"
|
|
51 |
err+=" without which BPF cannot work. Please build with USE=-bpf or reconfigure your kernel."
|
|
52 |
die "${err}"
|
|
53 |
fi
|
|
54 |
|
|
55 |
# check required kernel flags as documented at:
|
|
56 |
# https://github.com/stevegrubb/libcap-ng/blob/master/README.md
|
|
57 |
local CONFIG_CHECK="
|
|
58 |
~BPF
|
|
59 |
~BPF_SYSCALL
|
|
60 |
~BPF_EVENTS
|
|
61 |
~DEBUG_INFO_BTF
|
|
62 |
~FTRACE_SYSCALLS
|
|
63 |
~KPROBES
|
|
64 |
~KRETPROBES
|
|
65 |
~KPROBE_EVENTS
|
|
66 |
~PERF_EVENTS
|
|
67 |
~STACKTRACE
|
|
68 |
~TRACEPOINTS
|
|
69 |
~TRACING
|
|
70 |
"
|
|
71 |
|
|
72 |
linux-info_pkg_setup
|
|
73 |
fi
|
|
74 |
}
|
|
75 |
|
| 32 |
76 |
src_prepare() {
|
| 33 |
77 |
default
|
| 34 |
78 |
|
| ... | ... | |
| 44 |
88 |
local ECONF_SOURCE="${S}"
|
| 45 |
89 |
|
| 46 |
90 |
local myconf=(
|
|
91 |
$(use_enable bpf cap-audit)
|
|
92 |
$(use_enable deprecated)
|
| 47 |
93 |
$(use_enable static-libs static)
|
| 48 |
94 |
--with-capability_header="${ESYSROOT}"/usr/include/linux/capability.h
|
| 49 |
95 |
)
|