p0f-3.07_beta.ebuild 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit toolchain-funcs
  5. MY_P=${P/_beta/b}
  6. DESCRIPTION="A tool to perform passive OS detection based on SYN packets"
  7. HOMEPAGE="http://lcamtuf.coredump.cx/p0f3/"
  8. SRC_URI="http://lcamtuf.coredump.cx/p0f3/releases/${MY_P}.tgz"
  9. LICENSE="LGPL-2.1"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos"
  12. IUSE="debug ipv6"
  13. RDEPEND="net-libs/libpcap"
  14. DEPEND="${RDEPEND}"
  15. S=${WORKDIR}/${MY_P}
  16. src_prepare() {
  17. sed -i \
  18. -e 's:-g -ggdb::' \
  19. -e 's:-O3::' \
  20. -e '/^CC/s:=:?=:' \
  21. -e '/^CFLAGS/s:=:+=:' \
  22. -e '/^LDFLAGS/s:=:+=:' \
  23. build.sh tools/Makefile || die
  24. sed -i -e "/FP_FILE/s:p0f.fp:${EPREFIX}/etc/&:" config.h || die
  25. }
  26. src_compile() {
  27. tc-export CC
  28. ./build.sh $(use debug && echo debug) || die
  29. emake -C tools p0f-client p0f-sendsyn $(use ipv6 && echo p0f-sendsyn6)
  30. }
  31. src_install() {
  32. dosbin p0f tools/p0f-{client,sendsyn}
  33. use ipv6 && dosbin tools/p0f-sendsyn6
  34. insinto /etc
  35. doins p0f.fp
  36. #newconfd "${FILESDIR}"/${PN}.confd ${PN}
  37. #newinitd "${FILESDIR}"/${PN}.initd3 ${PN}
  38. dodoc docs/{ChangeLog,README,TODO,*.txt} tools/README-TOOLS
  39. }