From d598b934d8a70b7ae5724f815534aa8cee101cd4 Mon Sep 17 00:00:00 2001 From: Dima Panov Date: Thu, 27 Apr 2023 22:36:44 +0300 Subject: [PATCH 1/3] net/openswitch-lts: copy from openswitch before it goes to 3.x series --- net/Makefile | 1 + net/openvswitch-lts/Makefile | 56 +++++ net/openvswitch-lts/distinfo | 3 + net/openvswitch-lts/files/ovs-vswitchd.in | 29 +++ net/openvswitch-lts/files/ovsdb-server.in | 37 ++++ net/openvswitch-lts/files/patch-configure | 11 + .../files/patch-lib_dns-resolve.c | 10 + net/openvswitch-lts/pkg-descr | 7 + net/openvswitch-lts/pkg-plist | 194 ++++++++++++++++++ 9 files changed, 348 insertions(+) create mode 100644 net/openvswitch-lts/Makefile create mode 100644 net/openvswitch-lts/distinfo create mode 100644 net/openvswitch-lts/files/ovs-vswitchd.in create mode 100644 net/openvswitch-lts/files/ovsdb-server.in create mode 100644 net/openvswitch-lts/files/patch-configure create mode 100644 net/openvswitch-lts/files/patch-lib_dns-resolve.c create mode 100644 net/openvswitch-lts/pkg-descr create mode 100644 net/openvswitch-lts/pkg-plist diff --git a/net/Makefile b/net/Makefile index 5691f3ea1404..5db87d4d8471 100644 --- a/net/Makefile +++ b/net/Makefile @@ -582,6 +582,7 @@ SUBDIR += opensips31 SUBDIR += openslp SUBDIR += openvswitch + SUBDIR += openvswitch-lts SUBDIR += ortp SUBDIR += osrtspproxy SUBDIR += ossp-sa diff --git a/net/openvswitch-lts/Makefile b/net/openvswitch-lts/Makefile new file mode 100644 index 000000000000..903bb7ec1484 --- /dev/null +++ b/net/openvswitch-lts/Makefile @@ -0,0 +1,56 @@ +PORTNAME= openvswitch +DISTVERSION= 2.17.3 +CATEGORIES= net +MASTER_SITES= http://openvswitch.org/releases/ + +MAINTAINER= nc@FreeBSD.org +COMMENT= Production quality, multilayer virtual switch +WWW= http://openvswitch.org/ + +LICENSE= APACHE20 + +BROKEN_mips64= fails to compile: ofp-actions.h:486: flexible array member in otherwise empty struct + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} + +USES= compiler:c11 cpe gmake libtool perl5 pkgconfig python:3.7-3.9 \ + shebangfix ssl +SHEBANG_FILES= ipsec/ovs-monitor-ipsec.in \ + utilities/bugtool/ovs-bugtool-get-port-stats \ + utilities/bugtool/ovs-bugtool-ovs-ofctl-loop-over-bridges \ + utilities/bugtool/ovs-bugtool.in \ + utilities/ovs-appctl-bashcomp.bash \ + utilities/ovs-check-dead-ifs.in \ + utilities/ovs-docker \ + utilities/ovs-dpctl-top.in \ + utilities/ovs-l3ping.in \ + utilities/ovs-parse-backtrace.in \ + utilities/ovs-pcap.in \ + utilities/ovs-tcpdump.in \ + utilities/ovs-tcpundump.in \ + utilities/ovs-test.in \ + utilities/ovs-vlan-test.in \ + vtep/ovs-vtep.in + +USE_LDCONFIG= yes +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --enable-shared --disable-static --localstatedir=/var \ + --with-dbdir=/var/db/${PORTNAME} \ + --with-openssl=${OPENSSLBASE} +USE_RC_SUBR= ovs-vswitchd ovsdb-server +LDFLAGS+= -lpthread +INSTALL_TARGET=install-strip + +SHLIB_VER= ${DISTVERSION:C/\.[0-9]*$//} +PLIST_SUB= SHLIB_VER=${SHLIB_VER} + +post-patch: + @${REINPLACE_CMD} -e 's|uuid_from_string(|uuid_from_string_ovs(|g' \ + ${WRKSRC}/*/*.c ${WRKSRC}/*/*.h + +post-install: + ${MKDIR} ${STAGEDIR}/var/run/openvswitch + ${MKDIR} ${STAGEDIR}/var/log/openvswitch + ${INSTALL_DATA} ${WRKSRC}/vswitchd/vswitch.ovsschema ${STAGEDIR}${PREFIX}/share/openvswitch/ + +.include diff --git a/net/openvswitch-lts/distinfo b/net/openvswitch-lts/distinfo new file mode 100644 index 000000000000..92208ae83a78 --- /dev/null +++ b/net/openvswitch-lts/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1665347341 +SHA256 (openvswitch-2.17.3.tar.gz) = 446811fc91ae245cc31904a69371fb0bf0446f7b24eb239a037db400353011c0 +SIZE (openvswitch-2.17.3.tar.gz) = 7977353 diff --git a/net/openvswitch-lts/files/ovs-vswitchd.in b/net/openvswitch-lts/files/ovs-vswitchd.in new file mode 100644 index 000000000000..d4b49ebafa69 --- /dev/null +++ b/net/openvswitch-lts/files/ovs-vswitchd.in @@ -0,0 +1,29 @@ +#!/bin/sh + +# PROVIDE: ovs_vswitchd +# REQUIRE: LOGIN ovsdb_server +# KEYWORD: shutdown + +. /etc/rc.subr + +name="ovs_vswitchd" +rcvar=ovs_vswitchd_enable + +command="/usr/local/sbin/ovs-vswitchd" +start_precmd="ovs_vswitchd_precmd" + +load_rc_config $name + +: ${ovs_vswitchd_enable="NO"} +: ${ovs_vswitchd_flags=""} +: ${ovs_vswitchd_logfile="/var/log/openvswitch/${name}.log"} +: ${ovs_vswitchd_pidfile="/var/run/openvswitch/${name}.pid"} + +ovs_vswitchd_precmd() { + load_kld if_tap || return 1 +} + +command_args="--detach --log-file=${ovs_vswitchd_logfile} \ + --pidfile=${ovs_vswitchd_pidfile} ${ovs_vswitchd_flags}" + +run_rc_command "$1" diff --git a/net/openvswitch-lts/files/ovsdb-server.in b/net/openvswitch-lts/files/ovsdb-server.in new file mode 100644 index 000000000000..88c85efb87a7 --- /dev/null +++ b/net/openvswitch-lts/files/ovsdb-server.in @@ -0,0 +1,37 @@ +#!/bin/sh + +# PROVIDE: ovsdb_server +# REQUIRE: LOGIN +# KEYWORD: shutdown + +. /etc/rc.subr + +name="ovsdb_server" +rcvar=ovsdb_server_enable + +command="/usr/local/sbin/ovsdb-server" +pidfile="/var/run/ovsdb-server.pid" +start_precmd="ovsdb_server_precmd" + +load_rc_config $name + +: ${ovsdb_server_enable="NO"} +: ${ovsdb_server_sock="/var/run/openvswitch/db.sock"} +: ${ovsdb_server_database="/var/db/openvswitch/conf.db"} + +ovsdb_server_precmd() { + [ -e "`dirname $ovsdb_server_database`" ] || \ + mkdir -p "`dirname $ovsdb_server_database`" + [ -e "$ovsdb_server_database" ] || \ + /usr/local/bin/ovsdb-tool create "$ovsdb_server_database" \ + /usr/local/share/openvswitch/vswitch.ovsschema +} + +command_args="--detach --pidfile=$pidfile \ + --remote=punix:$ovsdb_server_sock \ + --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ + --private-key=db:Open_vSwitch,SSL,private_key \ + --certificate=db:Open_vSwitch,SSL,certificate \ + --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert" + +run_rc_command "$1" diff --git a/net/openvswitch-lts/files/patch-configure b/net/openvswitch-lts/files/patch-configure new file mode 100644 index 000000000000..afac13f26bf6 --- /dev/null +++ b/net/openvswitch-lts/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig 2021-02-15 18:24:25 UTC ++++ configure +@@ -18326,7 +18326,7 @@ else + ovs_cv_python3=$PYTHON3 + else + ovs_cv_python3=no +- for binary in python3 python3.4 python3.5 python3.6 python3.7; do ++ for binary in python3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9; do + ovs_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for dir in $PATH; do + IFS=$ovs_save_IFS diff --git a/net/openvswitch-lts/files/patch-lib_dns-resolve.c b/net/openvswitch-lts/files/patch-lib_dns-resolve.c new file mode 100644 index 000000000000..ea52505fe871 --- /dev/null +++ b/net/openvswitch-lts/files/patch-lib_dns-resolve.c @@ -0,0 +1,10 @@ +--- lib/dns-resolve.c.orig 2019-10-18 14:20:09 UTC ++++ lib/dns-resolve.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + #include "hash.h" diff --git a/net/openvswitch-lts/pkg-descr b/net/openvswitch-lts/pkg-descr new file mode 100644 index 000000000000..13f2ac773072 --- /dev/null +++ b/net/openvswitch-lts/pkg-descr @@ -0,0 +1,7 @@ +Open vSwitch is a production quality, multilayer virtual switch licensed +under the open source Apache 2.0 license. It is designed to enable massive +network automation through programmatic extension, while still supporting +standard management interfaces and protocols (e.g. NetFlow, sFlow, RSPAN, +ERSPAN, CLI, LACP, 802.1ag). In addition, it is designed to support +distribution across multiple physical servers similar to VMware's vNetwork +distributed vswitch or Cisco's Nexus 1000V. diff --git a/net/openvswitch-lts/pkg-plist b/net/openvswitch-lts/pkg-plist new file mode 100644 index 000000000000..d0f324342202 --- /dev/null +++ b/net/openvswitch-lts/pkg-plist @@ -0,0 +1,194 @@ +bin/ovs-appctl +bin/ovs-docker +bin/ovs-dpctl +bin/ovs-dpctl-top +bin/ovs-l3ping +bin/ovs-ofctl +bin/ovs-parse-backtrace +bin/ovs-pcap +bin/ovs-pki +bin/ovs-tcpdump +bin/ovs-tcpundump +bin/ovs-test +bin/ovs-testcontroller +bin/ovs-vlan-test +bin/ovs-vsctl +bin/ovsdb-client +bin/ovsdb-tool +bin/vtep-ctl +etc/bash_completion.d/ovs-appctl-bashcomp.bash +etc/bash_completion.d/ovs-vsctl-bashcomp.bash +include/openflow/intel-ext.h +include/openflow/netronome-ext.h +include/openflow/nicira-ext.h +include/openflow/openflow-1.0.h +include/openflow/openflow-1.1.h +include/openflow/openflow-1.2.h +include/openflow/openflow-1.3.h +include/openflow/openflow-1.4.h +include/openflow/openflow-1.5.h +include/openflow/openflow-common.h +include/openflow/openflow.h +include/openvswitch/compiler.h +include/openvswitch/dynamic-string.h +include/openvswitch/flow.h +include/openvswitch/geneve.h +include/openvswitch/hmap.h +include/openvswitch/json.h +include/openvswitch/list.h +include/openvswitch/match.h +include/openvswitch/meta-flow.h +include/openvswitch/namemap.h +include/openvswitch/netdev.h +include/openvswitch/nsh.h +include/openvswitch/ofp-actions.h +include/openvswitch/ofp-bundle.h +include/openvswitch/ofp-connection.h +include/openvswitch/ofp-ed-props.h +include/openvswitch/ofp-errors.h +include/openvswitch/ofp-flow.h +include/openvswitch/ofp-group.h +include/openvswitch/ofp-ipfix.h +include/openvswitch/ofp-match.h +include/openvswitch/ofp-meter.h +include/openvswitch/ofp-monitor.h +include/openvswitch/ofp-msgs.h +include/openvswitch/ofp-packet.h +include/openvswitch/ofp-parse.h +include/openvswitch/ofp-port.h +include/openvswitch/ofp-print.h +include/openvswitch/ofp-prop.h +include/openvswitch/ofp-protocol.h +include/openvswitch/ofp-queue.h +include/openvswitch/ofp-switch.h +include/openvswitch/ofp-table.h +include/openvswitch/ofp-util.h +include/openvswitch/ofpbuf.h +include/openvswitch/packets.h +include/openvswitch/poll-loop.h +include/openvswitch/rconn.h +include/openvswitch/shash.h +include/openvswitch/thread.h +include/openvswitch/token-bucket.h +include/openvswitch/tun-metadata.h +include/openvswitch/type-props.h +include/openvswitch/types.h +include/openvswitch/usdt-probes.h +include/openvswitch/util.h +include/openvswitch/uuid.h +include/openvswitch/vconn.h +include/openvswitch/version.h +include/openvswitch/vlog.h +lib/libofproto-%%SHLIB_VER%%.so.0 +lib/libofproto-%%SHLIB_VER%%.so.0.0.3 +lib/libofproto.so +lib/libopenvswitch-%%SHLIB_VER%%.so.0 +lib/libopenvswitch-%%SHLIB_VER%%.so.0.0.3 +lib/libopenvswitch.so +lib/libovsdb-%%SHLIB_VER%%.so.0 +lib/libovsdb-%%SHLIB_VER%%.so.0.0.3 +lib/libovsdb.so +lib/libsflow-%%SHLIB_VER%%.so.0 +lib/libsflow-%%SHLIB_VER%%.so.0.0.3 +lib/libsflow.so +lib/libvtep-%%SHLIB_VER%%.so.0 +lib/libvtep-%%SHLIB_VER%%.so.0.0.3 +lib/libvtep.so +libdata/pkgconfig/libofproto.pc +libdata/pkgconfig/libopenvswitch.pc +libdata/pkgconfig/libovsdb.pc +libdata/pkgconfig/libsflow.pc +man/man1/ovs-pcap.1.gz +man/man1/ovsdb-client.1.gz +man/man1/ovsdb-server.1.gz +man/man1/ovsdb-tool.1.gz +man/man5/ovs-vswitchd.conf.db.5.gz +man/man5/ovsdb-server.5.gz +man/man5/ovsdb.local-config.5.gz +man/man5/vtep.5.gz +man/man7/ovs-fields.7.gz +man/man8/ovs-bugtool.8.gz +man/man8/ovs-dpctl-top.8.gz +man/man8/ovs-dpctl.8.gz +man/man8/ovs-kmod-ctl.8.gz +man/man8/ovs-ofctl.8.gz +man/man8/ovs-testcontroller.8.gz +man/man8/ovs-vsctl.8.gz +man/man8/ovs-vswitchd.8.gz +man/man8/vtep-ctl.8.gz +sbin/ovs-bugtool +sbin/ovs-vswitchd +sbin/ovsdb-server +%%DATADIR%%/bugtool-plugins/kernel-info/openvswitch.xml +%%DATADIR%%/bugtool-plugins/network-status/openvswitch.xml +%%DATADIR%%/bugtool-plugins/system-configuration.xml +%%DATADIR%%/bugtool-plugins/system-configuration/openvswitch.xml +%%DATADIR%%/bugtool-plugins/system-logs/openvswitch.xml +%%DATADIR%%/local-config.ovsschema +%%DATADIR%%/python/ovs/__init__.py +%%DATADIR%%/python/ovs/compat/__init__.py +%%DATADIR%%/python/ovs/compat/sortedcontainers/__init__.py +%%DATADIR%%/python/ovs/compat/sortedcontainers/sorteddict.py +%%DATADIR%%/python/ovs/compat/sortedcontainers/sortedlist.py +%%DATADIR%%/python/ovs/compat/sortedcontainers/sortedset.py +%%DATADIR%%/python/ovs/daemon.py +%%DATADIR%%/python/ovs/db/__init__.py +%%DATADIR%%/python/ovs/db/custom_index.py +%%DATADIR%%/python/ovs/db/data.py +%%DATADIR%%/python/ovs/db/error.py +%%DATADIR%%/python/ovs/db/idl.py +%%DATADIR%%/python/ovs/db/parser.py +%%DATADIR%%/python/ovs/db/schema.py +%%DATADIR%%/python/ovs/db/types.py +%%DATADIR%%/python/ovs/dirs.py +%%DATADIR%%/python/ovs/fatal_signal.py +%%DATADIR%%/python/ovs/fcntl_win.py +%%DATADIR%%/python/ovs/json.py +%%DATADIR%%/python/ovs/jsonrpc.py +%%DATADIR%%/python/ovs/ovsuuid.py +%%DATADIR%%/python/ovs/poller.py +%%DATADIR%%/python/ovs/process.py +%%DATADIR%%/python/ovs/reconnect.py +%%DATADIR%%/python/ovs/socket_util.py +%%DATADIR%%/python/ovs/stream.py +%%DATADIR%%/python/ovs/timeval.py +%%DATADIR%%/python/ovs/unixctl/__init__.py +%%DATADIR%%/python/ovs/unixctl/client.py +%%DATADIR%%/python/ovs/unixctl/server.py +%%DATADIR%%/python/ovs/util.py +%%DATADIR%%/python/ovs/version.py +%%DATADIR%%/python/ovs/vlog.py +%%DATADIR%%/python/ovs/winutils.py +%%DATADIR%%/python/ovstest/__init__.py +%%DATADIR%%/python/ovstest/args.py +%%DATADIR%%/python/ovstest/rpcserver.py +%%DATADIR%%/python/ovstest/tcp.py +%%DATADIR%%/python/ovstest/tests.py +%%DATADIR%%/python/ovstest/udp.py +%%DATADIR%%/python/ovstest/util.py +%%DATADIR%%/python/ovstest/vswitch.py +%%DATADIR%%/scripts/ovs-bugtool-daemons-ver +%%DATADIR%%/scripts/ovs-bugtool-fdb-show +%%DATADIR%%/scripts/ovs-bugtool-get-dpdk-nic-numa +%%DATADIR%%/scripts/ovs-bugtool-get-port-stats +%%DATADIR%%/scripts/ovs-bugtool-ovs-appctl-dpif +%%DATADIR%%/scripts/ovs-bugtool-ovs-bridge-datapath-type +%%DATADIR%%/scripts/ovs-bugtool-ovs-ofctl-loop-over-bridges +%%DATADIR%%/scripts/ovs-bugtool-ovs-vswitchd-threads-affinity +%%DATADIR%%/scripts/ovs-bugtool-qos-configs +%%DATADIR%%/scripts/ovs-bugtool-tc-class-show +%%DATADIR%%/scripts/ovs-check-dead-ifs +%%DATADIR%%/scripts/ovs-ctl +%%DATADIR%%/scripts/ovs-kmod-ctl +%%DATADIR%%/scripts/ovs-lib +%%DATADIR%%/scripts/ovs-monitor-ipsec +%%DATADIR%%/scripts/ovs-save +%%DATADIR%%/scripts/ovs-vtep +%%DATADIR%%/vswitch.ovsschema +%%DATADIR%%/vtep.ovsschema +@dir %%ETCDIR%% +@dir /var/lib/openvswitch/pki +@dir /var/lib/openvswitch +@dir /var/lib +@dir /var/log/openvswitch +@dir /var/run/openvswitch -- 2.40.0