1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit readme.gentoo systemd
7 DESCRIPTION="Arno's iptables firewall script"
8 HOMEPAGE="http://rocky.eld.leidenuniv.nl"
9 SRC_URI="http://rocky.eld.leidenuniv.nl/${PN}/${PN}_${PV}.tar.gz"
16 # sys-apps/coreutils dependency wrt
17 # https://bugs.gentoo.org/show_bug.cgi?id=448716
20 RDEPEND="net-firewall/iptables
21 || ( <sys-apps/coreutils-8.20 >sys-apps/coreutils-8.20-r1 )
23 plugins? ( net-dns/bind-tools )"
25 S="${WORKDIR}/${PN}_${PV}"
27 DISABLE_AUTOFORMATTING="yes"
28 DOC_CONTENTS="You will need to configure /etc/${PN}/firewall.conf
29 before using this package. To start the script, run:
31 /etc/init.d/${PN} start (for OpenRC)
32 systemctl start ${PN} (for systemd)
34 If you want to start this script at boot, run:
36 rc-update add ${PN} default (for OpenRC)
37 systemctl enable ${PN} (for systemd)"
40 sed -i -e 's:/usr/local/share/:/usr/libexec/:' \
41 etc/"${PN}"/firewall.conf || die "Sed failed!"
42 sed -i -e 's:/usr/local/sbin/:/usr/sbin/:' \
43 lib/systemd/system/"${PN}.service" || die "Sed failed!"
48 doins etc/"${PN}"/firewall.conf
49 doins etc/"${PN}"/custom-rules
51 doinitd "${FILESDIR}/${PN}"
52 systemd_dounit lib/systemd/system/"${PN}.service"
54 dobin bin/arno-fwfilter
57 insinto /usr/libexec/"${PN}"
58 doins share/"${PN}"/environment
60 dodoc CHANGELOG README
61 readme.gentoo_create_doc
65 insinto /etc/"${PN}"/plugins
66 doins etc/"${PN}"/plugins/*
68 insinto /usr/libexec/"${PN}"/plugins
69 doins share/"${PN}"/plugins/*.plugin
71 exeinto /usr/libexec/"${PN}"/plugins
72 doexe share/"${PN}"/plugins/dyndns-host-open-helper
73 doexe share/"${PN}"/plugins/traffic-accounting-helper
74 doexe share/"${PN}"/plugins/traffic-accounting-log-rotate
75 doexe share/"${PN}"/plugins/traffic-accounting-show
78 dodoc share/"${PN}"/plugins/*.CHANGELOG
81 doman share/man/man1/arno-fwfilter.1 \
82 share/man/man8/"${PN}".8
86 ewarn "When you stop this script, all firewall rules are flushed!"
87 ewarn "Make sure to not use multiple firewall scripts simultaneously"
88 ewarn "unless you know what you are doing!"
89 readme.gentoo_print_elog