1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit readme.gentoo-r1 systemd
7 DESCRIPTION="Arno's iptables firewall script"
8 HOMEPAGE="https://rocky.eld.leidenuniv.nl"
12 SRC_URI="https://github.com/${PN}/aif/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="+plugins rsyslog"
20 RDEPEND="net-firewall/ipset
24 plugins? ( net-dns/bind-tools )"
26 S="${WORKDIR}/aif-${MY_PV}"
28 DISABLE_AUTOFORMATTING="yes"
29 DOC_CONTENTS="You will need to configure /etc/${PN}/firewall.conf
30 before using this package. To start the script, run:
32 /etc/init.d/${PN} start (for OpenRC)
33 systemctl start ${PN} (for systemd)
35 If you want to start this script at boot, run:
37 rc-update add ${PN} default (for OpenRC)
38 systemctl enable ${PN} (for systemd)"
41 sed -i -e 's:/usr/local/share/:/usr/libexec/:' \
42 etc/"${PN}"/firewall.conf || die "Sed failed!"
43 sed -i -e 's:/usr/local/sbin/:/usr/sbin/:' \
44 lib/systemd/system/"${PN}.service" || die "Sed failed!"
50 doins etc/"${PN}"/firewall.conf
51 doins etc/"${PN}"/custom-rules
53 doinitd "${FILESDIR}/${PN}"
54 systemd_dounit lib/systemd/system/"${PN}.service"
56 dobin bin/arno-fwfilter
59 insinto /usr/libexec/"${PN}"
60 doins share/"${PN}"/environment
62 dodoc CHANGELOG README
63 readme.gentoo_create_doc
67 insinto /etc/"${PN}"/plugins
68 doins etc/"${PN}"/plugins/*
70 insinto /usr/libexec/"${PN}"/plugins
71 doins share/"${PN}"/plugins/*.plugin
73 exeinto /usr/libexec/"${PN}"/plugins
74 doexe share/"${PN}"/plugins/dyndns-host-open-helper
75 doexe share/"${PN}"/plugins/traffic-accounting-helper
76 doexe share/"${PN}"/plugins/traffic-accounting-log-rotate
77 doexe share/"${PN}"/plugins/traffic-accounting-show
80 dodoc share/"${PN}"/plugins/*.CHANGELOG
85 insinto /etc/rsyslog.d
86 newins etc/rsyslog.d/"${PN}".conf 60-"${PN}".conf
89 doman share/man/man1/arno-fwfilter.1 \
90 share/man/man8/"${PN}".8
94 ewarn "When you stop this script, all firewall rules are flushed!"
95 ewarn "Make sure to not use multiple firewall scripts simultaneously"
96 ewarn "unless you know what you are doing!"
97 readme.gentoo_print_elog