summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-freebsd/freebsd-pf
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-freebsd/freebsd-pf')
-rw-r--r--sys-freebsd/freebsd-pf/Manifest9
-rw-r--r--sys-freebsd/freebsd-pf/files/freebsd-pf-10.0-libevent.patch16
-rw-r--r--sys-freebsd/freebsd-pf/files/freebsd-pf-10.0-pflogd.patch15
-rw-r--r--sys-freebsd/freebsd-pf/files/freebsd-pf-7.0-libevent.patch12
-rw-r--r--sys-freebsd/freebsd-pf/files/freebsd-pf-7.0-pcap_pollution.patch18
-rw-r--r--sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-bpf.patch10
-rw-r--r--sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-getline.patch38
-rw-r--r--sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-libevent.patch15
-rw-r--r--sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-pcap_pollution.patch17
-rw-r--r--sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-pflogd.patch13
-rw-r--r--sys-freebsd/freebsd-pf/files/pf.confd9
-rwxr-xr-xsys-freebsd/freebsd-pf/files/pf.initd50
-rw-r--r--sys-freebsd/freebsd-pf/freebsd-pf-10.1.ebuild73
-rw-r--r--sys-freebsd/freebsd-pf/freebsd-pf-8.2.ebuild65
-rw-r--r--sys-freebsd/freebsd-pf/freebsd-pf-9.1.ebuild67
-rw-r--r--sys-freebsd/freebsd-pf/metadata.xml5
16 files changed, 432 insertions, 0 deletions
diff --git a/sys-freebsd/freebsd-pf/Manifest b/sys-freebsd/freebsd-pf/Manifest
new file mode 100644
index 000000000000..8c89386b9a0b
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/Manifest
@@ -0,0 +1,9 @@
+DIST freebsd-contrib-8.2.tar.bz2 40931651 SHA256 8b9cb688e81c2980b3fc66411d00ab277a24dadd50d5bdd5e0e6c63ac687b9b6 SHA512 4f7bf825b579fbb88f2aac531d07e531474179c63fa0b66c4e80821290a8c94bf611bb4dcaef51b762aacd25b11dfae798a4ec3bad3b9e3f6b3490ebfaa72476 WHIRLPOOL edd3d9e26e8d22d9028082e107ec1a44402e206dab8722f34b445676959305996c3f699152af42ace249b7f58498492787823b172fb6bcb273119c6bb50a35f0
+DIST freebsd-contrib-9.1.tar.bz2 54751432 SHA256 e7ffa056d4050ce03ee8e23e276e2a9a494326a98d60c43bee2afcc59576deb8 SHA512 71be13049258c6e6b5e4f63cc16da5d349a89d68f04d87446e4ad33ae8bf2a93ea67d9c256b7bec60b61e65db0487268070cfb77a484c3ac0f8ba368b48c2438 WHIRLPOOL a2a84423175499208d34809e802284d6ba649f317c3a9ad8b7312fa19efe142ebadab0048bac0db8e988e59f9a7468ac7c5d0d25e78b82bdb269a20d18153cee
+DIST freebsd-etc-8.2.tar.bz2 188629 SHA256 6bc745fa259f9fa2b65df865d45443a7b23c24445195e33a4ac50bf1040ae238 SHA512 3e5c106754a6a1ac806bd46b711fba7ee9cb31a4eab5262c995a5d59dbeb02f756dd8b495640dda94189d204a5d2c5218de2bd23467172d6a4ebe1048986e89c WHIRLPOOL 23b658a214f1a64c43420351020e32b1182e9aac3ed5253f49ee86f9cee9166ce32bd556cd2a2b3c0e60a165462a8700f37dea19e57ad5716415e17f61da912e
+DIST freebsd-etc-9.1.tar.bz2 207776 SHA256 a317bf85532d6192f5506e8d7bd5d5c201fe24017700e3a974a7712c2c69cdb8 SHA512 4fbe56fde519cf2f44e39a8869efa26c34f703cf540f4a83389da8d170873d7c6fb18e4010e643b8d793cfc5c55d15eeb198057a5b2a8da9d9e8f791801bf314 WHIRLPOOL 0c27019fe140fe96f870697acbaa89ac2f281f55b892c5791b08abf1cfa4da94d9d42a1df1c2091317573ed7234253857aecb797065f911a0a5d57bbf64349a5
+DIST freebsd-sbin-8.2.tar.bz2 1211665 SHA256 8b7e21a66b4696e8763d29b8b02b2d35f29fc51820a194d1e469e7cace84c527 SHA512 c6643c29ab62344c98d8991708798730ee1c17e6478071718beeaa79788300a1f4ed2e6aeb8e39e3c216877d4ed2ac85b2a9531d534f1ac5125a508927898959 WHIRLPOOL 2a21cd0f15f95d66718031680ac87f1fe73f1e1b03cb012e1db1dd1bd2fe2bb7897457a8ba2f5a28c8806775611dca542cbadec16566c47ab9efa673e2cb53f3
+DIST freebsd-sbin-9.1.tar.bz2 1273913 SHA256 45008b0733b232ef03707ef5fa3e5c889e3b3728393d736bd9a869ea83be6447 SHA512 9f186602b7de96f268c352ca386986652fddf5570e7eca1afa8c0d2bdc83b57df1198efe47f36dd5c7a6abf4f9c935f1c8207a4a12a6b2153bd6c3c6292719dc WHIRLPOOL 20920dfa9607a0ce854319cef29bbd77fb1b31f6f6cfd5ac60cbd678169e43929e215743fe636d0c224443f3e6149a8f07c292d647f7f901592795ac292699f9
+DIST freebsd-src-10.1.tar.xz 115049476 SHA256 f919287a5ef51d4f133f27c99c54f2e8054f408d3dd53bc60f4e233cc75ec03d SHA512 4ded32b451e2807e24a06305502f88ea633b2899a7ccd9cab3dc98fc865ef91324c93c512a08cf6e295313a8d7e79aa9d7af07da40e7276d986b06419b984152 WHIRLPOOL 1eff9419d89b8a70f064171883d92e160b250cd637972eb9107a19d7b3c904b554c4f51eaa9ff9642ef2c4234bde05cf9aef16d0c39280b55084f831700dea80
+DIST freebsd-usbin-8.2.tar.bz2 2443024 SHA256 aa7cabf10f5c3a9daabea32e4de24d04ec312247842981476da666eff5054603 SHA512 bcb8ff3df54848b9107bbb52e5ced7a91e24bb181f06769b6997221729b8064ec17652eaf7500de3268cbcb63ff5760beb54d15fc78c27b02687b5b1067c74a6 WHIRLPOOL 20f5278e2a1dd387a75b44f10507958d6c0e84a2faa1bddbf808c14ab86d8dd14a956192911bbc1880f5f5f7bd05972dcbb4aec85d241f0dcf91bf4246883f0a
+DIST freebsd-usbin-9.1.tar.bz2 2670916 SHA256 b938c20b8c09aa9a610e13b69b9afeea72f561ab3636a59fba2bdac290f4db75 SHA512 21c234312f70eb35cd2926519efc1f61592892f5d0940786dbeb959c3c5ec7819a51ae95c6e8a1a06aa01f669350fe0fd3dd7c4ec8a84dd6b90f24cb192356ca WHIRLPOOL 7f6ad2eb5410cc5e685881654a788807848af026b1277a974682755ab7c9db28f576bfd1576441ea10c5f1e9edb7d30a4a23fb8eccd6d69d86ecc9ce4c9adc7e
diff --git a/sys-freebsd/freebsd-pf/files/freebsd-pf-10.0-libevent.patch b/sys-freebsd/freebsd-pf/files/freebsd-pf-10.0-libevent.patch
new file mode 100644
index 000000000000..57474ea31dfb
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/freebsd-pf-10.0-libevent.patch
@@ -0,0 +1,16 @@
+diff --git a/usr.sbin/ftp-proxy/ftp-proxy/Makefile b/usr.sbin/ftp-proxy/ftp-proxy/Makefile
+index de49888..2ab32fb 100644
+--- a/usr.sbin/ftp-proxy/ftp-proxy/Makefile
++++ b/usr.sbin/ftp-proxy/ftp-proxy/Makefile
+@@ -7,10 +7,7 @@ MAN= ftp-proxy.8
+
+ SRCS= ftp-proxy.c filter.c
+
+-CFLAGS+= -I${.CURDIR}/../../../contrib/pf/libevent
+-
+-LDADD+= ${LIBEVENT}
+-DPADD+= ${LIBEVENT}
++LDADD+= -levent
+
+ WARNS?= 3
+
diff --git a/sys-freebsd/freebsd-pf/files/freebsd-pf-10.0-pflogd.patch b/sys-freebsd/freebsd-pf/files/freebsd-pf-10.0-pflogd.patch
new file mode 100644
index 000000000000..1316d3be832a
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/freebsd-pf-10.0-pflogd.patch
@@ -0,0 +1,15 @@
+diff --git a/sbin/pflogd/Makefile b/sbin/pflogd/Makefile
+index fcff8eb..0da383d 100644
+--- a/sbin/pflogd/Makefile
++++ b/sbin/pflogd/Makefile
+@@ -6,10 +6,7 @@ PROG= pflogd
+ SRCS= pflogd.c pidfile.c privsep.c privsep_fdpass.c
+ MAN= pflogd.8
+
+-CFLAGS+=-include ${.CURDIR}/../../lib/libpcap/config.h
+-
+ LDADD= -lpcap
+-DPADD= ${LIBPCAP}
+
+ WARNS?= 2
+
diff --git a/sys-freebsd/freebsd-pf/files/freebsd-pf-7.0-libevent.patch b/sys-freebsd/freebsd-pf/files/freebsd-pf-7.0-libevent.patch
new file mode 100644
index 000000000000..1425db24d975
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/freebsd-pf-7.0-libevent.patch
@@ -0,0 +1,12 @@
+--- usr.sbin/ftp-proxy/ftp-proxy/Makefile.orig 2008-06-14 00:01:52 -0300
++++ usr.sbin/ftp-proxy/ftp-proxy/Makefile 2008-06-14 00:03:19 -0300
+@@ -10,8 +10,7 @@
+ CFLAGS+= -I${.CURDIR}/../../../contrib/pf/libevent
+ CFLAGS+= -I${.CURDIR}/../../../sys/contrib/pf
+
+-DPADD= ${LIBEVENT}
+-LDADD= ${LIBEVENT}
++LDADD= -levent
+
+ WARNS?= 2
+
diff --git a/sys-freebsd/freebsd-pf/files/freebsd-pf-7.0-pcap_pollution.patch b/sys-freebsd/freebsd-pf/files/freebsd-pf-7.0-pcap_pollution.patch
new file mode 100644
index 000000000000..4a7c2e9a0e46
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/freebsd-pf-7.0-pcap_pollution.patch
@@ -0,0 +1,18 @@
+--- contrib/pf/pflogd/privsep.c.orig 2007-07-03 09:30:02 -0300
++++ contrib/pf/pflogd/privsep.c 2008-06-13 23:55:39 -0300
+@@ -31,13 +31,14 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
++#include <stdio.h>
++#define HAVE_SNPRINTF
+ #ifndef __FreeBSD__
+ #include <pcap.h>
+ #include <pcap-int.h>
+ #endif
+ #include <pwd.h>
+ #include <signal.h>
+-#include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #ifdef __FreeBSD__
diff --git a/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-bpf.patch b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-bpf.patch
new file mode 100644
index 000000000000..fb3c7012eccf
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-bpf.patch
@@ -0,0 +1,10 @@
+--- contrib/pf/pflogd/pflogd.c.old 2011-11-02 21:12:57.000000000 +0000
++++ contrib/pf/pflogd/pflogd.c 2011-11-02 21:13:11.000000000 +0000
+@@ -39,6 +39,7 @@
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
++#include <net/bpf.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
diff --git a/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-getline.patch b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-getline.patch
new file mode 100644
index 000000000000..6679d32e8060
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-getline.patch
@@ -0,0 +1,38 @@
+--- contrib/pf/ftp-proxy/ftp-proxy.c.old 2011-11-02 21:18:19.000000000 +0000
++++ contrib/pf/ftp-proxy/ftp-proxy.c 2011-11-02 21:18:36.000000000 +0000
+@@ -103,7 +103,7 @@
+ int drop_privs(void);
+ void end_session(struct session *);
+ void exit_daemon(void);
+-int getline(char *, size_t *);
++int ftpgetline(char *, size_t *);
+ void handle_connection(const int, short, void *);
+ void handle_signal(int, short, void *);
+ struct session * init_session(void);
+@@ -249,7 +249,7 @@
+ buf_avail);
+ s->cbuf_valid += clientread;
+
+- while ((n = getline(s->cbuf, &s->cbuf_valid)) > 0) {
++ while ((n = ftpgetline(s->cbuf, &s->cbuf_valid)) > 0) {
+ logmsg(LOG_DEBUG, "#%d client: %s", s->id, linebuf);
+ if (!client_parse(s)) {
+ end_session(s);
+@@ -343,7 +343,7 @@
+ }
+
+ int
+-getline(char *buf, size_t *valid)
++ftpgetline(char *buf, size_t *valid)
+ {
+ size_t i;
+
+@@ -1087,7 +1087,7 @@
+ buf_avail);
+ s->sbuf_valid += srvread;
+
+- while ((n = getline(s->sbuf, &s->sbuf_valid)) > 0) {
++ while ((n = ftpgetline(s->sbuf, &s->sbuf_valid)) > 0) {
+ logmsg(LOG_DEBUG, "#%d server: %s", s->id, linebuf);
+ if (!server_parse(s)) {
+ end_session(s);
diff --git a/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-libevent.patch b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-libevent.patch
new file mode 100644
index 000000000000..e488423fc09a
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-libevent.patch
@@ -0,0 +1,15 @@
+--- usr.sbin/ftp-proxy/ftp-proxy/Makefile.old 2011-11-02 20:57:03.000000000 +0000
++++ usr.sbin/ftp-proxy/ftp-proxy/Makefile 2011-11-02 20:57:21.000000000 +0000
+@@ -7,11 +7,9 @@
+
+ SRCS= ftp-proxy.c filter.c
+
+-CFLAGS+= -I${.CURDIR}/../../../contrib/pf/libevent
+ CFLAGS+= -I${.CURDIR}/../../../sys/contrib/pf
+
+-LDADD+= ${LIBEVENT}
+-DPADD+= ${LIBEVENT}
++LDADD+= -levent
+
+ WARNS?= 3
+
diff --git a/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-pcap_pollution.patch b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-pcap_pollution.patch
new file mode 100644
index 000000000000..184ab6f31bc4
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-pcap_pollution.patch
@@ -0,0 +1,17 @@
+--- contrib/pf/pflogd/privsep.c.old 2011-11-02 21:04:01.000000000 +0000
++++ contrib/pf/pflogd/privsep.c 2011-11-02 21:04:27.000000000 +0000
+@@ -32,11 +32,13 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
++#include <stdio.h>
++#define HAVE_SNPRINTF
++#define HAVE_STRLCPY
+ #include <pcap.h>
+ #include <pcap-int.h>
+ #include <pwd.h>
+ #include <signal.h>
+-#include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
diff --git a/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-pflogd.patch b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-pflogd.patch
new file mode 100644
index 000000000000..d5a65eab928c
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/freebsd-pf-9.0-pflogd.patch
@@ -0,0 +1,13 @@
+--- sbin/pflogd/Makefile.old 2011-11-02 21:08:46.000000000 +0000
++++ sbin/pflogd/Makefile 2011-11-02 21:08:53.000000000 +0000
+@@ -6,10 +6,7 @@
+ SRCS= pflogd.c pidfile.c privsep.c privsep_fdpass.c
+ MAN= pflogd.8
+
+-CFLAGS+=-include ${.CURDIR}/../../lib/libpcap/config.h
+-
+ LDADD= -lpcap
+-DPADD= ${LIBPCAP} ${LIBUTIL}
+
+ WARNS?= 2
+
diff --git a/sys-freebsd/freebsd-pf/files/pf.confd b/sys-freebsd/freebsd-pf/files/pf.confd
new file mode 100644
index 000000000000..87c21b281e2b
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/pf.confd
@@ -0,0 +1,9 @@
+# Copyright 2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Defines where the rules file is found, by default /etc/pf.conf
+# pf_conf=/etc/pf.conf
+
+# Extra options to pass to pfctl when loading the rules
+# See pfctl(8)
+# pf_args=
diff --git a/sys-freebsd/freebsd-pf/files/pf.initd b/sys-freebsd/freebsd-pf/files/pf.initd
new file mode 100755
index 000000000000..e8f3d92c096e
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/files/pf.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if ! [ -c /dev/pf ]; then
+ ewarn "Pseudo-device /dev/pf not found."
+
+ ebegin "Loading pf module"
+ if ! kldload pf; then
+ eerror "Unable to load pf module."
+ eend 1
+ return 1
+ fi
+ eend $?
+
+ if ! [ -c /dev/pf ]; then
+ eerror "Pseudo-device /dev/pf still not found."
+ return 1
+ fi
+ fi
+
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ einfo "Starting firewall"
+
+ if [ -r "${PF_RULES_FILE}" ]; then
+ einfo "Loading firewall rules"
+ /sbin/pfctl -qe -f ${PF_RULES_FILE:-/etc/pf.conf} ${PF_OPTS}
+ else
+ /sbin/pfctl -qe ${PF_OPTS}
+ fi
+
+ eend $?
+}
+
+stop() {
+ einfo "Stopping firewall"
+ /sbin/pfctl -qd || retval=1
+ eend $?
+}
diff --git a/sys-freebsd/freebsd-pf/freebsd-pf-10.1.ebuild b/sys-freebsd/freebsd-pf/freebsd-pf-10.1.ebuild
new file mode 100644
index 000000000000..237bb73782f8
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/freebsd-pf-10.1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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/ftp-proxy"
+
+pkg_setup() {
+ enewgroup authpf 63
+ mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= "
+}
+
+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}-10.0-libevent.patch"
+ epatch "${FILESDIR}/${PN}-10.0-pflogd.patch"
+ epatch "${FILESDIR}/${PN}-9.0-bpf.patch"
+ epatch "${FILESDIR}/${PN}-9.0-getline.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}"
+ mkmake || die "Make ${dir} failed"
+ done
+}
+
+src_install() {
+ for dir in ${SUBDIRS}; do
+ einfo "Starting install in ${dir}"
+ cd "${S}/${dir}"
+ mkinstall || 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
+}
diff --git a/sys-freebsd/freebsd-pf/freebsd-pf-8.2.ebuild b/sys-freebsd/freebsd-pf/freebsd-pf-8.2.ebuild
new file mode 100644
index 000000000000..ff2664b49464
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/freebsd-pf-8.2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit bsdmk freebsd user
+
+DESCRIPTION="FreeBSD's base system libraries"
+SLOT="0"
+KEYWORDS="~x86-fbsd"
+
+IUSE=""
+
+# Crypto is needed to have an internal OpenSSL header
+SRC_URI="mirror://gentoo/${USBIN}.tar.bz2
+ mirror://gentoo/${SBIN}.tar.bz2
+ mirror://gentoo/${CONTRIB}.tar.bz2
+ mirror://gentoo/${ETC}.tar.bz2"
+
+RDEPEND="net-libs/libpcap"
+DEPEND="${RDEPEND}
+ dev-libs/libevent
+ sys-freebsd/freebsd-mk-defs
+ =sys-freebsd/freebsd-sources-${RV}*"
+
+S="${WORKDIR}"
+
+SUBDIRS="usr.sbin/authpf sbin/pfctl sbin/pflogd usr.sbin/ftp-proxy/ftp-proxy"
+
+pkg_setup() {
+ enewgroup authpf 63
+ mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= "
+}
+
+src_unpack() {
+ freebsd_src_unpack
+ # pcap-int.h redefines snprintf as pcap_snprintf
+ epatch "${FILESDIR}/${PN}-7.0-pcap_pollution.patch"
+ # Use system's libevent
+ epatch "${FILESDIR}/${PN}-7.0-libevent.patch"
+ # Link in kernel sources
+ ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys"
+}
+
+src_compile() {
+ for dir in ${SUBDIRS}; do
+ einfo "Starting make in ${dir}"
+ cd "${S}/${dir}"
+ mkmake || die "Make ${dir} failed"
+ done
+}
+
+src_install() {
+ for dir in ${SUBDIRS}; do
+ einfo "Starting install in ${dir}"
+ cd "${S}/${dir}"
+ mkinstall || die "Install ${dir} failed"
+ done
+
+ cd "${WORKDIR}"/etc
+ insinto /etc
+ doins pf.os
+ newdoc pf.conf pf.conf.example
+ # pf.initd provided by openrc, but no pf.confd
+ newconfd "${FILESDIR}/pf.confd" pf
+}
diff --git a/sys-freebsd/freebsd-pf/freebsd-pf-9.1.ebuild b/sys-freebsd/freebsd-pf/freebsd-pf-9.1.ebuild
new file mode 100644
index 000000000000..a3dd8475ec15
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/freebsd-pf-9.1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit bsdmk freebsd user
+
+DESCRIPTION="FreeBSD's base system libraries"
+SLOT="0"
+KEYWORDS="~amd64-fbsd ~x86-fbsd"
+
+IUSE=""
+
+# Crypto is needed to have an internal OpenSSL header
+SRC_URI="mirror://gentoo/${USBIN}.tar.bz2
+ mirror://gentoo/${SBIN}.tar.bz2
+ mirror://gentoo/${CONTRIB}.tar.bz2
+ mirror://gentoo/${ETC}.tar.bz2"
+
+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/ftp-proxy"
+
+pkg_setup() {
+ enewgroup authpf 63
+ mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= "
+}
+
+src_unpack() {
+ freebsd_src_unpack
+ # pcap-int.h redefines snprintf as pcap_snprintf
+ epatch "${FILESDIR}/${PN}-9.0-pcap_pollution.patch"
+ # Use system's libevent
+ epatch "${FILESDIR}/${PN}-9.0-libevent.patch"
+ epatch "${FILESDIR}/${PN}-9.0-pflogd.patch"
+ epatch "${FILESDIR}/${PN}-9.0-bpf.patch"
+ epatch "${FILESDIR}/${PN}-9.0-getline.patch"
+ # Link in kernel sources
+ ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys"
+}
+
+src_compile() {
+ for dir in ${SUBDIRS}; do
+ einfo "Starting make in ${dir}"
+ cd "${S}/${dir}"
+ mkmake || die "Make ${dir} failed"
+ done
+}
+
+src_install() {
+ for dir in ${SUBDIRS}; do
+ einfo "Starting install in ${dir}"
+ cd "${S}/${dir}"
+ mkinstall || 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
+}
diff --git a/sys-freebsd/freebsd-pf/metadata.xml b/sys-freebsd/freebsd-pf/metadata.xml
new file mode 100644
index 000000000000..ecedda4aa2cc
--- /dev/null
+++ b/sys-freebsd/freebsd-pf/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>bsd</herd>
+</pkgmetadata>