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 SUPPORTED_KERNELS
:=LINUX_3_18||LINUX_4_1||LINUX_4_3
37 include $(INCLUDE_DIR
)/package.mk
38 $(call include_mk
, python-package.mk
)
40 define Package
/openvswitch
/Default
44 URL
:=http
://openvswitch.org
/
45 MAINTAINER
:=Alexandru Ardelean
<ardeleanalex@gmail.com
>
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
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
))
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.
70 define Package
/openvswitch-python
71 $(call Package
/openvswitch
/Default
)
72 TITLE
:=Open vSwitch Python Support
73 DEPENDS
:=+openvswitch
+python
76 define Package
/openvswitch-python
/description
77 Provides bindings and libraries for using Python to manipulate
/work with Open vSwitch.
80 define Package
/openvswitch-ipsec
81 $(call Package
/openvswitch
/Default
)
82 TITLE
:=Open vSwitch GRE through IPsec tool
83 DEPENDS
:=+openvswitch-python
86 define Package
/openvswitch-ipsec
/description
87 The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
91 define Package
/openvswitch-benchmark
92 $(call Package
/openvswitch
/Default
)
93 TITLE
:=Open vSwitch flow setup benchmark utility
97 define Package
/openvswitch-benchmark
/description
98 Utility for running OpenVSwitch benchmarking
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
))
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
).
113 define KernelPackage
/openvswitch
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
))
121 $(PKG_BUILD_DIR
)/datapath
/linux
/openvswitch.
$(LINUX_KMOD_SUFFIX
)
122 AUTOLOAD
:=$(call AutoLoad
,21,openvswitch
)
125 define KernelPackage
/openvswitch
/description
126 This package contains the Open vSwitch kernel moodule and bridge compat
127 module. Furthermore
, it supports OpenFlow.
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
135 TARGET_CFLAGS
+= -flto
-std
=gnu99
137 CONFIGURE_VARS
+= KARCH
=$(LINUX_KARCH
)
138 MAKE_FLAGS
+= ARCH
="$(LINUX_KARCH)"
141 define Package
/openvswitch-
$(1)
142 $(call Package
/openvswitch
/Default
)
144 DEPENDS
:=+openvswitch-base
147 define Package
/openvswitch-
$(1)/description
151 define Package
/openvswitch-
$(1)/install
152 $(INSTALL_DIR
) $$(1)/usr
/bin
/ ;\
153 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/$(1) $$(1)/usr
/bin
/
157 define Package
/openvswitch-base
/install
158 $(INSTALL_DIR
) $(1)/etc
/openvswitch
160 $(INSTALL_DIR
) $(1)/etc
/init.d
161 $(INSTALL_BIN
) .
/files
/etc
/init.d
/openvswitch.init
$(1)/etc
/init.d
/openvswitch
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
/
169 $(INSTALL_DIR
) $(1)/usr
/bin
/
170 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovsdb-tool
$(1)/usr
/bin
/
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
/
176 $(INSTALL_DIR
) $(1)/usr
/share
/openvswitch
/
177 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/usr
/share
/openvswitch
/vswitch.ovsschema
$(1)/usr
/share
/openvswitch
/
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
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
/
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
/
195 define Package
/openvswitch
/install
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
))
205 $(foreach t
,$(OVS_BIN_TOOLS
),$(eval
$(call BuildPackage
,openvswitch-
$(t
))))
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
))