4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
6 |
DISTUTILS_OPTIONAL=1
|
7 |
|
PYTHON_COMPAT=( python3_{9..11} )
|
|
7 |
DISTUTILS_USE_PEP517=setuptools
|
|
8 |
PYTHON_COMPAT=( python3_{10..11} )
|
8 |
9 |
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/netfilter.org.asc
|
9 |
10 |
inherit edo linux-info distutils-r1 systemd verify-sig
|
10 |
11 |
|
... | ... | |
18 |
19 |
else
|
19 |
20 |
SRC_URI="https://netfilter.org/projects/nftables/files/${P}.tar.xz
|
20 |
21 |
verify-sig? ( https://netfilter.org/projects/nftables/files/${P}.tar.xz.sig )"
|
21 |
|
KEYWORDS="amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
|
|
22 |
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
|
22 |
23 |
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-netfilter )"
|
23 |
24 |
fi
|
24 |
25 |
|
25 |
26 |
# See COPYING: new code is GPL-2+, existing code is GPL-2
|
26 |
27 |
LICENSE="GPL-2 GPL-2+"
|
27 |
28 |
SLOT="0/1"
|
28 |
|
IUSE="debug doc +gmp json libedit +modern-kernel python +readline static-libs test xtables"
|
|
29 |
IUSE="debug doc +gmp json libedit python +readline static-libs test xtables"
|
29 |
30 |
RESTRICT="!test? ( test )"
|
30 |
31 |
|
31 |
32 |
RDEPEND="
|
32 |
33 |
>=net-libs/libmnl-1.0.4:=
|
33 |
|
>=net-libs/libnftnl-1.2.5:=
|
|
34 |
>=net-libs/libnftnl-1.2.6:=
|
34 |
35 |
gmp? ( dev-libs/gmp:= )
|
35 |
36 |
json? ( dev-libs/jansson:= )
|
36 |
37 |
python? ( ${PYTHON_DEPS} )
|
37 |
38 |
readline? ( sys-libs/readline:= )
|
38 |
39 |
xtables? ( >=net-firewall/iptables-1.6.1:= )
|
39 |
40 |
"
|
40 |
|
|
41 |
41 |
DEPEND="${RDEPEND}"
|
42 |
|
|
43 |
42 |
BDEPEND+="
|
44 |
43 |
sys-devel/flex
|
45 |
44 |
virtual/pkgconfig
|
... | ... | |
47 |
46 |
app-text/asciidoc
|
48 |
47 |
>=app-text/docbook2X-0.8.8-r4
|
49 |
48 |
)
|
50 |
|
python? ( ${PYTHON_DEPS} )
|
|
49 |
python? ( ${DISTUTILS_DEPS} )
|
51 |
50 |
"
|
52 |
51 |
|
53 |
52 |
REQUIRED_USE="
|
... | ... | |
55 |
54 |
libedit? ( !readline )
|
56 |
55 |
"
|
57 |
56 |
|
58 |
|
pkg_setup() {
|
59 |
|
if kernel_is ge 3 13; then
|
60 |
|
if use modern-kernel && kernel_is lt 3 18; then
|
61 |
|
eerror "The modern-kernel USE flag requires kernel version 3.18 or newer to work properly."
|
62 |
|
fi
|
63 |
|
CONFIG_CHECK="~NF_TABLES"
|
64 |
|
linux-info_pkg_setup
|
65 |
|
else
|
66 |
|
eerror "This package requires kernel version 3.13 or newer to work properly."
|
67 |
|
fi
|
68 |
|
}
|
69 |
|
|
70 |
57 |
src_prepare() {
|
71 |
58 |
default
|
72 |
59 |
|
... | ... | |
145 |
132 |
mv "${ED}"/etc/nftables/osf "${ED}"/usr/share/doc/${PF}/skels/osf || die
|
146 |
133 |
rmdir "${ED}"/etc/nftables || die
|
147 |
134 |
|
148 |
|
local mksuffix="$(usex modern-kernel '-mk' '')"
|
149 |
|
|
150 |
135 |
exeinto /usr/libexec/${PN}
|
151 |
|
newexe "${FILESDIR}"/libexec/${PN}${mksuffix}.sh ${PN}.sh
|
152 |
|
newconfd "${FILESDIR}"/${PN}${mksuffix}.confd ${PN}
|
153 |
|
newinitd "${FILESDIR}"/${PN}${mksuffix}.init-r1 ${PN}
|
|
136 |
newexe "${FILESDIR}"/libexec/${PN}-mk.sh ${PN}.sh
|
|
137 |
newconfd "${FILESDIR}"/${PN}-mk.confd ${PN}
|
|
138 |
newinitd "${FILESDIR}"/${PN}-mk.init-r1 ${PN}
|
154 |
139 |
keepdir /var/lib/nftables
|
155 |
140 |
|
156 |
141 |
systemd_dounit "${FILESDIR}"/systemd/${PN}-restore.service
|