git: f1fc9eed65fd - main - net/openbgpd7: New port

From: Kurt Jaeger <pi_at_FreeBSD.org>
Date: Sun, 17 Jul 2022 09:10:47 UTC
The branch main has been updated by pi:

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

commit f1fc9eed65fd6bfac035f48018ca5ad959420dfe
Author:     Kurt Jaeger <pi@FreeBSD.org>
AuthorDate: 2022-07-17 09:05:36 +0000
Commit:     Kurt Jaeger <pi@FreeBSD.org>
CommitDate: 2022-07-17 09:10:35 +0000

    net/openbgpd7: New port
    
    Release-Notes: https://marc.info/?l=openbgpd-users&m=165788800825316&w=2
    
    This version re-adds FIB support for FreeBSD (missing in net/openbgpd6).
    This means that this version propagades changes to the system routing tables.
    
    This version adds TCP MD5 support on FreeBSD.
    
    Sponsored-by: Klara Systems Inc.
---
 net/Makefile                          |  1 +
 net/openbgpd7/Makefile                | 30 ++++++++++++++++++++++++++++++
 net/openbgpd7/distinfo                |  3 +++
 net/openbgpd7/files/COPYING           | 19 +++++++++++++++++++
 net/openbgpd7/files/openbgpd.in       | 32 ++++++++++++++++++++++++++++++++
 net/openbgpd7/files/patch-Makefile.am | 22 ++++++++++++++++++++++
 net/openbgpd7/files/pkg-message.in    | 10 ++++++++++
 net/openbgpd7/pkg-descr               |  9 +++++++++
 net/openbgpd7/pkg-plist               |  8 ++++++++
 9 files changed, 134 insertions(+)

diff --git a/net/Makefile b/net/Makefile
index d1f2cdb4851a..6a9d96f70957 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -550,6 +550,7 @@
     SUBDIR += open-isns
     SUBDIR += openbgpd
     SUBDIR += openbgpd6
+    SUBDIR += openbgpd7
     SUBDIR += openldap24-client
     SUBDIR += openldap24-server
     SUBDIR += openldap25-client
