summaryrefslogtreecommitdiff
blob: 621e8e037c958a45ec3ae13ef21ff128ad626301 (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
78
79
80
81
82
83
84
85
86
87
88
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-firewall/fireflier/fireflier-1.1.6.ebuild,v 1.2 2007/03/02 22:02:10 cedk Exp $

inherit eutils kde linux-mod qt3

MY_P=${P/-/_}
DESCRIPTION="FireFlier, a personnal firewall for Linux based on IPTables"
HOMEPAGE="http://fireflier.sf.net"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tgz"

LICENSE="GPL-2"
KEYWORDS="~x86"
SLOT="0"
IUSE="ssl qt3"

DEPEND="net-firewall/iptables
	sys-libs/pam
	dev-libs/openssl
	qt3? ( $(qt_min_version 3.3) )"

# Checking if modules a present
modules_check() {
	ebegin "Checking of kernel has the needed modules"
	linux_chkconfig_present NETFILTER
	linux_chkconfig_present IP_NF_QUEUE
	linux_chkconfig_present IP_NF_IPTABLES
	linux_chkconfig_present IP_NF_MATCH_STATE
	linux_chkconfig_present IP_NF_FILTER
	eend $?

	if [ "$?" != 0 ]
	then
		eerror "This program need following modules:"
		eerror "CONFIG_NETFILTER CONFIG_IP_NF_QUEUE CONFIG_IP_NF_IPTABLES"
		eerror "CONFIG_IP_NF_MATCH_STATE CONFIG_IP_NF_FILTER"
		eerror
		eerror "Please compile these modules into your kernel"
		die "Modules needed"
	fi
}

src_compile() {
	# Compile the server
	# Check for modules
	mkdir -p $T/fakehome
	mkdir -p $T/fakehome/.qt
	export HOME="$T/fakehome"
	addwrite "${QTDIR}/etc/settings"

	modules_check
	einfo "Compiling the Fireflier Server..."
	cd "${S}"/server
	econf || die "Failed to configure FireFlier server"
	emake || die "Failed to compile FireFlier server"
	# Compile the QT client
	if use qt3 ; then
		einfo "Compiling the Fireflier QT client"
		cd "${S}"/qtclient
		[ -f configure ] || (aclocal && autoconf)
		econf --with-x \
			--with-Qt-dir=${QTDIR} || die "Failed to configure QT client"
		emake || die "Failed to compile QT client"
	fi
}

src_install () {
	cd "${S}"/server
	make DESTDIR="${D}" install || die "Failed to install server"
	newinitd "${FILESDIR}"/fireflier.initd fireflier
	doman man/fireflier.1

	dodir /usr/bin
	if use qt3 ; then
		cd "${S}"/qtclient
		make DESTDIR="${D}" install || die "Failed to install QT client"
	fi
	cd "${S}"
	dodoc AUTHORS AUTOLOGIN README TODO protocol.lyx
}

pkg_postinst () {
	ewarn "If you are using NIS or other networked naming solutions"
	ewarn "then you need to make sure they are allowed by iptables"
	ewarn "the first time you start fireflierd as otherwise your"
	ewarn "system will be nearly unusable (no username-resolution!)"
}