You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-freebsd/freebsd-pf/freebsd-pf-11.0.ebuild

71 lines
1.5 KiB

# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
inherit bsdmk freebsd user
DESCRIPTION="FreeBSD's base system libraries"
SLOT="0"
IUSE=""
# Crypto is needed to have an internal OpenSSL header
if [[ ${PV} != *9999* ]]; then
KEYWORDS="~amd64-fbsd ~x86-fbsd"
fi
EXTRACTONLY="
usr.sbin/
sbin/
contrib/pf/
etc/
"
RDEPEND="net-libs/libpcap"
DEPEND="${RDEPEND}
dev-libs/libevent
=sys-freebsd/freebsd-mk-defs-${RV}*
=sys-freebsd/freebsd-sources-${RV}*"
S="${WORKDIR}"
SUBDIRS="usr.sbin/authpf sbin/pfctl sbin/pflogd usr.sbin/ftp-proxy"
pkg_setup() {
enewgroup authpf 63
}
src_prepare() {
# pcap-int.h redefines snprintf as pcap_snprintf
epatch "${FILESDIR}/${PN}-9.0-pcap_pollution.patch"
# Use system's libevent
epatch "${FILESDIR}/${PN}-11.0-libevent.patch"
epatch "${FILESDIR}/${PN}-11.0-pflogd.patch"
epatch "${FILESDIR}/${PN}-9.0-bpf.patch"
# Link in kernel sources
[[ ! -e "${WORKDIR}/sys" ]] && ln -s "/usr/src/sys" "${WORKDIR}/sys"
}
src_compile() {
for dir in ${SUBDIRS}; do
einfo "Starting make in ${dir}"
cd "${S}/${dir}" || die
freebsd_src_compile || die "Make ${dir} failed"
done
}
src_install() {
for dir in ${SUBDIRS}; do
einfo "Starting install in ${dir}"
cd "${S}/${dir}" || die
freebsd_src_install || die "Install ${dir} failed"
done
cd "${WORKDIR}"/etc
insinto /etc
doins pf.os
# pf.initd provided by openrc, but no pf.confd
newconfd "${FILESDIR}/pf.confd" pf
}