summaryrefslogtreecommitdiff
blob: 72996b80094135ca499df3b26fa19fc23cda420c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-firewall/tuxfrw/tuxfrw-2.58-r1.ebuild,v 1.2 2005/07/26 12:00:15 dholm Exp $

inherit eutils kernel-mod

DESCRIPTION="TuxFrw is a complete firewall automation tool for GNU/Linux."
HOMEPAGE="http://tuxfrw.sf.net/"
SRC_URI="mirror://sourceforge/tuxfrw/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~ppc ~x86"
IUSE=""
DEPEND="net-firewall/iptables"

pkg_preinst() {
	check_KV
	kernel-mod_getversion

	#check for kernel version (2.4.18 or higher)
	if [ ${KV_MINOR} -eq 4 ]  && [ ${KV_PATCH} -lt 18 ] ; then
		eerror "${P} requires a 2.4 kernel version of at"
		eerror "least 2.4.23. You must upgrade your kernel."
		die "Kernel version not supported"
	fi
}

src_compile() {
	einfo "Nothing to compile..."
}

src_install() {

	diropts -m0700
	dodir /etc/tuxfrw
	dodir /etc/tuxfrw/rules

	insinto /etc/tuxfrw/rules
	insopts -m0600
	doins ${S}/tf_*-*.mod
	doins ${S}/tf_INPUT.mod
	doins ${S}/tf_OUTPUT.mod
	doins ${S}/tf_FORWARD.mod
	doins ${S}/tf_TOS.mod

	insinto /etc/tuxfrw
	doins ${S}/tf_PIGMEAT.mod
	doins ${S}/tf_KERNEL.mod
	doins ${S}/tf_BASE.mod
	doins ${S}/tf_ATK.mod
	doins ${S}/tuxfrw.conf

	#needs gentoo style script
	exeopts -m700
	exeinto /etc/init.d/
	doexe ${FILESDIR}/tuxfrw

	#doing binary install instead
	dosbin ${S}/tuxfrw

	# Is this really needed ?
	dodoc ${S}/AUTHORS ${S}/COPYING ${S}/CREDITS ${S}/ChangeLog ${S}/INSTALL
	dodoc ${S}/README ${S}/VERSION ${S}/manual/${PN}-manual-${PV}-en.txt
}

pkg_postinst() {
	einfo " TuxFrw installation is finished! "
	einfo " tfconf.sh is deprecated. Configure $CONF_DIR/tuxfrw.conf manually"
	einfo " to start: /etc/init.d/tuxfrw start "
	einfo " to load on boot: rc-update add tuxfrw default"
	einfo ""
	einfo "You will need to have iptables support compiled on your kernel"
	einfo "in order to this package to work. The current list of modules"
	einfo "needed can be found here:"
	einfo "http://dev.gentoo.org/~angusyoung/docs/devel/tuxfrw/mod.txt"
}