2 # Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
3 # Copyright (C) 2014 OpenWrt.org
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
10 include $(TOPDIR
)/rules.mk
11 include $(INCLUDE_DIR
)/kernel.mk
17 PKG_RELEASE
=$(PKG_SOURCE_VERSION
)
18 PKG_LICENSE
:=Apache-2.0
19 PKG_LICENSE_FILES
:=COPYING
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
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 # Support for kernel 4.4 is backported
36 SUPPORTED_KERNELS
:=LINUX_3_18||LINUX_4_1||LINUX_4_3||LINUX_4_4
38 include $(INCLUDE_DIR
)/package.mk
39 $(call include_mk
, python-package.mk
)
41 define Package
/openvswitch
/Default
45 URL
:=http
://openvswitch.org
/
46 MAINTAINER
:=Alexandru Ardelean
<ardeleanalex@gmail.com
>
49 define Package
/openvswitch
/Default
/description
50 Open vSwitch is a production quality
, multilayer
, software-based
, Ethernet
51 virtual switch. It is designed to enable massive network automation through
52 programmatic extension
, while still supporting standard management interfaces
53 and protocols
(e.g. NetFlow
, sFlow
, SPAN
, RSPAN
, CLI
, LACP
, 802.1ag
). In
54 addition
, it is designed to support distribution across multiple physical
55 servers similar to VMware
's vNetwork distributed vswitch or Cisco's Nexus
59 define Package
/openvswitch-base
60 $(call Package
/openvswitch
/Default
)
61 TITLE
:=Open vSwitch Userspace Package
(base
)
62 DEPENDS
:=+libpcap
+libopenssl
+librt
+kmod-openvswitch @
($(SUPPORTED_KERNELS
))
65 define Package
/openvswitch-base
/description
66 Provides the main userspace components required for Open vSwitch to function.
67 The main OVS tools
(ovs-vsctl
, ovs-ofctl
, etc
) are packaged separately
68 to conserve some room and allow more configurability.
71 define Package
/openvswitch-python
72 $(call Package
/openvswitch
/Default
)
73 TITLE
:=Open vSwitch Python Support
74 DEPENDS
:=+openvswitch
+python
77 define Package
/openvswitch-python
/description
78 Provides bindings and libraries for using Python to manipulate
/work with Open vSwitch.
81 define Package
/openvswitch-ipsec
82 $(call Package
/openvswitch
/Default
)
83 TITLE
:=Open vSwitch GRE through IPsec tool
84 DEPENDS
:=+openvswitch-python
87 define Package
/openvswitch-ipsec
/description
88 The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
92 define Package
/openvswitch-benchmark
93 $(call Package
/openvswitch
/Default
)
94 TITLE
:=Open vSwitch flow setup benchmark utility
98 define Package
/openvswitch-benchmark
/description
99 Utility for running OpenVSwitch benchmarking
102 OVS_BIN_TOOLS
:=ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovsdb-client
103 define Package
/openvswitch
104 $(call Package
/openvswitch
/Default
)
105 TITLE
:=Open vSwitch Userspace Package
106 DEPENDS
:=+openvswitch-base
$(foreach t
,$(OVS_BIN_TOOLS
),+openvswitch-
$(t
))
109 define Package
/openvswitch
/description
110 Provides the main userspace components required for Open vSwitch to function.
111 Includes also the main OVS utilities
(ovs-appctl
, ovs-vsctl
, etc
).
114 define KernelPackage
/openvswitch
116 CATEGORY
:=Kernel modules
117 SUBMENU
:=Network Support
118 TITLE
:=Open vSwitch Kernel Package
119 KCONFIG
:=CONFIG_BRIDGE
120 DEPENDS
:=+kmod-stp @IPV6
+kmod-gre
+kmod-lib-crc32c
+kmod-vxlan
+kmod-nf-conntrack
+kmod-nf-conntrack6 @
($(SUPPORTED_KERNELS
))
122 $(PKG_BUILD_DIR
)/datapath
/linux
/openvswitch.
$(LINUX_KMOD_SUFFIX
)
123 AUTOLOAD
:=$(call AutoLoad
,21,openvswitch
)
126 define KernelPackage
/openvswitch
/description
127 This package contains the Open vSwitch kernel moodule and bridge compat
128 module. Furthermore
, it supports OpenFlow.
131 CONFIGURE_ARGS
+= --with-linux
=$(LINUX_DIR
) --with-rundir
=/var
/run
132 CONFIGURE_ARGS
+= --enable-ndebug
133 CONFIGURE_ARGS
+= --disable-ssl
134 CONFIGURE_ARGS
+= --enable-shared
136 TARGET_CFLAGS
+= -flto
-std
=gnu99
138 CONFIGURE_VARS
+= KARCH
=$(LINUX_KARCH
)
139 MAKE_FLAGS
+= ARCH
="$(LINUX_KARCH)"
142 define Package
/openvswitch-
$(1)
143 $(call Package
/openvswitch
/Default
)
145 DEPENDS
:=+openvswitch-base
148 define Package
/openvswitch-
$(1)/description
152 define Package
/openvswitch-
$(1)/install
153 $(INSTALL_DIR
) $$(1)/usr
/bin
/ ;\
154 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/$(1) $$(1)/usr
/bin
/
158 define Package
/openvswitch-base
/install
159 $(INSTALL_DIR
) $(1)/etc
/openvswitch
161 $(INSTALL_DIR
) $(1)/etc
/init.d
162 $(INSTALL_BIN
) .
/files
/etc
/init.d
/openvswitch.init
$(1)/etc
/init.d
/openvswitch
164 $(INSTALL_DIR
) $(1)/usr
/lib
/
165 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libofproto.so
* $(1)/usr
/lib
/
166 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libopenvswitch.so
* $(1)/usr
/lib
/
167 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libovsdb.so
* $(1)/usr
/lib
/
168 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libsflow.so
* $(1)/usr
/lib
/
170 $(INSTALL_DIR
) $(1)/usr
/bin
/
171 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovsdb-tool
$(1)/usr
/bin
/
173 $(INSTALL_DIR
) $(1)/usr
/sbin
/
174 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ovs-vswitchd
$(1)/usr
/sbin
/
175 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ovsdb-server
$(1)/usr
/sbin
/
177 $(INSTALL_DIR
) $(1)/usr
/share
/openvswitch
/
178 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/usr
/share
/openvswitch
/vswitch.ovsschema
$(1)/usr
/share
/openvswitch
/
181 define Package
/openvswitch-python
/install
182 $(INSTALL_DIR
) $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/ovs
183 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/openvswitch
/python
/ovs
/* $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/ovs
186 define Package
/openvswitch-ipsec
/install
187 $(INSTALL_DIR
) $(1)/usr
/sbin
/
188 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/debian
/ovs-monitor-ipsec
$(1)/usr
/sbin
/
191 define Package
/openvswitch-benchmark
/install
192 $(INSTALL_DIR
) $(1)/usr
/bin
/
193 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovs-benchmark
$(1)/usr
/bin
/
196 define Package
/openvswitch
/install
200 $(eval
$(call OvsBinUtility
,ovs-appctl
,Open vSwitch app control utility
))
201 $(eval
$(call OvsBinUtility
,ovs-ofctl
,Open vSwitch OpenFlow control utility
))
202 $(eval
$(call OvsBinUtility
,ovs-dpctl
,Open vSwitch datapath management utility
))
203 $(eval
$(call OvsBinUtility
,ovs-vsctl
,Open vSwitch ovs-vswitchd management utility
))
204 $(eval
$(call OvsBinUtility
,ovsdb-client
,Open vSwitch database JSON-RPC client
))
206 $(foreach t
,$(OVS_BIN_TOOLS
),$(eval
$(call BuildPackage
,openvswitch-
$(t
))))
208 $(eval
$(call BuildPackage
,openvswitch-base
))
209 $(eval
$(call BuildPackage
,openvswitch-python
))
210 $(eval
$(call BuildPackage
,openvswitch-ipsec
))
211 $(eval
$(call BuildPackage
,openvswitch-benchmark
))
212 $(eval
$(call BuildPackage
,openvswitch
))
213 $(eval
$(call KernelPackage
,openvswitch
))