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