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
16 PKG_RELEASE
=$(PKG_SOURCE_VERSION
)
17 PKG_LICENSE
:=Apache-2.0
18 PKG_LICENSE_FILES
:=COPYING
22 PKG_SOURCE_URL
:=https
://github.com
/openvswitch
/ovs
23 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
24 PKG_SOURCE_VERSION
:=58be9c9fd732b5bdd3d4c2e9b8cc2313f570094d
25 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_SOURCE_VERSION
).
tar.gz
27 SUPPORTED_KERNELS
:=LINUX_3_8||LINUX_3_10||LINUX_3_13||LINUX_3_14||LINUX_3_18||LINUX_4_0
29 include $(INCLUDE_DIR
)/package.mk
30 include $(INCLUDE_DIR
)/kernel.mk
31 $(call include_mk
, python-package.mk
)
35 define Package
/openvswitch
/Default
38 URL
:=http
://openvswitch.org
/
39 MAINTAINER
:=Alexandru Ardelean
<ardeleanalex@gmail.com
>
42 define Package
/openvswitch
/Default
/description
43 Open vSwitch is a production quality
, multilayer
, software-based
, Ethernet
44 virtual switch. It is designed to enable massive network automation through
45 programmatic extension
, while still supporting standard management interfaces
46 and protocols
(e.g. NetFlow
, sFlow
, SPAN
, RSPAN
, CLI
, LACP
, 802.1ag
). In
47 addition
, it is designed to support distribution across multiple physical
48 servers similar to VMware
's vNetwork distributed vswitch or Cisco's Nexus
52 define Package
/openvswitch
53 $(call Package
/openvswitch
/Default
)
54 TITLE
:=Open vSwitch Userspace Package
55 DEPENDS
:=+libpcap
+libopenssl
+librt
+libatomic
+kmod-openvswitch @
($(SUPPORTED_KERNELS
))
58 define Package
/openvswitch
/description
59 Provides the main userspace components required for Open vSwitch to function.
62 define Package
/openvswitch-python
63 $(call Package
/openvswitch
/Default
)
64 TITLE
:=Open vSwitch Python Support
65 DEPENDS
:=@PACKAGE_openvswitch
+PACKAGE_openvswitch
:openvswitch
+python
68 define Package
/openvswitch-python
/description
69 Provides bindings and libraries for using Python to manipulate
/work with Open vSwitch.
72 define Package
/openvswitch-ipsec
73 $(call Package
/openvswitch
/Default
)
74 TITLE
:=Open vSwitch Userspace Package
75 DEPENDS
:=@PACKAGE_openvswitch
+PACKAGE_openvswitch
:openvswitch-python
78 define Package
/openvswitch-ipsec
/description
79 The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
83 define Package
/openvswitch-benchmark
84 $(call Package
/openvswitch
/Default
)
85 TITLE
:=Open vSwitch Userspace Package
86 DEPENDS
:=@PACKAGE_openvswitch
+PACKAGE_openvswitch
:openvswitch
89 define Package
/openvswitch-benchmark
/description
90 Utility for running OpenVSwitch benchmarking
93 define KernelPackage
/openvswitch
95 CATEGORY
:=Kernel modules
96 SUBMENU
:=Network Support
97 TITLE
:=Open vSwitch Kernel Package
98 KCONFIG
:=CONFIG_BRIDGE
99 DEPENDS
:=+kmod-stp
+kmod-ipv6
+kmod-gre
+kmod-lib-crc32c
+kmod-vxlan @
($(SUPPORTED_KERNELS
))
101 $(PKG_BUILD_DIR
)/datapath
/linux
/openvswitch.
$(LINUX_KMOD_SUFFIX
)
102 AUTOLOAD
:=$(call AutoLoad
,21,openvswitch
)
105 define KernelPackage
/openvswitch
/description
106 This package contains the Open vSwitch kernel moodule and bridge compat
107 module. Furthermore
, it supports OpenFlow.
110 CONFIGURE_ARGS
+= --with-linux
=$(LINUX_DIR
) --with-rundir
=/var
/run
111 CONFIGURE_ARGS
+= --enable-ndebug
112 CONFIGURE_ARGS
+= --disable-ssl
113 CONFIGURE_ARGS
+= --enable-shared
115 TARGET_CFLAGS
+= -flto
117 define Build
/Configure
118 (cd
$(PKG_BUILD_DIR
); \
119 autoreconf
-v
--install --force || exit
1 \
121 $(call Build
/Configure
/Default
,$(CONFIGURE_ARGS
))
125 ifeq ($(CONFIG_GCC_VERSION_4_9
),y
)
126 KCFLAGS
:=-Wno-error
=date-time
130 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
131 $(TARGET_CONFIGURE_OPTS
) \
132 CFLAGS
="-I$(PKG_BUILD_DIR)/lib $(TARGET_CFLAGS) -std=gnu99" \
133 LDFLAGS
="-L$(PKG_BUILD_DIR)/lib $(TARGET_LDFLAGS)" \
134 LDFLAGS_MODULES
="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR)/lib" \
135 STAGING_DIR
="$(STAGING_DIR)" \
136 DESTDIR
="$(PKG_INSTALL_DIR)/usr" \
137 CROSS_COMPILE
="$(TARGET_CROSS)" \
138 ARCH
="$(LINUX_KARCH)" \
139 SUBDIRS
="$(PKG_BUILD_DIR)/datapath/linux" \
140 PATH
="$(TARGET_PATH)" \
141 EXTRA_CFLAGS
="$(KCFLAGS)" \
145 define Package
/openvswitch
/install
146 $(INSTALL_DIR
) $(1)/etc
/openvswitch
148 $(INSTALL_DIR
) $(1)/etc
/init.d
149 $(INSTALL_BIN
) .
/files
/etc
/init.d
/openvswitch.init
$(1)/etc
/init.d
/openvswitch
151 $(INSTALL_DIR
) $(1)/usr
/lib
/
152 $(CP
) $(PKG_BUILD_DIR
)/lib
/.libs
/libsflow.so
* $(1)/usr
/lib
/
153 $(CP
) $(PKG_BUILD_DIR
)/lib
/.libs
/libopenvswitch.so
* $(1)/usr
/lib
/
154 $(CP
) $(PKG_BUILD_DIR
)/ofproto
/.libs
/libofproto.so
* $(1)/usr
/lib
/
155 $(CP
) $(PKG_BUILD_DIR
)/ovsdb
/.libs
/libovsdb.so
* $(1)/usr
/lib
/
157 $(INSTALL_DIR
) $(1)/usr
/bin
/
158 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-appctl
$(1)/usr
/bin
/
159 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-ofctl
$(1)/usr
/bin
/
160 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ovsdb
/.libs
/ovsdb-client
$(1)/usr
/bin
/
162 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-dpctl
$(1)/usr
/bin
/
163 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-vsctl
$(1)/usr
/bin
/
164 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ovsdb
/.libs
/ovsdb-tool
$(1)/usr
/bin
/
166 $(INSTALL_DIR
) $(1)/usr
/sbin
/
167 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/vswitchd
/.libs
/ovs-vswitchd
$(1)/usr
/sbin
/
168 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ovsdb
/.libs
/ovsdb-server
$(1)/usr
/sbin
/
170 $(INSTALL_DIR
) $(1)/usr
/share
/openvswitch
/
171 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/vswitchd
/vswitch.ovsschema
$(1)/usr
/share
/openvswitch
/
174 define Package
/openvswitch-python
/install
175 $(INSTALL_DIR
) $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/
176 $(CP
) $(PKG_BUILD_DIR
)/python
/ovs
/ $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/
179 define Package
/openvswitch-ipsec
/install
180 $(INSTALL_DIR
) $(1)/usr
/sbin
/
181 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/debian
/ovs-monitor-ipsec
$(1)/usr
/sbin
/
184 define Package
/openvswitch-benchmark
/install
185 $(INSTALL_DIR
) $(1)/usr
/bin
/
186 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-benchmark
$(1)/usr
/bin
/
189 define Package
/openvswitch
/postinst
191 [ -n
"$${IPKG_INSTROOT}" ] ||
/etc
/init.d
/openvswitch enable || true
194 $(eval
$(call BuildPackage
,openvswitch
))
195 $(eval
$(call BuildPackage
,openvswitch-python
))
196 $(eval
$(call BuildPackage
,openvswitch-ipsec
))
197 $(eval
$(call BuildPackage
,openvswitch-benchmark
))
198 $(eval
$(call KernelPackage
,openvswitch
))