openvswitch: pull released version 2.5.0
[feed/packages.git] / net / openvswitch / Makefile
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
10 include $(TOPDIR)/rules.mk
11 include $(INCLUDE_DIR)/kernel.mk
12
13 PKG_NAME:=openvswitch
14
15 PKG_RELEASE:=5
16 PKG_VERSION:=2.5.0
17 PKG_RELEASE=$(PKG_SOURCE_VERSION)
18 PKG_LICENSE:=Apache-2.0
19 PKG_LICENSE_FILES:=COPYING
20 PKG_USE_MIPS16:=0
21
22 PKG_SOURCE_PROTO:=git
23 PKG_SOURCE_URL:=https://github.com/openvswitch/ovs
24 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
25 PKG_SOURCE_VERSION:=22d4614ddf83988a3771fb379ea029e663b4455a
26 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
27
28 PKG_BUILD_PARALLEL:=1
29 PKG_FIXUP:=autoreconf
30 PKG_INSTALL:=1
31
32 # Upstream package supports kernels between 2.6.32 and 4.3
33 # see https://github.com/openvswitch/ovs/blob/master/FAQ.md
34 # This list is pruned to only those kernels used in OpenWRT
35 SUPPORTED_KERNELS:=LINUX_3_18||LINUX_4_1||LINUX_4_3
36
37 include $(INCLUDE_DIR)/package.mk
38 $(call include_mk, python-package.mk)
39
40 define Package/openvswitch/Default
41 SECTION:=net
42 SUBMENU:=Open vSwitch
43 CATEGORY:=Network
44 URL:=http://openvswitch.org/
45 MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
46 endef
47
48 define Package/openvswitch/Default/description
49 Open vSwitch is a production quality, multilayer, software-based, Ethernet
50 virtual switch. It is designed to enable massive network automation through
51 programmatic extension, while still supporting standard management interfaces
52 and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In
53 addition, it is designed to support distribution across multiple physical
54 servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus
55 1000V.
56 endef
57
58 define Package/openvswitch-base
59 $(call Package/openvswitch/Default)
60 TITLE:=Open vSwitch Userspace Package (base)
61 DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS))
62 endef
63
64 define Package/openvswitch-base/description
65 Provides the main userspace components required for Open vSwitch to function.
66 The main OVS tools (ovs-vsctl, ovs-ofctl, etc) are packaged separately
67 to conserve some room and allow more configurability.
68 endef
69
70 define Package/openvswitch-python
71 $(call Package/openvswitch/Default)
72 TITLE:=Open vSwitch Python Support
73 DEPENDS:=+openvswitch +python
74 endef
75
76 define Package/openvswitch-python/description
77 Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
78 endef
79
80 define Package/openvswitch-ipsec
81 $(call Package/openvswitch/Default)
82 TITLE:=Open vSwitch GRE through IPsec tool
83 DEPENDS:=+openvswitch-python
84 endef
85
86 define Package/openvswitch-ipsec/description
87 The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
88 IPsec.
89 endef
90
91 define Package/openvswitch-benchmark
92 $(call Package/openvswitch/Default)
93 TITLE:=Open vSwitch flow setup benchmark utility
94 DEPENDS:=+openvswitch
95 endef
96
97 define Package/openvswitch-benchmark/description
98 Utility for running OpenVSwitch benchmarking
99 endef
100
101 OVS_BIN_TOOLS:=ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovsdb-client
102 define Package/openvswitch
103 $(call Package/openvswitch/Default)
104 TITLE:=Open vSwitch Userspace Package
105 DEPENDS:=+openvswitch-base $(foreach t,$(OVS_BIN_TOOLS),+openvswitch-$(t))
106 endef
107
108 define Package/openvswitch/description
109 Provides the main userspace components required for Open vSwitch to function.
110 Includes also the main OVS utilities (ovs-appctl, ovs-vsctl, etc).
111 endef
112
113 define KernelPackage/openvswitch
114 SECTION:=kernel
115 CATEGORY:=Kernel modules
116 SUBMENU:=Network Support
117 TITLE:=Open vSwitch Kernel Package
118 KCONFIG:=CONFIG_BRIDGE
119 DEPENDS:=+kmod-stp @IPV6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan +kmod-nf-conntrack +kmod-nf-conntrack6 @($(SUPPORTED_KERNELS))
120 FILES:= \
121 $(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX)
122 AUTOLOAD:=$(call AutoLoad,21,openvswitch)
123 endef
124
125 define KernelPackage/openvswitch/description
126 This package contains the Open vSwitch kernel moodule and bridge compat
127 module. Furthermore, it supports OpenFlow.
128 endef
129
130 CONFIGURE_ARGS += --with-linux=$(LINUX_DIR) --with-rundir=/var/run
131 CONFIGURE_ARGS += --enable-ndebug
132 CONFIGURE_ARGS += --disable-ssl
133 CONFIGURE_ARGS += --enable-shared
134
135 TARGET_CFLAGS += -flto -std=gnu99
136
137 CONFIGURE_VARS += KARCH=$(LINUX_KARCH)
138 MAKE_FLAGS += ARCH="$(LINUX_KARCH)"
139
140 define OvsBinUtility
141 define Package/openvswitch-$(1)
142 $(call Package/openvswitch/Default)
143 TITLE:=$(2)
144 DEPENDS:=+openvswitch-base
145 endef
146
147 define Package/openvswitch-$(1)/description
148 $(2)
149 endef
150
151 define Package/openvswitch-$(1)/install
152 $(INSTALL_DIR) $$(1)/usr/bin/ ;\
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/
154 endef
155 endef
156
157 define Package/openvswitch-base/install
158 $(INSTALL_DIR) $(1)/etc/openvswitch
159
160 $(INSTALL_DIR) $(1)/etc/init.d
161 $(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
162
163 $(INSTALL_DIR) $(1)/usr/lib/
164 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libofproto.so* $(1)/usr/lib/
165 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenvswitch.so* $(1)/usr/lib/
166 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libovsdb.so* $(1)/usr/lib/
167 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsflow.so* $(1)/usr/lib/
168
169 $(INSTALL_DIR) $(1)/usr/bin/
170 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovsdb-tool $(1)/usr/bin/
171
172 $(INSTALL_DIR) $(1)/usr/sbin/
173 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ovs-vswitchd $(1)/usr/sbin/
174 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ovsdb-server $(1)/usr/sbin/
175
176 $(INSTALL_DIR) $(1)/usr/share/openvswitch/
177 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/vswitch.ovsschema $(1)/usr/share/openvswitch/
178 endef
179
180 define Package/openvswitch-python/install
181 $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/ovs
182 $(CP) $(PKG_INSTALL_DIR)/usr/share/openvswitch/python/ovs/* $(1)/usr/lib/python$(PYTHON_VERSION)/ovs
183 endef
184
185 define Package/openvswitch-ipsec/install
186 $(INSTALL_DIR) $(1)/usr/sbin/
187 $(INSTALL_BIN) $(PKG_BUILD_DIR)/debian/ovs-monitor-ipsec $(1)/usr/sbin/
188 endef
189
190 define Package/openvswitch-benchmark/install
191 $(INSTALL_DIR) $(1)/usr/bin/
192 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-benchmark $(1)/usr/bin/
193 endef
194
195 define Package/openvswitch/install
196 :
197 endef
198
199 $(eval $(call OvsBinUtility,ovs-appctl,Open vSwitch app control utility))
200 $(eval $(call OvsBinUtility,ovs-ofctl,Open vSwitch OpenFlow control utility))
201 $(eval $(call OvsBinUtility,ovs-dpctl,Open vSwitch datapath management utility))
202 $(eval $(call OvsBinUtility,ovs-vsctl,Open vSwitch ovs-vswitchd management utility))
203 $(eval $(call OvsBinUtility,ovsdb-client,Open vSwitch database JSON-RPC client))
204
205 $(foreach t,$(OVS_BIN_TOOLS),$(eval $(call BuildPackage,openvswitch-$(t))))
206
207 $(eval $(call BuildPackage,openvswitch-base))
208 $(eval $(call BuildPackage,openvswitch-python))
209 $(eval $(call BuildPackage,openvswitch-ipsec))
210 $(eval $(call BuildPackage,openvswitch-benchmark))
211 $(eval $(call BuildPackage,openvswitch))
212 $(eval $(call KernelPackage,openvswitch))
213