diff --git a/net/openbgpd7/Makefile b/net/openbgpd7/Makefile
new file mode 100644
index 000000000000..00b3e66ba7c1
--- /dev/null
+++ b/net/openbgpd7/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	openbgpd
+PORTVERSION=	7.5
+CATEGORIES=	net
+MASTER_SITES=	OPENBSD/OpenBGPD
+PKGNAMESUFFIX=	7
+
+MAINTAINER=	pi@FreeBSD.org
+COMMENT=	Free implementation of the Border Gateway Protocol, Version 4
+
+LICENSE=	MIT
+LICENSE_FILE=	${FILESDIR}/COPYING
+
+USES=		autoreconf libtool localbase pathfix uidfix
+USE_RC_SUBR=	${PORTNAME}
+
+GNU_CONFIGURE=	yes
+
+SUB_FILES=	pkg-message
+
+USERS=		_bgpd
+GROUPS=		_bgpd
+
+CONFLICTS=	zebra quagga
+
+OPTIONS_DEFINE=		IPV6LLPEER
+OPTIONS_DEFAULT=	IPV6LLPEER
+IPV6LLPEER_DESC=	Support nexthop using IPv6 link-local address
+IPV6LLPEER_MAKE_ARGS=	-DIPV6_LINKLOCAL_PEER
+
+.include <bsd.port.mk>
diff --git a/net/openbgpd7/distinfo b/net/openbgpd7/distinfo
new file mode 100644
index 000000000000..f6b3eb765e57
--- /dev/null
+++ b/net/openbgpd7/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1658041955
+SHA256 (openbgpd-7.5.tar.gz) = 67a81b3005cb23416b1c4842f1a1ed63a113c26ef1e91ce9ec0b90dcd5caffea
+SIZE (openbgpd-7.5.tar.gz) = 789286
diff --git a/net/openbgpd7/files/COPYING b/net/openbgpd7/files/COPYING
new file mode 100644
index 000000000000..0e9cfc51f9c0
--- /dev/null
+++ b/net/openbgpd7/files/COPYING
@@ -0,0 +1,19 @@
+Copyright (c) 2003-2007 Henning Brauer <henning@openbsd.org>
+Copyright (c) 2002 Daniel Hartmeier <dhartmei@openbsd.org>
+Copyright (c) 2003, 2004, 2006 Claudio Jeker <claudio@openbsd.org>
+Copyright (c) 2003, 2004 Markus Friedl <markus@openbsd.org>
+Copyright (c) 2004 Damien Miller <djm@openbsd.org>
+Copyright (c) 2006, 2007, 2008 Reyk Floeter <reyk@openbsd.org>
+Copyright (c) 2006, 2007 Pierre-Yves Ritschard <pyr@openbsd.org>
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN
+AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/net/openbgpd7/files/openbgpd.in b/net/openbgpd7/files/openbgpd.in
new file mode 100644
index 000000000000..9f17d0032365
--- /dev/null
+++ b/net/openbgpd7/files/openbgpd.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# PROVIDE: bgpd dynamicrouting
+# REQUIRE: LOGIN abi
+# BEFORE:  securelevel
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable openbgpd:
+#
+# openbgpd_enable="YES"
+# openbgpd_flags="<set as needed>"
+#
+# See bgpd(8) for openbgpd_flags
+
+. /etc/rc.subr
+
+name=openbgpd
+rcvar=openbgpd_enable
+
+extra_commands=reload
+command="%%PREFIX%%/sbin/bgpd"
+required_files="%%PREFIX%%/etc/bgpd.conf"
+
+: ${openbgpd_enable=NO}
+
+check_process()
+{
+	/bin/pgrep -f 'bgpd: parent.*'
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/openbgpd7/files/patch-Makefile.am b/net/openbgpd7/files/patch-Makefile.am
new file mode 100644
index 000000000000..78ffb52c79fc
--- /dev/null
+++ b/net/openbgpd7/files/patch-Makefile.am
@@ -0,0 +1,22 @@
+--- Makefile.am.orig	2020-05-05 08:36:21 UTC
++++ Makefile.am
+@@ -19,13 +19,16 @@ ACLOCAL_AMFLAGS = -I m4
+ EXTRA_DIST = README.md LICENSE VERSION bgpd.conf
+ 
+ install-data-hook:
+-	@if [ ! -d "$(DESTDIR)$(runstatedir)" ]; then \
++	if [ ! -d "$(DESTDIR)$(runstatedir)" ]; then \
+ 		$(INSTALL) -m 755 -d "$(DESTDIR)$(runstatedir)"; \
+ 	fi
+-	@if [ ! -d "$(DESTDIR)$(sysconfdir)" ]; then \
++	if [ ! -d "$(DESTDIR)$(sysconfdir)" ]; then \
+ 		$(INSTALL) -m 755 -d "$(DESTDIR)$(sysconfdir)"; \
+ 	fi
+-	@if [ ! -f "$(DESTDIR)$(sysconfdir)/bgpd.conf" ]; then \
++	if [ ! -f "$(DESTDIR)$(sysconfdir)/bgpd.conf.sample" ]; then \
++		$(INSTALL) -m 644 "$(srcdir)/bgpd.conf" "$(DESTDIR)$(sysconfdir)/bgpd.conf.sample"; \
++	fi
++	if [ ! -f "$(DESTDIR)$(sysconfdir)/bgpd.conf" ]; then \
+ 		$(INSTALL) -m 644 "$(srcdir)/bgpd.conf" "$(DESTDIR)$(sysconfdir)/bgpd.conf"; \
+ 	else \
+ 		echo; \
diff --git a/net/openbgpd7/files/pkg-message.in b/net/openbgpd7/files/pkg-message.in
new file mode 100644
index 000000000000..4e6b1eb8a3be
--- /dev/null
+++ b/net/openbgpd7/files/pkg-message.in
@@ -0,0 +1,10 @@
+[
+{ type: install
+  message: <<EOM
+OpenBGPD has been successfully installed.
+
+Configuration file must be created at %%PREFIX%%/etc/bgpd.conf
+and permission set to 0600.
+EOM
+}
+]
diff --git a/net/openbgpd7/pkg-descr b/net/openbgpd7/pkg-descr
new file mode 100644
index 000000000000..79dc946dcb12
--- /dev/null
+++ b/net/openbgpd7/pkg-descr
@@ -0,0 +1,9 @@
+OpenBGPD is a FREE implementation of the Border Gateway Protocol, Version 4.
+It allows ordinary machines to be used as routers exchanging routes with
+other systems speaking the BGP protocol.
+
+This is the portable version and it does not have the means to
+influence kernel routing tables. It is only suitable for route
+servers/collectors.
+
+WWW: http://www.openbgpd.org/
diff --git a/net/openbgpd7/pkg-plist b/net/openbgpd7/pkg-plist
new file mode 100644
index 000000000000..b49cb6c5c3c0
--- /dev/null
+++ b/net/openbgpd7/pkg-plist
@@ -0,0 +1,8 @@
+sbin/bgpctl
+sbin/bgpd
+sbin/bgplgd
+man/man5/bgpd.conf.5.gz
+man/man8/bgpctl.8.gz
+man/man8/bgpd.8.gz
+man/man8/bgplgd.8.gz
+@sample etc/bgpd.conf.sample