net-nds/rpcbind: mark 0.2.4-r1 arm64/s390/sh stable
[gentoo.git] / net-firewall / arno-iptables-firewall / arno-iptables-firewall-2.0.1e.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 inherit readme.gentoo systemd
6
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"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="amd64 x86"
14 IUSE="+plugins"
15
16 # sys-apps/coreutils dependency wrt
17 # https://bugs.gentoo.org/show_bug.cgi?id=448716
18
19 DEPEND=""
20 RDEPEND="net-firewall/iptables
21         || ( <sys-apps/coreutils-8.20 >sys-apps/coreutils-8.20-r1 )
22         sys-apps/iproute2
23         plugins? ( net-dns/bind-tools )"
24
25 S="${WORKDIR}/${PN}_${PV}"
26
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:
30
31 /etc/init.d/${PN} start (for OpenRC)
32 systemctl start ${PN} (for systemd)
33
34 If you want to start this script at boot, run:
35
36 rc-update add ${PN} default (for OpenRC)
37 systemctl enable ${PN} (for systemd)"
38
39 src_prepare() {
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!"
44 }
45
46 src_install() {
47         insinto /etc/"${PN}"
48         doins etc/"${PN}"/firewall.conf
49         doins etc/"${PN}"/custom-rules
50
51         doinitd "${FILESDIR}/${PN}"
52         systemd_dounit lib/systemd/system/"${PN}.service"
53
54         dobin bin/arno-fwfilter
55         dosbin bin/"${PN}"
56
57         insinto /usr/libexec/"${PN}"
58         doins share/"${PN}"/environment
59
60         dodoc CHANGELOG README
61         readme.gentoo_create_doc
62
63         if use plugins
64         then
65                 insinto /etc/"${PN}"/plugins
66                 doins etc/"${PN}"/plugins/*
67
68                 insinto /usr/libexec/"${PN}"/plugins
69                 doins share/"${PN}"/plugins/*.plugin
70
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
76
77                 docinto plugins
78                 dodoc share/"${PN}"/plugins/*.CHANGELOG
79         fi
80
81         doman share/man/man1/arno-fwfilter.1 \
82                 share/man/man8/"${PN}".8
83 }
84
85 pkg_postinst () {
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
90 }