freebsd-pf-10.3.ebuild 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit bsdmk freebsd user
  5. DESCRIPTION="FreeBSD's base system libraries"
  6. SLOT="0"
  7. IUSE=""
  8. # Crypto is needed to have an internal OpenSSL header
  9. if [[ ${PV} != *9999* ]]; then
  10. KEYWORDS="~amd64-fbsd ~x86-fbsd"
  11. fi
  12. EXTRACTONLY="
  13. usr.sbin/
  14. sbin/
  15. contrib/pf/
  16. etc/
  17. "
  18. RDEPEND="net-libs/libpcap"
  19. DEPEND="${RDEPEND}
  20. dev-libs/libevent
  21. =sys-freebsd/freebsd-mk-defs-${RV}*
  22. =sys-freebsd/freebsd-sources-${RV}*"
  23. S="${WORKDIR}"
  24. SUBDIRS="usr.sbin/authpf sbin/pfctl sbin/pflogd usr.sbin/ftp-proxy/ftp-proxy"
  25. pkg_setup() {
  26. enewgroup authpf 63
  27. mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= "
  28. }
  29. src_prepare() {
  30. # pcap-int.h redefines snprintf as pcap_snprintf
  31. epatch "${FILESDIR}/${PN}-9.0-pcap_pollution.patch"
  32. # Use system's libevent
  33. epatch "${FILESDIR}/${PN}-10.0-libevent.patch"
  34. epatch "${FILESDIR}/${PN}-10.0-pflogd.patch"
  35. epatch "${FILESDIR}/${PN}-9.0-bpf.patch"
  36. epatch "${FILESDIR}/${PN}-9.0-getline.patch"
  37. # Link in kernel sources
  38. [[ ! -e "${WORKDIR}/sys" ]] && ln -s "/usr/src/sys" "${WORKDIR}/sys"
  39. }
  40. src_compile() {
  41. for dir in ${SUBDIRS}; do
  42. einfo "Starting make in ${dir}"
  43. cd "${S}/${dir}" || die
  44. mkmake || die "Make ${dir} failed"
  45. done
  46. }
  47. src_install() {
  48. for dir in ${SUBDIRS}; do
  49. einfo "Starting install in ${dir}"
  50. cd "${S}/${dir}" || die
  51. mkinstall || die "Install ${dir} failed"
  52. done
  53. cd "${WORKDIR}"/etc
  54. insinto /etc
  55. doins pf.os
  56. # pf.initd provided by openrc, but no pf.confd
  57. newconfd "${FILESDIR}/pf.confd" pf
  58. }