summaryrefslogtreecommitdiff
blob: 2946a1a97bf37077634a6fa81f84bc4872298a55 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/arpwatch/arpwatch-2.1.13.ebuild,v 1.3 2005/12/07 11:26:17 strerror Exp $

inherit eutils

MY_P=arpwatch-2.1a13
DESCRIPTION="An ethernet monitor program that keeps track of ethernet/ip address pairings"
HOMEPAGE="http://www-nrg.ee.lbl.gov/"
SRC_URI="ftp://ftp.ee.lbl.gov/${MY_P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
IUSE="selinux"

DEPEND="virtual/libpcap
	sys-libs/ncurses"

RDEPEND="selinux? ( sec-policy/selinux-arpwatch )"

pkg_setup() {
	enewgroup arpwatch
	enewuser arpwatch -1 -1 /var/lib/arpwatch arpwatch
}

S=${WORKDIR}/${MY_P}

src_unpack() {
	unpack ${A}
	cd ${S}

	einfo "Patching arpwatch with debian and redhat patches"
	gzip -dc ${FILESDIR}/${P}.diff.gz | patch -s
}

src_compile() {
	local myconf
	myconf="${myconf} --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man"

	econf \
	${myconf} || die "econf failed"
	emake || die "emake failed"
}

src_install () {

	dodir /var/lib/arpwatch /usr/sbin
	diropts -g arpwatch -o arpwatch
	keepdir /var/lib/arpwatch

	make DESTDIR="${D}" install || die "install failed"

	doman *.8
	dodoc README CHANGES


	exeinto /var/lib/arpwatch
	exeopts -m0755 -o arpwatch -g arpwatch
	doexe arp2ethers arpfetch bihourly massagevendor massagevendor-old

	insinto /var/lib/arpwatch
	insopts -m0644 -o arpwatch -g arpwatch
	doins d.awk duplicates.awk e.awk euppertolower.awk p.awk

	insinto /usr/share/arpwatch
	insopts -m0644 -o arpwatch -g arpwatch
	doins ethercodes.dat

	newinitd "${FILESDIR}/arpwatch.init" arpwatch

	newconfd "${FILESDIR}/arpwatch.confd" arpwatch

}
pkg_postinst() {
	einfo "If you want arpwatch to start at boot then type:"
	ewarn "      rc-update add arpwatch default"
}