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
:=98b94d1e7002063ce2ea3c3221fe9234cac4e124
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
43 URL
:=http
://openvswitch.org
/
44 MAINTAINER
:=Alexandru Ardelean
<ardeleanalex@gmail.com
>
47 define Package
/openvswitch
/Default
/description
48 Open vSwitch is a production quality
, multilayer
, software-based
, Ethernet
49 virtual switch. It is designed to enable massive network automation through
50 programmatic extension
, while still supporting standard management interfaces
51 and protocols
(e.g. NetFlow
, sFlow
, SPAN
, RSPAN
, CLI
, LACP
, 802.1ag
). In
52 addition
, it is designed to support distribution across multiple physical
53 servers similar to VMware
's vNetwork distributed vswitch or Cisco's Nexus
57 define Package
/openvswitch
58 $(call Package
/openvswitch
/Default
)
59 TITLE
:=Open vSwitch Userspace Package
60 DEPENDS
:=+libpcap
+libopenssl
+librt
+kmod-openvswitch @
($(SUPPORTED_KERNELS
))
63 define Package
/openvswitch
/description
64 Provides the main userspace components required for Open vSwitch to function.
67 define Package
/openvswitch-python
68 $(call Package
/openvswitch
/Default
)
69 TITLE
:=Open vSwitch Python Support
70 DEPENDS
:=@PACKAGE_openvswitch
+PACKAGE_openvswitch
:openvswitch
+python
73 define Package
/openvswitch-python
/description
74 Provides bindings and libraries for using Python to manipulate
/work with Open vSwitch.
77 define Package
/openvswitch-ipsec
78 $(call Package
/openvswitch
/Default
)
79 TITLE
:=Open vSwitch Userspace Package
80 DEPENDS
:=@PACKAGE_openvswitch
+PACKAGE_openvswitch
:openvswitch-python
83 define Package
/openvswitch-ipsec
/description
84 The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
88 define Package
/openvswitch-benchmark
89 $(call Package
/openvswitch
/Default
)
90 TITLE
:=Open vSwitch Userspace Package
91 DEPENDS
:=@PACKAGE_openvswitch
+PACKAGE_openvswitch
:openvswitch
94 define Package
/openvswitch-benchmark
/description
95 Utility for running OpenVSwitch benchmarking
98 define KernelPackage
/openvswitch
100 CATEGORY
:=Kernel modules
101 SUBMENU
:=Network Support
102 TITLE
:=Open vSwitch Kernel Package
103 KCONFIG
:=CONFIG_BRIDGE
104 DEPENDS
:=+kmod-stp @IPV6
+kmod-gre
+kmod-lib-crc32c
+kmod-vxlan
+kmod-nf-conntrack
+kmod-nf-conntrack6 @
($(SUPPORTED_KERNELS
))
106 $(PKG_BUILD_DIR
)/datapath
/linux
/openvswitch.
$(LINUX_KMOD_SUFFIX
)
107 AUTOLOAD
:=$(call AutoLoad
,21,openvswitch
)
110 define KernelPackage
/openvswitch
/description
111 This package contains the Open vSwitch kernel moodule and bridge compat
112 module. Furthermore
, it supports OpenFlow.
115 CONFIGURE_ARGS
+= --with-linux
=$(LINUX_DIR
) --with-rundir
=/var
/run
116 CONFIGURE_ARGS
+= --enable-ndebug
117 CONFIGURE_ARGS
+= --disable-ssl
118 CONFIGURE_ARGS
+= --enable-shared
120 TARGET_CFLAGS
+= -flto
-std
=gnu99
122 CONFIGURE_VARS
+= KARCH
=$(LINUX_KARCH
)
123 MAKE_FLAGS
+= ARCH
="$(LINUX_KARCH)"
125 define Package
/openvswitch
/install
126 $(INSTALL_DIR
) $(1)/etc
/openvswitch
128 $(INSTALL_DIR
) $(1)/etc
/init.d
129 $(INSTALL_BIN
) .
/files
/etc
/init.d
/openvswitch.init
$(1)/etc
/init.d
/openvswitch
131 $(INSTALL_DIR
) $(1)/usr
/lib
/
132 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libofproto.so
* $(1)/usr
/lib
/
133 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libopenvswitch.so
* $(1)/usr
/lib
/
134 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libovsdb.so
* $(1)/usr
/lib
/
135 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libsflow.so
* $(1)/usr
/lib
/
137 $(INSTALL_DIR
) $(1)/usr
/bin
/
138 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovs-appctl
$(1)/usr
/bin
/
139 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovs-ofctl
$(1)/usr
/bin
/
140 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovsdb-client
$(1)/usr
/bin
/
141 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovs-dpctl
$(1)/usr
/bin
/
142 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovs-vsctl
$(1)/usr
/bin
/
143 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovsdb-tool
$(1)/usr
/bin
/
145 $(INSTALL_DIR
) $(1)/usr
/sbin
/
146 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ovs-vswitchd
$(1)/usr
/sbin
/
147 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ovsdb-server
$(1)/usr
/sbin
/
149 $(INSTALL_DIR
) $(1)/usr
/share
/openvswitch
/
150 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/usr
/share
/openvswitch
/vswitch.ovsschema
$(1)/usr
/share
/openvswitch
/
153 define Package
/openvswitch-python
/install
154 $(INSTALL_DIR
) $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/ovs
155 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/openvswitch
/python
/ovs
/* $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/ovs
158 define Package
/openvswitch-ipsec
/install
159 $(INSTALL_DIR
) $(1)/usr
/sbin
/
160 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/debian
/ovs-monitor-ipsec
$(1)/usr
/sbin
/
163 define Package
/openvswitch-benchmark
/install
164 $(INSTALL_DIR
) $(1)/usr
/bin
/
165 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovs-benchmark
$(1)/usr
/bin
/
168 define Package
/openvswitch
/postinst
170 [ -n
"$${IPKG_INSTROOT}" ] ||
/etc
/init.d
/openvswitch enable || true
173 $(eval
$(call BuildPackage
,openvswitch
))
174 $(eval
$(call BuildPackage
,openvswitch-python
))
175 $(eval
$(call BuildPackage
,openvswitch-ipsec
))
176 $(eval
$(call BuildPackage
,openvswitch-benchmark
))
177 $(eval
$(call KernelPackage
,openvswitch
))