summaryrefslogtreecommitdiff
blob: 461da0357ccec4376066a58e1f8e05405d344984 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/scanlogd/scanlogd-2.2.6-r2.ebuild,v 1.1 2006/10/08 12:57:20 jokey Exp $

inherit eutils toolchain-funcs

DESCRIPTION="Scanlogd - detects and logs TCP port scans"
SRC_URI="http://www.openwall.com/scanlogd/${P}.tar.gz"
HOMEPAGE="http://www.openwall.com/scanlogd/"

SLOT="0"
LICENSE="as-is"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
IUSE="nids pcap"

DEPEND="nids? ( net-libs/libnids
	net-libs/libnet
	net-libs/libpcap )
	pcap? ( net-libs/libpcap )"
RDEPEND=${DEPEND}

pkg_setup() {
	enewgroup scanlogd
	enewuser scanlogd -1 -1 /dev/null scanlogd
	if use nids && use pcap ; then
		ewarn
		ewarn "As you set both nids and pcap useflag, we default to pcap"
		ewarn
	fi
}

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}/${P}-Makefile.patch"
}

src_compile() {
	local target=linux
	use nids && target=libnids
	use pcap && target=libpcap

	einfo "Compiling against ${target}"

	emake CC="$(tc-getCC)" ${target} || die "emake failed"
}

src_install() {
	dosbin scanlogd
	doman scanlogd.8
	newinitd "${FILESDIR}"/scanlogd.rc scanlogd
}

pkg_postinst() {
	einfo "You can start the scanlogd monitoring program at boot by running"
	einfo "rc-update add scanlogd default"
}