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
22 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
23 PKG_SOURCE_URL
:=http
://openvswitch.org
/releases
/
24 PKG_HASH
:=e492cf08a929b4a2178b7f9b01dc4ff562f44138b547b4e942078187b2445d2e
30 SUPPORTED_KERNELS
:=LINUX_3_18||LINUX_4_1||LINUX_4_3||LINUX_4_4||LINUX_4_9
32 include $(INCLUDE_DIR
)/package.mk
33 $(call include_mk
, python-package.mk
)
35 define Package
/openvswitch
/Default
39 URL
:=http
://openvswitch.org
/
40 MAINTAINER
:=Alexandru Ardelean
<ardeleanalex@gmail.com
>
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
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
))
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.
65 define Package
/openvswitch-python
66 $(call Package
/openvswitch
/Default
)
67 TITLE
:=Open vSwitch Python Support
68 DEPENDS
:=+openvswitch
+PACKAGE_openvswitch-python
:python
71 define Package
/openvswitch-python
/description
72 Provides bindings and libraries for using Python to manipulate
/work with Open vSwitch.
75 define Package
/openvswitch-ipsec
76 $(call Package
/openvswitch
/Default
)
77 TITLE
:=Open vSwitch GRE through IPsec tool
78 DEPENDS
:=+openvswitch-python
81 define Package
/openvswitch-ipsec
/description
82 The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
86 define Package
/openvswitch-benchmark
87 $(call Package
/openvswitch
/Default
)
88 TITLE
:=Open vSwitch flow setup benchmark utility
92 define Package
/openvswitch-benchmark
/description
93 Utility for running OpenVSwitch benchmarking
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
))
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
).
108 define KernelPackage
/openvswitch
110 CATEGORY
:=Kernel modules
111 SUBMENU
:=Network Support
112 TITLE
:=Open vSwitch Kernel Package
116 CONFIG_OPENVSWITCH_GRE
=n \
117 CONFIG_OPENVSWITCH_VXLAN
=n \
118 CONFIG_OPENVSWITCH_GENEVE
=n
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
)
127 define KernelPackage
/openvswitch
/description
128 This package contains the Open vSwitch kernel moodule and bridge compat
129 module. Furthermore
, it supports OpenFlow.
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
137 TARGET_CFLAGS
+= -flto
-std
=gnu99
139 CONFIGURE_VARS
+= KARCH
=$(LINUX_KARCH
)
140 MAKE_FLAGS
+= ARCH
="$(LINUX_KARCH)"
143 define Package
/openvswitch-
$(1)
144 $(call Package
/openvswitch
/Default
)
146 DEPENDS
:=+openvswitch-base
149 define Package
/openvswitch-
$(1)/description
153 define Package
/openvswitch-
$(1)/install
154 $(INSTALL_DIR
) $$(1)/usr
/bin
/ ;\
155 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/$(1) $$(1)/usr
/bin
/
159 define Package
/openvswitch-base
/install
160 $(INSTALL_DIR
) $(1)/etc
/openvswitch
162 $(INSTALL_DIR
) $(1)/etc
/init.d
163 $(INSTALL_BIN
) .
/files
/etc
/init.d
/openvswitch.init
$(1)/etc
/init.d
/openvswitch
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
/
171 $(INSTALL_DIR
) $(1)/usr
/bin
/
172 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovsdb-tool
$(1)/usr
/bin
/
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
/
178 $(INSTALL_DIR
) $(1)/usr
/share
/openvswitch
/
179 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/usr
/share
/openvswitch
/vswitch.ovsschema
$(1)/usr
/share
/openvswitch
/
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
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
/
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
/
197 define Package
/openvswitch
/install
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
))
207 $(foreach t
,$(OVS_BIN_TOOLS
),$(eval
$(call BuildPackage
,openvswitch-
$(t
))))
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
))