sys-process/glances: revbump 3.1.4.1, add missing doc dep
[gentoo.git] / net-libs / libnftnl / libnftnl-1.1.5.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools linux-info toolchain-funcs usr-ldscript
7
8 DESCRIPTION="Netlink API to the in-kernel nf_tables subsystem"
9 HOMEPAGE="https://netfilter.org/projects/nftables/"
10 SRC_URI="https://netfilter.org/projects/${PN}/files/${P}.tar.bz2"
11
12 LICENSE="GPL-2"
13 SLOT="0/11" # libnftnl.so version
14 KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~sparc x86"
15 IUSE="examples static-libs test"
16
17 RESTRICT="!test? ( test )"
18
19 RDEPEND=">=net-libs/libmnl-1.0.3"
20 BDEPEND="virtual/pkgconfig"
21 DEPEND="${RDEPEND}"
22
23 PATCHES=( "${FILESDIR}"/${P}-fix-nft-flowtable-test.patch )
24
25 pkg_setup() {
26         if kernel_is ge 3 13; then
27                 CONFIG_CHECK="~NF_TABLES"
28                 linux-info_pkg_setup
29         else
30                 eerror "This package requires kernel version 3.13 or newer to work properly."
31         fi
32 }
33
34 src_configure() {
35         local myeconfargs=(
36                 $(use_enable static-libs static)
37         )
38         econf "${myeconfargs[@]}"
39 }
40
41 src_install() {
42         default
43         gen_usr_ldscript -a nftnl
44         find "${ED}" -type f -name '*.la' -delete || die
45
46         if use examples; then
47                 find examples/ -name 'Makefile*' -delete || die "Could not rm examples"
48                 dodoc -r examples
49                 docompress -x /usr/share/doc/${PF}/examples
50         fi
51 }