net-firewall/nftables: add xml USE flag
authorNicholas Vinson <nvinson234@gmail.com>
Tue, 20 Dec 2016 15:53:21 +0000 (07:53 -0800)
committerRobin H. Johnson <robbat2@gentoo.org>
Sat, 7 Jan 2017 21:46:02 +0000 (13:46 -0800)
libnftnl-1.0.7 no longer supports outputing the firewall state as XML.
If a user wants that output, the user must use libnftnl-1.0.6.
Therefore, I added the xml USE flag so I could restrict libnftnl to
1.0.6 when xml is enabled and allow newer versions to be used when it is
not.

Unforunately, nftables unconditionally compiles support for xml output,
so when xml use is attempted with a version of libnftnl that does not
support it, the result is just an empty file.

Package-Manager: Portage-2.3.3, Repoman-2.3.1

net-firewall/nftables/nftables-0.6-r4.ebuild

index 7874baf0062b88d13c3793dea077810503f79ec8..5750a3a7881ff2203614e637942204e7b63e2979 100644 (file)
@@ -13,12 +13,13 @@ SRC_URI="http://git.netfilter.org/nftables/snapshot/v${PV}.tar.gz -> ${P}.tar.gz
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~arm ~x86"
-IUSE="debug doc gmp +readline"
+IUSE="debug doc gmp +readline xml"
 
 RDEPEND=">=net-libs/libmnl-1.0.3
-       >=net-libs/libnftnl-1.0.6
        gmp? ( dev-libs/gmp:0= )
-       readline? ( sys-libs/readline:0= )"
+       readline? ( sys-libs/readline:0= )
+       >=net-libs/libnftnl-1.0.6[xml(-)?]
+       "
 DEPEND="${RDEPEND}
        >=app-text/docbook2X-0.8.8-r4
        doc? ( >=app-text/dblatex-0.3.7 )
@@ -73,7 +74,7 @@ src_install() {
 
 pkg_postinst() {
        local save_file
-       save_file="${EROOT}var/lib/nftables/rules-save"
+       save_file="${EROOT%/}/var/lib/nftables/rules-save"
 
        elog "In order for the nftables-restore systemd service to start, "
        elog "the file, ${save_file}, must exist.  To create this "