1 |
commit: 0ce0b829e5b2cb3439e9f82be9e2ea62e5b6f7bc |
2 |
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 19 18:35:18 2018 +0000 |
4 |
Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 19 18:35:35 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ce0b829 |
7 |
|
8 |
net-firewall/nftables: move nft skels to doc |
9 |
|
10 |
Closes: https://bugs.gentoo.org/671254 |
11 |
Package-Manager: Portage-2.3.51, Repoman-2.3.12 |
12 |
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org> |
13 |
|
14 |
net-firewall/nftables/nftables-0.9.0-r1.ebuild | 89 ++++++++++++++++++++++++++ |
15 |
1 file changed, 89 insertions(+) |
16 |
|
17 |
diff --git a/net-firewall/nftables/nftables-0.9.0-r1.ebuild b/net-firewall/nftables/nftables-0.9.0-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..9d4e47a42ae |
20 |
--- /dev/null |
21 |
+++ b/net-firewall/nftables/nftables-0.9.0-r1.ebuild |
22 |
@@ -0,0 +1,89 @@ |
23 |
+# Copyright 1999-2018 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=6 |
27 |
+ |
28 |
+inherit autotools linux-info systemd |
29 |
+ |
30 |
+DESCRIPTION="Linux kernel (3.13+) firewall, NAT and packet mangling tools" |
31 |
+HOMEPAGE="https://netfilter.org/projects/nftables/" |
32 |
+SRC_URI="https://git.netfilter.org/nftables/snapshot/v${PV}.tar.gz -> ${P}.tar.gz" |
33 |
+ |
34 |
+LICENSE="GPL-2" |
35 |
+SLOT="0" |
36 |
+KEYWORDS="~amd64 ~arm ~ia64 ~x86" |
37 |
+IUSE="debug doc +gmp json +readline" |
38 |
+ |
39 |
+RDEPEND=">=net-libs/libmnl-1.0.3:0= |
40 |
+ gmp? ( dev-libs/gmp:0= ) |
41 |
+ json? ( dev-libs/jansson ) |
42 |
+ readline? ( sys-libs/readline:0= ) |
43 |
+ >=net-libs/libnftnl-1.1.1:0=" |
44 |
+ |
45 |
+DEPEND="${RDEPEND} |
46 |
+ >=app-text/docbook2X-0.8.8-r4 |
47 |
+ doc? ( >=app-text/dblatex-0.3.7 ) |
48 |
+ sys-devel/bison |
49 |
+ sys-devel/flex |
50 |
+ virtual/pkgconfig" |
51 |
+ |
52 |
+S="${WORKDIR}/v${PV}" |
53 |
+ |
54 |
+pkg_setup() { |
55 |
+ if kernel_is ge 3 13; then |
56 |
+ CONFIG_CHECK="~NF_TABLES" |
57 |
+ linux-info_pkg_setup |
58 |
+ else |
59 |
+ eerror "This package requires kernel version 3.13 or newer to work properly." |
60 |
+ fi |
61 |
+} |
62 |
+ |
63 |
+src_prepare() { |
64 |
+ default |
65 |
+ eautoreconf |
66 |
+} |
67 |
+ |
68 |
+src_configure() { |
69 |
+ local myeconfargs=( |
70 |
+ --sbindir="${EPREFIX}"/sbin |
71 |
+ $(use_enable debug) |
72 |
+ $(use_enable doc pdf-doc) |
73 |
+ $(use_with !gmp mini_gmp) |
74 |
+ $(use_with json) |
75 |
+ $(use_with readline cli) |
76 |
+ ) |
77 |
+ econf "${myeconfargs[@]}" |
78 |
+} |
79 |
+ |
80 |
+src_install() { |
81 |
+ default |
82 |
+ |
83 |
+ exeinto /usr/libexec/${PN} |
84 |
+ doexe "${FILESDIR}"/libexec/${PN}.sh |
85 |
+ |
86 |
+ newconfd "${FILESDIR}"/${PN}.confd ${PN} |
87 |
+ newinitd "${FILESDIR}"/${PN}.init ${PN} |
88 |
+ keepdir /var/lib/nftables |
89 |
+ |
90 |
+ systemd_dounit "${FILESDIR}"/systemd/${PN}-restore.service |
91 |
+ systemd_enable_service basic.target ${PN}-restore.service |
92 |
+ |
93 |
+ docinto /usr/share/doc/${PF}/skels |
94 |
+ dodoc /etc/nftables/* |
95 |
+ rm -R "${D}"/etc/nftables |
96 |
+} |
97 |
+ |
98 |
+pkg_postinst() { |
99 |
+ local save_file |
100 |
+ save_file="${EROOT%/}/var/lib/nftables/rules-save" |
101 |
+ |
102 |
+ # In order for the nftables-restore systemd service to start |
103 |
+ # the save_file must exist. |
104 |
+ if [[ ! -f ${save_file} ]]; then |
105 |
+ touch ${save_file} |
106 |
+ fi |
107 |
+ |
108 |
+ elog "If you are creating firewall rules before the next system restart " |
109 |
+ elog "the nftables-restore service must be manually started in order to " |
110 |
+ elog "save those rules on shutdown." |
111 |
+} |