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.

173 lines
5.6 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.3.90
  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:=58be9c9fd732b5bdd3d4c2e9b8cc2313f570094d
  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. SUPPORTED_KERNELS:=LINUX_3_8||LINUX_3_10||LINUX_3_13||LINUX_3_14||LINUX_3_18||LINUX_4_0
  26. include $(INCLUDE_DIR)/package.mk
  27. include $(INCLUDE_DIR)/kernel.mk
  28. $(call include_mk, python-package.mk)
  29. define Package/openvswitch/Default
  30. SECTION:=net
  31. CATEGORY:=Network
  32. URL:=http://openvswitch.org/
  33. MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  34. endef
  35. define Package/openvswitch/Default/description
  36. Open vSwitch is a production quality, multilayer, software-based, Ethernet
  37. virtual switch. It is designed to enable massive network automation through
  38. programmatic extension, while still supporting standard management interfaces
  39. and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In
  40. addition, it is designed to support distribution across multiple physical
  41. servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus
  42. 1000V.
  43. endef
  44. define Package/openvswitch
  45. $(call Package/openvswitch/Default)
  46. TITLE:=Open vSwitch Userspace Package
  47. DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS))
  48. endef
  49. define Package/openvswitch/description
  50. Provides the main userspace components required for Open vSwitch to function.
  51. endef
  52. define Package/openvswitch-python
  53. $(call Package/openvswitch/Default)
  54. TITLE:=Open vSwitch Python Support
  55. DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch +python
  56. endef
  57. define Package/openvswitch-python/description
  58. Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
  59. endef
  60. define Package/openvswitch-ipsec
  61. $(call Package/openvswitch/Default)
  62. TITLE:=Open vSwitch Userspace Package
  63. DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch-python
  64. endef
  65. define Package/openvswitch-ipsec/description
  66. The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
  67. IPsec.
  68. endef
  69. define Package/openvswitch-benchmark
  70. $(call Package/openvswitch/Default)
  71. TITLE:=Open vSwitch Userspace Package
  72. DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch
  73. endef
  74. define Package/openvswitch-benchmark/description
  75. Utility for running OpenVSwitch benchmarking
  76. endef
  77. define KernelPackage/openvswitch
  78. SECTION:=kernel
  79. CATEGORY:=Kernel modules
  80. SUBMENU:=Network Support
  81. TITLE:=Open vSwitch Kernel Package
  82. KCONFIG:=CONFIG_BRIDGE
  83. DEPENDS:=+kmod-stp +kmod-ipv6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan @($(SUPPORTED_KERNELS))
  84. FILES:= \
  85. $(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX)
  86. AUTOLOAD:=$(call AutoLoad,21,openvswitch)
  87. endef
  88. define KernelPackage/openvswitch/description
  89. This package contains the Open vSwitch kernel moodule and bridge compat
  90. module. Furthermore, it supports OpenFlow.
  91. endef
  92. CONFIGURE_ARGS += --with-linux=$(LINUX_DIR) --with-rundir=/var/run
  93. CONFIGURE_ARGS += --enable-ndebug
  94. CONFIGURE_ARGS += --disable-ssl
  95. CONFIGURE_ARGS += --enable-shared
  96. TARGET_CFLAGS += -flto -std=gnu99
  97. define Package/openvswitch/install
  98. $(INSTALL_DIR) $(1)/etc/openvswitch
  99. $(INSTALL_DIR) $(1)/etc/init.d
  100. $(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
  101. $(INSTALL_DIR) $(1)/usr/lib/
  102. $(CP) $(PKG_BUILD_DIR)/lib/.libs/libsflow.so* $(1)/usr/lib/
  103. $(CP) $(PKG_BUILD_DIR)/lib/.libs/libopenvswitch.so* $(1)/usr/lib/
  104. $(CP) $(PKG_BUILD_DIR)/ofproto/.libs/libofproto.so* $(1)/usr/lib/
  105. $(CP) $(PKG_BUILD_DIR)/ovsdb/.libs/libovsdb.so* $(1)/usr/lib/
  106. $(INSTALL_DIR) $(1)/usr/bin/
  107. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-appctl $(1)/usr/bin/
  108. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-ofctl $(1)/usr/bin/
  109. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsdb/.libs/ovsdb-client $(1)/usr/bin/
  110. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-dpctl $(1)/usr/bin/
  111. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-vsctl $(1)/usr/bin/
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsdb/.libs/ovsdb-tool $(1)/usr/bin/
  113. $(INSTALL_DIR) $(1)/usr/sbin/
  114. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vswitchd/.libs/ovs-vswitchd $(1)/usr/sbin/
  115. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsdb/.libs/ovsdb-server $(1)/usr/sbin/
  116. $(INSTALL_DIR) $(1)/usr/share/openvswitch/
  117. $(INSTALL_CONF) $(PKG_BUILD_DIR)/vswitchd/vswitch.ovsschema $(1)/usr/share/openvswitch/
  118. endef
  119. define Package/openvswitch-python/install
  120. $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
  121. $(CP) $(PKG_BUILD_DIR)/python/ovs/ $(1)/usr/lib/python$(PYTHON_VERSION)/
  122. endef
  123. define Package/openvswitch-ipsec/install
  124. $(INSTALL_DIR) $(1)/usr/sbin/
  125. $(INSTALL_BIN) $(PKG_BUILD_DIR)/debian/ovs-monitor-ipsec $(1)/usr/sbin/
  126. endef
  127. define Package/openvswitch-benchmark/install
  128. $(INSTALL_DIR) $(1)/usr/bin/
  129. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-benchmark $(1)/usr/bin/
  130. endef
  131. define Package/openvswitch/postinst
  132. #!/bin/sh
  133. [ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/openvswitch enable || true
  134. endef
  135. $(eval $(call BuildPackage,openvswitch))
  136. $(eval $(call BuildPackage,openvswitch-python))
  137. $(eval $(call BuildPackage,openvswitch-ipsec))
  138. $(eval $(call BuildPackage,openvswitch-benchmark))
  139. $(eval $(call KernelPackage,openvswitch))