/[gentoo-x86]/net-analyzer/p0f/p0f-2.0.8-r2.ebuild
Gentoo

Contents of /net-analyzer/p0f/p0f-2.0.8-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon May 14 11:36:57 2012 UTC (2 years, 7 months ago) by scarabeus
Branch: MAIN
Changes since 1.2: +3 -3 lines
Stabilise on all archs tested on ppc/x86/amd64 but it just fixes ldflags so deemed ok for sparc.

(Portage version: 2.2.0_alpha104/cvs/Linux x86_64)

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-analyzer/p0f/p0f-2.0.8-r2.ebuild,v 1.2 2011/08/05 05:56:12 zmedico Exp $
4
5 EAPI="3"
6
7 inherit eutils toolchain-funcs
8
9 DESCRIPTION="p0f performs passive OS detection based on SYN packets."
10 HOMEPAGE="http://lcamtuf.coredump.cx/p0f.shtml"
11 SRC_URI="http://lcamtuf.coredump.cx/p0f/${P}.tgz"
12
13 LICENSE="LGPL-2.1"
14 SLOT="0"
15 KEYWORDS="amd64 ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
16 IUSE="static"
17
18 DEPEND="net-libs/libpcap"
19
20 S="${WORKDIR}/${PN}"
21
22 src_prepare() {
23 sed -i p0f.c -e 's;#include <net/bpf.h>;;' || die "sed p0f.c"
24
25 # The first script ensures only p0f is built
26 sed -i mk/* \
27 -e 's|^\(all: $(FILE)\).*$|\1|' \
28 -e 's|^CFLAGS.*=.*|CFLAGS += \\|g' \
29 -e '/$(CC).* -o /s|$(CFLAGS)|& $(LDFLAGS)|g' \
30 || die "sed makefiles"
31
32 sed -i Build -e "s|\"/usr/|\"${EPREFIX}/usr/|g" || die "sed Build"
33
34 sed -i config.h \
35 -e "s|\"/etc/|\"${EPREFIX}/etc/|g" \
36 -e "s|\"/var/|\"${EPREFIX}/var/|g" \
37 || die "sed config.h"
38 }
39
40 src_compile() {
41 # Set -j1 to supress a warning that would not be useful in this case
42 emake -j1 CC=$(tc-getCC) \
43 $(use static && echo static || echo all) p0fq \
44 || die "emake failed"
45 }
46
47 src_install () {
48 use static && mv p0f-static p0f
49 dosbin p0f p0frep test/p0fq || die
50
51 insinto /etc/p0f
52 doins p0f.fp p0fa.fp p0fr.fp
53
54 doman p0f.1 || die
55 cd doc
56 dodoc ChangeLog CREDITS KNOWN_BUGS README TODO
57
58 newconfd "${FILESDIR}"/${PN}.confd ${PN} || die "newconfd failed"
59 newinitd "${FILESDIR}"/${PN}.initd3 ${PN} || die "newinitd failed"
60 }
61
62 pkg_postinst(){
63 elog "Adjust /etc/conf.d/p0f to your liking before using the"
64 elog "init script. For more information on options, read man p0f."
65 }

  ViewVC Help
Powered by ViewVC 1.1.20