net-firewall/firehol: add 2.0.0_pre6
[moonrise.git] / net-firewall / firehol / firehol-2.0.0_pre6.ebuild
blob9d109f35a4a77986e362b0f36c93d66c50f9fb95
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-firewall/firehol/firehol-1.273-r3.ebuild,v 1.3 2012/08/22 17:01:16 johu Exp $
5 EAPI=4
6 inherit eutils linux-info
8 PPV="${PV/_/-}"
9 PP="${P/_/-}"
10 S="${WORKDIR}/${PP}"
11 DESCRIPTION="iptables firewall generator"
12 HOMEPAGE="http://firehol.sourceforge.net/"
13 SRC_URI="http://firehol.org/download/releases/v${PPV}/${PP}.tar.gz"
14 LICENSE="GPL-2"
15 SLOT="0"
16 IUSE=""
17 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
19 DEPEND="sys-apps/iproute2"
20 RDEPEND="net-firewall/iptables
21 sys-apps/iproute2[-minimal]
22 virtual/modutils
23 || (
24 net-misc/wget
25 net-misc/curl
28 pkg_setup() {
29 local KCONFIG_OPTS="~NF_CONNTRACK_IPV4 ~NF_CONNTRACK_MARK ~NF_NAT ~NF_NAT_FTP ~NF_NAT_IRC \
30 ~IP_NF_IPTABLES ~IP_NF_FILTER ~IP_NF_TARGET_REJECT ~IP_NF_TARGET_LOG ~IP_NF_TARGET_ULOG \
31 ~IP_NF_TARGET_MASQUERADE ~IP_NF_TARGET_REDIRECT ~IP_NF_MANGLE \
32 ~NETFILTER_XT_MATCH_LIMIT ~NETFILTER_XT_MATCH_STATE ~NETFILTER_XT_MATCH_OWNER"
34 get_version
35 if [ ${KV_PATCH} -ge 25 ]; then
36 CONFIG_CHECK="~NF_CONNTRACK ${KCONFIG_OPTS}"
37 else
38 CONFIG_CHECK="~NF_CONNTRACK_ENABLED ${KCONFIG_OPTS}"
40 linux-info_pkg_setup
43 src_install() {
44 emake DESTDIR="${D}" install
45 dodir /etc/firehol /etc/firehol/examples /etc/firehol/services
46 insinto /etc/firehol/examples
47 doins examples/* || die
49 newconfd "${FILESDIR}"/firehol.conf.d firehol
50 newinitd "${FILESDIR}"/firehol.initrd.1 firehol
52 dodoc ChangeLog README NEWS
53 dohtml doc/*.html doc/*.css
55 doman doc/man/man1/*.1 doc/man/man5/*.5
57 # Install this RESERVED_IPS as discussed in bug #332135
58 insinto /etc/firehol
59 doins "${FILESDIR}"/RESERVED_IPS
62 pkg_postinst() {
63 elog "The default path to firehol's configuration file is /etc/firehol/firehol.conf"
64 elog "See /etc/firehol/examples for configuration examples."
66 # Install a default configuration if none is available yet
67 if [[ ! -e "${ROOT}/etc/firehol/firehol.conf" ]]; then
68 einfo "Installing a sample configuration as ${ROOT}/etc/firehol/firehol.conf"
69 cp "${ROOT}/etc/firehol/examples/client-all.conf" "${ROOT}/etc/firehol/firehol.conf"