1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
8 PYTHON_COMPAT=( python{2_7,3_6} )
10 inherit autotools-utils flag-o-matic python-r1
12 DESCRIPTION="POSIX 1003.1e capabilities"
13 HOMEPAGE="https://people.redhat.com/sgrubb/libcap-ng/"
14 SRC_URI="https://people.redhat.com/sgrubb/${PN}/${P}.tar.gz"
18 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-linux"
19 IUSE="python static-libs"
20 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
22 RDEPEND="python? ( ${PYTHON_DEPS} )"
24 sys-kernel/linux-headers
25 python? ( >=dev-lang/swig-2 )"
30 sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die
32 autotools-utils_src_prepare
34 use sparc && replace-flags -O? -O0
38 # set up the library build
39 local myeconfargs=( --without-python --without-python3 )
40 autotools-utils_src_configure
42 # set up python bindings build(s)
44 setup_python_flags_configure() {
45 if [[ ${EPYTHON} == python2* ]] ; then
46 myeconfargs=( --with-python --without-python3 )
48 myeconfargs=( --with-python --with-python3 )
50 autotools-utils_src_configure
53 python_foreach_impl setup_python_flags_configure
58 autotools-utils_src_compile
62 local CFLAGS=${CFLAGS}
64 python_is_python3 || CFLAGS+=" -fno-strict-aliasing"
67 -C "${BUILD_DIR}"/bindings/python
70 # help build system find the right objects
71 python_foreach_impl python_compile \
72 VPATH="${BUILD_DIR}"/bindings/python \
73 LIBS="${BUILD_DIR}"/src/libcap-ng.la
78 if [[ "${EUID}" -eq 0 ]]; then
79 ewarn "Skipping tests due to root permissions."
83 autotools-utils_src_test
87 autotools-utils_src_compile -C bindings/python check \
88 VPATH="${BUILD_DIR}"/bindings/python:"${S}"/bindings/python/test
93 autotools-utils_src_install
97 autotools-utils_src_install -C bindings/python \
98 VPATH="${BUILD_DIR}"/bindings/python