pftop-0.7-r2.ebuild 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. PATCH_PV=3
  5. inherit bsdmk flag-o-matic eutils
  6. DESCRIPTION="Tool for real-time display of active states and rule statistics for pf"
  7. HOMEPAGE="http://www.eee.metu.edu.tr/~canacar/pftop/"
  8. SRC_URI="http://www.eee.metu.edu.tr/~canacar/${P}.tar.gz
  9. mirror://gentoo/${P}-patches-${PATCH_PV}.tar.bz2"
  10. LICENSE="BSD"
  11. SLOT="0"
  12. KEYWORDS="~x86-fbsd"
  13. IUSE="altq"
  14. RDEPEND="sys-libs/ncurses"
  15. src_prepare() {
  16. epatch "${WORKDIR}"/patches/*
  17. }
  18. src_compile() {
  19. # OS_LEVEL variable refers to the version of pf shipped with OpenBSD.
  20. # On FreeBSD we have to know it.
  21. local OSLEVEL
  22. case ${CHOST} in
  23. *-openbsd*)
  24. local obsdver=${CHOST/*-openbsd/}
  25. OSLEVEL=${obsdver//.}
  26. ;;
  27. *-freebsd[78]*) OSLEVEL=41 ;;
  28. *-freebsd9*) OSLEVEL=45 ;;
  29. *)
  30. die "Your OS/Version is not supported (${CHOST}), please report."
  31. ;;
  32. esac
  33. append-flags "-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DOS_LEVEL=${OSLEVEL}"
  34. use altq && append-flags "-DHAVE_ALTQ"
  35. mkmake LOCALBASE="/usr" CFLAGS="${CFLAGS}" || die "pmake failed"
  36. }
  37. src_install() {
  38. mkinstall DESTDIR="${D}" LOCALBASE="/usr" MANDIR="/usr/share/man/man" \
  39. NO_MANCOMPRESS= install || die
  40. }