git: 5f000aa6a251 - main - New port: net/libpfctl: library for interaction with pf(4)

Kristof Provost kp at FreeBSD.org
Tue May 4 16:26:32 UTC 2021


The branch main has been updated by kp (src committer):

URL: https://cgit.FreeBSD.org/ports/commit/?id=5f000aa6a251e86829db81e144d8e150566097e5

commit 5f000aa6a251e86829db81e144d8e150566097e5
Author:     Kristof Provost <kp at FreeBSD.org>
AuthorDate: 2021-04-19 12:35:35 +0000
Commit:     Kristof Provost <kp at FreeBSD.org>
CommitDate: 2021-05-04 16:26:09 +0000

    New port: net/libpfctl: library for interaction with pf(4)
    
    The libpfctl port builds a shared library version of the base system
    internal libpfctl library.
    While the base system libpfctl API/ABI is not guaranteed to be stable
    the ioctl interface is, so any version of libpfctl can be safely used.
    
    Note that currently only FreeBSD main (i.e. what will become 14)
    supports libpfctl. The relevant changes will be MFC'd back to stable/13
    and stable/12 in due course. At that point libpfctl will also be useful
    there.
    
    Approved by:    garga
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D29836
---
 net/Makefile                      |  1 +
 net/libpfctl/Makefile             | 43 +++++++++++++++++++++++++++++++++++++++
 net/libpfctl/distinfo             |  3 +++
 net/libpfctl/files/patch-Makefile | 11 ++++++++++
 net/libpfctl/pkg-descr            |  6 ++++++
 5 files changed, 64 insertions(+)

diff --git a/net/Makefile b/net/Makefile
index 4afe30626bf1..16a00758c5e2 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -382,6 +382,7 @@
     SUBDIR += libosip2
     SUBDIR += libpcap
     SUBDIR += libpcapnav
+    SUBDIR += libpfctl
     SUBDIR += libproxy
     SUBDIR += libproxy-gnome3
     SUBDIR += libproxy-kde
diff --git a/net/libpfctl/Makefile b/net/libpfctl/Makefile
new file mode 100644
index 000000000000..af42ee98f311
--- /dev/null
+++ b/net/libpfctl/Makefile
@@ -0,0 +1,43 @@
+# Created by: Kristof Provost <kp at FreeBSD.org>
+
+PORTNAME=	libpfctl
+PORTVERSION=	0.1
+CATEGORIES=	net
+MASTER_SITES=	LOCAL/kp/
+DISTFILES=	libpfctl-${_LIBPFCTL_HASH}.tar.gz
+
+MAINTAINER=	kp at FreeBSD.org
+COMMENT=	Library for interaction with pf(4)
+
+LICENSE=	BSD2CLAUSE
+
+BROKEN_FreeBSD_11=	Will not work until nvlist-ified ioctls are available
+BROKEN_FreeBSD_12=	Will not work until nvlist-ified ioctls are available
+BROKEN_FreeBSD_13=	Will not work until nvlist-ified ioctls are available
+
+USE_LDCONFIG=	yes
+
+WRKSRC=		${WRKDIR}/libpfctl
+
+_LIBPFCTL_HASH=	4ae3a97e127c
+
+PLIST_FILES=	lib/libpfctl.so.0 \
+		include/libpfctl.h
+
+do-install:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/lib
+	@${MKDIR} ${STAGEDIR}${PREFIX}/include
+	${INSTALL_LIB} ${WRKSRC}/libpfctl.so.0 ${STAGEDIR}${PREFIX}/lib
+	${INSTALL_DATA} ${WRKSRC}/*.h ${STAGEDIR}${PREFIX}/include
+
+.if defined(MAINTAINER_MODE)
+upload:
+	cd /usr/src/lib && \
+	HASH=$$(git rev-parse --short origin/main) && \
+	git archive --format=tar.gz \
+		--output=libpfctl-$${HASH}.tar.gz \
+		origin/main libpfctl && \
+	scp libpfctl-$${HASH}.tar.gz kp at freefall.freebsd.org:public_distfiles/
+.endif
+
+.include <bsd.port.mk>
diff --git a/net/libpfctl/distinfo b/net/libpfctl/distinfo
new file mode 100644
index 000000000000..c85746451541
--- /dev/null
+++ b/net/libpfctl/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1618833133
+SHA256 (libpfctl-4ae3a97e127c.tar.gz) = dcafd22c84f129e301ffe3b0f7f8cb53b841d420bc357af8afa2a5f186b958b3
+SIZE (libpfctl-4ae3a97e127c.tar.gz) = 5260
diff --git a/net/libpfctl/files/patch-Makefile b/net/libpfctl/files/patch-Makefile
new file mode 100644
index 000000000000..becc613d8e6b
--- /dev/null
+++ b/net/libpfctl/files/patch-Makefile
@@ -0,0 +1,11 @@
+--- Makefile.orig	2021-04-19 10:09:35 UTC
++++ Makefile
+@@ -2,7 +2,7 @@
+ 
+ PACKAGE=	lib${LIB}
+ LIB=		pfctl
+-INTERNALLIB=	true
++SHLIB_MAJOR=	0
+ 
+ SRCS=	libpfctl.c
+ INCS=	libpfctl.h
diff --git a/net/libpfctl/pkg-descr b/net/libpfctl/pkg-descr
new file mode 100644
index 000000000000..65744bc64570
--- /dev/null
+++ b/net/libpfctl/pkg-descr
@@ -0,0 +1,6 @@
+Ports version of the base system pf(4) library, libpfctl.
+
+Ports should ideally use this interface rather than manually implementing the
+pf(4) ioctl() interface.
+
+WWW: https://cgit.freebsd.org/src/tree/lib/libpfctl


More information about the dev-commits-ports-all mailing list