1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_{6,7}} )
8 inherit autotools flag-o-matic python-r1
10 DESCRIPTION="POSIX 1003.1e capabilities"
11 HOMEPAGE="https://people.redhat.com/sgrubb/libcap-ng/"
12 SRC_URI="https://people.redhat.com/sgrubb/${PN}/${P}.tar.gz"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~x86-linux"
17 IUSE="python static-libs"
18 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
20 RDEPEND="python? ( ${PYTHON_DEPS} )"
22 sys-kernel/linux-headers
23 python? ( >=dev-lang/swig-2 )"
28 sed -i "s@cat /usr@cat ${EPREFIX}/usr@" bindings/python*/Makefile.am || die
34 use sparc && replace-flags -O? -O0
36 local ECONF_SOURCE="${S}"
39 $(use_enable static-libs static)
42 local pythonconf=( --without-python --without-python3 )
44 # set up python bindings build(s)
46 setup_python_flags_configure() {
47 if python_is_python3; then
48 pythonconf=( --without-python --with-python3 )
50 pythonconf=( --with-python --without-python3 )
51 local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
53 run_in_build_dir econf "${pythonconf[@]}" "${myconf[@]}"
56 python_foreach_impl setup_python_flags_configure
58 local BUILD_DIR=${WORKDIR}/build
59 run_in_build_dir econf "${pythonconf[@]}" "${myconf[@]}"
65 python_foreach_impl run_in_build_dir emake
67 local BUILD_DIR=${WORKDIR}/build
68 emake -C "${BUILD_DIR}"
73 if [[ "${EUID}" -eq 0 ]]; then
74 ewarn "Skipping tests due to root permissions."
79 python_foreach_impl run_in_build_dir emake check
81 local BUILD_DIR=${WORKDIR}/build
82 emake -C "${BUILD_DIR}" check
88 python_foreach_impl run_in_build_dir emake DESTDIR="${D}" install
90 local BUILD_DIR=${WORKDIR}/build
91 emake -C "${BUILD_DIR}" DESTDIR="${D}" install
93 find "${ED}" -name '*.la' -delete || die