From f31a9349ead21acc6fc1c4274f59e40abaf31f2b Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 23 Mar 2020 09:59:30 +0800 Subject: [PATCH] ovn: initial version 20.03.0 Compared to original packaging scheme within openvswitch, we removed ovn-trace, ovn-detrace from openvswitch-ovn-common package. ovn-detrace requires python libs to run, so it does not actually work out of box in previous builds anyway. Signed-off-by: Yousong Zhou --- net/ovn/Makefile | 93 +++++++++++++++++++ .../0001-build-skip-building-tests.patch | 22 +++++ .../0002-ovn-lib-fix-install_dir.patch | 28 ++++++ 3 files changed, 143 insertions(+) create mode 100644 net/ovn/Makefile create mode 100644 net/ovn/patches/0001-build-skip-building-tests.patch create mode 100644 net/ovn/patches/0002-ovn-lib-fix-install_dir.patch diff --git a/net/ovn/Makefile b/net/ovn/Makefile new file mode 100644 index 000000000..4c686526a --- /dev/null +++ b/net/ovn/Makefile @@ -0,0 +1,93 @@ +# +# Copyright (C) 2020 Yousong Zhou +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk +include ../openvswitch/openvswitch.mk + +PKG_NAME:=ovn +PKG_VERSION:=20.03.0 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/ovn-org/ovn.git +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_MIRROR_HASH:=8d1cf00ce563bfeea72f5a5f86d82df07f762133b0ac7661a625b637b02e410a + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:openvswitch:openvswitch + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DEPENDS+=python3/host python-six/host +PKG_USE_MIPS16:=0 +PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_MAINTAINER:=Yousong Zhou + +include $(INCLUDE_DIR)/package.mk +include ../../lang/python/python3-host.mk + + +ovs_libovn_title:=Open vSwitch (libovn.so) +ovs_libovn_hidden:=1 +ovs_libovn_depends:=+librt +ovs_libovn_files:=usr/lib/libovn*.so* +$(eval $(call OvsPackageTemplate,libovn)) + + +ovs_ovn-common_title:=Open Virtual Network (common files) +ovs_ovn-common_hidden:=1 +ovs_ovn-common_depends:=+librt +openvswitch-common +openvswitch-libopenvswitch +openvswitch-libovn +openvswitch-libovsdb +ovs_ovn-common_files:= \ + usr/share/ovn/scripts/ovn-ctl \ + usr/share/ovn/scripts/ovn-lib \ + $(foreach b,ovn-nbctl ovn-sbctl,usr/bin/$(b)) +define ovs_ovn-common_install + $$(LN) /usr/share/openvswitch/scripts/ovs-ctl-wrapper $$(1)/usr/bin/ovn-ctl +endef +$(eval $(call OvsPackageTemplate,ovn-common)) + + +ovs_ovn-north_title:=Open Virtual Network (north package) +ovs_ovn-north_hidden:= +ovs_ovn-north_depends:=+openvswitch-ovsdb +openvswitch-ovn-common +ovs_ovn-north_files:=\ + usr/share/ovn/ovn-nb.ovsschema \ + usr/share/ovn/ovn-sb.ovsschema \ + usr/bin/ovn-northd +$(eval $(call OvsPackageTemplate,ovn-north)) + + +ovs_ovn-host_title:=Open Virtual Network (chassis package) +ovs_ovn-host_hidden:= +ovs_ovn-host_depends:=+openvswitch +openvswitch-ovn-common +ovs_ovn-host_files:=usr/bin/ovn-controller +$(eval $(call OvsPackageTemplate,ovn-host)) + + +CONFIGURE_ARGS+= \ + --enable-ndebug \ + --enable-shared \ + --disable-libcapng \ + --disable-silent-rules \ + --with-ovs-source=$(ovs_builddir) \ + --with-ovs-build=$(ovs_builddir) \ + +CONFIGURE_VARS += \ + ovs_cv_flake8=no \ + ovs_cv_sphinx=no \ + ovs_cv_python3=$(HOST_PYTHON3_BIN) \ + + +TARGET_CFLAGS += -flto -std=gnu99 +MAKE_VARS += PYTHONPATH="$(HOST_PYTHON3PATH)" + +$(foreach p,$(ovs_packages),\ + $(eval $(call BuildPackage,$(p)))\ +) diff --git a/net/ovn/patches/0001-build-skip-building-tests.patch b/net/ovn/patches/0001-build-skip-building-tests.patch new file mode 100644 index 000000000..29842411c --- /dev/null +++ b/net/ovn/patches/0001-build-skip-building-tests.patch @@ -0,0 +1,22 @@ +From d048a1e98363197c0d2609f6adb6919bde473df4 Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Mon, 23 Mar 2020 14:18:30 +0800 +Subject: [PATCH] build: skip building tests + +Signed-off-by: Yousong Zhou +--- + Makefile.am | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 04400e184..b2c42d84c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -492,7 +492,6 @@ include Documentation/automake.mk + include m4/automake.mk + include lib/automake.mk + include utilities/automake.mk +-include tests/automake.mk + include include/automake.mk + include third-party/automake.mk + include debian/automake.mk diff --git a/net/ovn/patches/0002-ovn-lib-fix-install_dir.patch b/net/ovn/patches/0002-ovn-lib-fix-install_dir.patch new file mode 100644 index 000000000..b67dfd7b7 --- /dev/null +++ b/net/ovn/patches/0002-ovn-lib-fix-install_dir.patch @@ -0,0 +1,28 @@ +From ecf232bf32dd433642bb9da2ac0c2de483b8736a Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Mon, 23 Mar 2020 15:54:26 +0800 +Subject: [PATCH] ovn-lib: fix install_dir() + +The command "install" is not available in OpenWrt by default + +Signed-off-by: Yousong Zhou +--- + utilities/ovn-lib.in | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/utilities/ovn-lib.in b/utilities/ovn-lib.in +index af1b72edb..f6ab5581c 100644 +--- a/utilities/ovn-lib.in ++++ b/utilities/ovn-lib.in +@@ -54,7 +54,10 @@ ovn_install_dir () { + [ "${OVN_USER##*:}" != "" ] && INSTALL_GROUP="${OVN_USER##*:}" + + if test ! -d "$DIR"; then +- install -d -m "$INSTALL_MODE" -o "$INSTALL_USER" -g "$INSTALL_GROUP" "$DIR" ++ mkdir -p "$DIR" ++ chmod "$INSTALL_MODE" "$DIR" ++ chown "$INSTALL_USER" "$DIR" ++ chgrp "$INSTALL_GROUP" "$DIR" + restorecon "$DIR" >/dev/null 2>&1 + fi + }