You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
5.9 KiB

  1. #
  2. # Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
  3. # Copyright (C) 2014 OpenWrt.org
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. # $Id: Makefile $
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=openvswitch
  11. PKG_RELEASE:=3
  12. PKG_VERSION:=2.5.0
  13. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  14. PKG_LICENSE:=Apache-2.0
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_USE_MIPS16:=0
  17. PKG_SOURCE_PROTO:=git
  18. PKG_SOURCE_URL:=https://github.com/openvswitch/ovs
  19. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  20. PKG_SOURCE_VERSION:=98b94d1e7002063ce2ea3c3221fe9234cac4e124
  21. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  22. PKG_BUILD_PARALLEL:=1
  23. PKG_FIXUP:=autoreconf
  24. PKG_INSTALL:=1
  25. # Upstream package supports kernels between 2.6.32 and 4.3
  26. # see https://github.com/openvswitch/ovs/blob/master/FAQ.md
  27. # This list is pruned to only those kernels used in OpenWRT
  28. SUPPORTED_KERNELS:=LINUX_3_18||LINUX_4_1||LINUX_4_3
  29. include $(INCLUDE_DIR)/package.mk
  30. include $(INCLUDE_DIR)/kernel.mk
  31. $(call include_mk, python-package.mk)
  32. define Package/openvswitch/Default
  33. SECTION:=net
  34. CATEGORY:=Network
  35. URL:=http://openvswitch.org/
  36. MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  37. endef
  38. define Package/openvswitch/Default/description
  39. Open vSwitch is a production quality, multilayer, software-based, Ethernet
  40. virtual switch. It is designed to enable massive network automation through
  41. programmatic extension, while still supporting standard management interfaces
  42. and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In
  43. addition, it is designed to support distribution across multiple physical
  44. servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus
  45. 1000V.
  46. endef
  47. define Package/openvswitch
  48. $(call Package/openvswitch/Default)
  49. TITLE:=Open vSwitch Userspace Package
  50. DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS))
  51. endef
  52. define Package/openvswitch/description
  53. Provides the main userspace components required for Open vSwitch to function.
  54. endef
  55. define Package/openvswitch-python
  56. $(call Package/openvswitch/Default)
  57. TITLE:=Open vSwitch Python Support
  58. DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch +python
  59. endef
  60. define Package/openvswitch-python/description
  61. Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
  62. endef
  63. define Package/openvswitch-ipsec
  64. $(call Package/openvswitch/Default)
  65. TITLE:=Open vSwitch Userspace Package
  66. DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch-python
  67. endef
  68. define Package/openvswitch-ipsec/description
  69. The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
  70. IPsec.
  71. endef
  72. define Package/openvswitch-benchmark
  73. $(call Package/openvswitch/Default)
  74. TITLE:=Open vSwitch Userspace Package
  75. DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch
  76. endef
  77. define Package/openvswitch-benchmark/description
  78. Utility for running OpenVSwitch benchmarking
  79. endef
  80. define KernelPackage/openvswitch
  81. SECTION:=kernel
  82. CATEGORY:=Kernel modules
  83. SUBMENU:=Network Support
  84. TITLE:=Open vSwitch Kernel Package
  85. KCONFIG:=CONFIG_BRIDGE
  86. DEPENDS:=+kmod-stp @IPV6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan +kmod-nf-conntrack +kmod-nf-conntrack6 @($(SUPPORTED_KERNELS))
  87. FILES:= \
  88. $(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX)
  89. AUTOLOAD:=$(call AutoLoad,21,openvswitch)
  90. endef
  91. define KernelPackage/openvswitch/description
  92. This package contains the Open vSwitch kernel moodule and bridge compat
  93. module. Furthermore, it supports OpenFlow.
  94. endef
  95. CONFIGURE_ARGS += --with-linux=$(LINUX_DIR) --with-rundir=/var/run
  96. CONFIGURE_ARGS += --enable-ndebug
  97. CONFIGURE_ARGS += --disable-ssl
  98. CONFIGURE_ARGS += --enable-shared
  99. TARGET_CFLAGS += -flto -std=gnu99
  100. CONFIGURE_VARS += KARCH=$(LINUX_KARCH)
  101. MAKE_FLAGS += ARCH="$(LINUX_KARCH)"
  102. define Package/openvswitch/install
  103. $(INSTALL_DIR) $(1)/etc/openvswitch
  104. $(INSTALL_DIR) $(1)/etc/init.d
  105. $(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
  106. $(INSTALL_DIR) $(1)/usr/lib/
  107. $(CP) $(PKG_BUILD_DIR)/lib/.libs/libsflow.so* $(1)/usr/lib/
  108. $(CP) $(PKG_BUILD_DIR)/lib/.libs/libopenvswitch.so* $(1)/usr/lib/
  109. $(CP) $(PKG_BUILD_DIR)/ofproto/.libs/libofproto.so* $(1)/usr/lib/
  110. $(CP) $(PKG_BUILD_DIR)/ovsdb/.libs/libovsdb.so* $(1)/usr/lib/
  111. $(INSTALL_DIR) $(1)/usr/bin/
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-appctl $(1)/usr/bin/
  113. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-ofctl $(1)/usr/bin/
  114. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsdb/.libs/ovsdb-client $(1)/usr/bin/
  115. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-dpctl $(1)/usr/bin/
  116. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-vsctl $(1)/usr/bin/
  117. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsdb/.libs/ovsdb-tool $(1)/usr/bin/
  118. $(INSTALL_DIR) $(1)/usr/sbin/
  119. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vswitchd/.libs/ovs-vswitchd $(1)/usr/sbin/
  120. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsdb/.libs/ovsdb-server $(1)/usr/sbin/
  121. $(INSTALL_DIR) $(1)/usr/share/openvswitch/
  122. $(INSTALL_CONF) $(PKG_BUILD_DIR)/vswitchd/vswitch.ovsschema $(1)/usr/share/openvswitch/
  123. endef
  124. define Package/openvswitch-python/install
  125. $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
  126. $(CP) $(PKG_BUILD_DIR)/python/ovs/ $(1)/usr/lib/python$(PYTHON_VERSION)/
  127. endef
  128. define Package/openvswitch-ipsec/install
  129. $(INSTALL_DIR) $(1)/usr/sbin/
  130. $(INSTALL_BIN) $(PKG_BUILD_DIR)/debian/ovs-monitor-ipsec $(1)/usr/sbin/
  131. endef
  132. define Package/openvswitch-benchmark/install
  133. $(INSTALL_DIR) $(1)/usr/bin/
  134. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-benchmark $(1)/usr/bin/
  135. endef
  136. define Package/openvswitch/postinst
  137. #!/bin/sh
  138. [ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/openvswitch enable || true
  139. endef
  140. $(eval $(call BuildPackage,openvswitch))
  141. $(eval $(call BuildPackage,openvswitch-python))
  142. $(eval $(call BuildPackage,openvswitch-ipsec))
  143. $(eval $(call BuildPackage,openvswitch-benchmark))
  144. $(eval $(call KernelPackage,openvswitch))