summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Bracco <href@random.sh>2022-03-16 18:41:23 +0000
committerJordan Bracco <href@random.sh>2022-03-16 18:41:23 +0000
commit632de6abf4ebe2b31dfffd59ae03cf1e35006489 (patch)
tree89b976b63db5f23cb7b890efb06711c3abff091d
parentshells/starship: Update 1.3.0 -> 1.4.0 (diff)
net/openbgpd7: new port (wip)href/net/openbgpd7
-rw-r--r--net/openbgpd7/Makefile30
-rw-r--r--net/openbgpd7/distinfo3
-rw-r--r--net/openbgpd7/files/COPYING19
-rw-r--r--net/openbgpd7/files/openbgpd.in32
-rw-r--r--net/openbgpd7/files/patch-Makefile.am22
-rw-r--r--net/openbgpd7/files/patch-src__bgpctl__output_json.c11
-rw-r--r--net/openbgpd7/files/patch-src_bgpctl_output.c11
-rw-r--r--net/openbgpd7/files/patch-src_bgpd_bgpd.c11
-rw-r--r--net/openbgpd7/files/pkg-message.in10
-rw-r--r--net/openbgpd7/pkg-descr9
-rw-r--r--net/openbgpd7/pkg-plist6
11 files changed, 164 insertions, 0 deletions
diff --git a/net/openbgpd7/Makefile b/net/openbgpd7/Makefile
new file mode 100644
index 000000000000..ab185ed51b77
--- /dev/null
+++ b/net/openbgpd7/Makefile
@@ -0,0 +1,30 @@
+PORTNAME= openbgpd
+PORTVERSION= 7.2
+CATEGORIES= net
+MASTER_SITES= OPENBSD/OpenBGPD
+PKGNAMESUFFIX= 7
+
+MAINTAINER= href@random.sh
+COMMENT= Free implementation of the Border Gateway Protocol, Version 7
+
+LICENSE= ISCL
+LICENSE_FILE= ${FILESDIR}/COPYING
+
+USES= autoreconf libtool 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..3ec73bea7e2e
--- /dev/null
+++ b/net/openbgpd7/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1647448632
+SHA256 (openbgpd-7.2.tar.gz) = e4f40612067a0c9ee440cc1438e9845be8f529a6872e3690f508ec40286a058c
+SIZE (openbgpd-7.2.tar.gz) = 732784
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/patch-src__bgpctl__output_json.c b/net/openbgpd7/files/patch-src__bgpctl__output_json.c
new file mode 100644
index 000000000000..734515c07811
--- /dev/null
+++ b/net/openbgpd7/files/patch-src__bgpctl__output_json.c
@@ -0,0 +1,11 @@
+--- src/bgpctl/output_json.c.orig 2020-05-18 19:17:41 UTC
++++ src/bgpctl/output_json.c
+@@ -22,6 +22,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+
++#include <sys/endian.h>
++
+ #include "bgpd.h"
+ #include "session.h"
+ #include "rde.h"
diff --git a/net/openbgpd7/files/patch-src_bgpctl_output.c b/net/openbgpd7/files/patch-src_bgpctl_output.c
new file mode 100644
index 000000000000..a1d2b38db88f
--- /dev/null
+++ b/net/openbgpd7/files/patch-src_bgpctl_output.c
@@ -0,0 +1,11 @@
+--- src/bgpctl/output.c.orig 2020-05-18 19:17:41 UTC
++++ src/bgpctl/output.c
+@@ -25,6 +25,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+
++#include <sys/endian.h>
++
+ #include "bgpd.h"
+ #include "session.h"
+ #include "rde.h"
diff --git a/net/openbgpd7/files/patch-src_bgpd_bgpd.c b/net/openbgpd7/files/patch-src_bgpd_bgpd.c
new file mode 100644
index 000000000000..b4a072e4cfc4
--- /dev/null
+++ b/net/openbgpd7/files/patch-src_bgpd_bgpd.c
@@ -0,0 +1,11 @@
+--- src/bgpd/bgpd.c.orig 2020-05-18 19:17:41 UTC
++++ src/bgpd/bgpd.c
+@@ -61,6 +61,8 @@ struct rib_names ribnames = SIMPLEQ_HEAD_INITIALIZER(
+ char *cname;
+ char *rcname;
+
++enum bgpd_process bgpd_process;
++
+ void
+ sighdlr(int sig)
+ {
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..76795a6b9942
--- /dev/null
+++ b/net/openbgpd7/pkg-plist
@@ -0,0 +1,6 @@
+sbin/bgpctl
+sbin/bgpd
+man/man5/bgpd.conf.5.gz
+man/man8/bgpctl.8.gz
+man/man8/bgpd.8.gz
+@sample etc/bgpd.conf.sample