noddos: Noddos v0.5.0 with mDNS / DNS-SD support
[feed/packages.git] / net / openvswitch / Makefile
1 #
2 # Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
3 # Copyright (C) 2014 OpenWrt.org
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8 # $Id: Makefile $
9
10 include $(TOPDIR)/rules.mk
11 include $(INCLUDE_DIR)/kernel.mk
12
13 PKG_NAME:=openvswitch
14
15 PKG_RELEASE:=1
16 PKG_VERSION:=2.7.1
17 PKG_RELEASE=$(PKG_SOURCE_VERSION)
18 PKG_LICENSE:=Apache-2.0
19 PKG_LICENSE_FILES:=COPYING
20 PKG_USE_MIPS16:=0
21
22 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
23 PKG_SOURCE_URL:=http://openvswitch.org/releases/
24 PKG_HASH:=b0458cb2a7206f8e5802a524297c9f0569c01ae4bf91037a4dff37dcd0e2a84a
25
26 PKG_BUILD_DEPENDS:=python/host python-six/host
27 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_openvswitch-python
28
29 PKG_BUILD_PARALLEL:=1
30 PKG_FIXUP:=autoreconf
31 PKG_INSTALL:=1
32
33 SUPPORTED_KERNELS:=LINUX_3_18||LINUX_4_1||LINUX_4_3||LINUX_4_4||LINUX_4_9
34
35 include $(INCLUDE_DIR)/package.mk
36 $(call include_mk, python-package.mk)
37
38 define Package/openvswitch/Default
39 SECTION:=net
40 SUBMENU:=Open vSwitch
41 CATEGORY:=Network
42 URL:=http://openvswitch.org/
43 MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
44 endef
45
46 define Package/openvswitch/Default/description
47 Open vSwitch is a production quality, multilayer, software-based, Ethernet
48 virtual switch. It is designed to enable massive network automation through
49 programmatic extension, while still supporting standard management interfaces
50 and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In
51 addition, it is designed to support distribution across multiple physical
52 servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus
53 1000V.
54 endef
55
56 define Package/openvswitch-base
57 $(call Package/openvswitch/Default)
58 TITLE:=Open vSwitch Userspace Package (base)
59 DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS))
60 endef
61
62 define Package/openvswitch-base/description
63 Provides the main userspace components required for Open vSwitch to function.
64 The main OVS tools (ovs-vsctl, ovs-ofctl, etc) are packaged separately
65 to conserve some room and allow more configurability.
66 endef
67
68 define Package/openvswitch-python
69 $(call Package/openvswitch/Default)
70 TITLE:=Open vSwitch Python Support
71 DEPENDS:=+openvswitch +PACKAGE_openvswitch-python:python +PACKAGE_openvswitch-python:python-six
72 endef
73
74 define Package/openvswitch-python/description
75 Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
76 endef
77
78 OVS_BIN_TOOLS:=ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovsdb-client
79 define Package/openvswitch
80 $(call Package/openvswitch/Default)
81 TITLE:=Open vSwitch Userspace Package
82 DEPENDS:=+openvswitch-base $(foreach t,$(OVS_BIN_TOOLS),+openvswitch-$(t))
83 endef
84
85 define Package/openvswitch/description
86 Provides the main userspace components required for Open vSwitch to function.
87 Includes also the main OVS utilities (ovs-appctl, ovs-vsctl, etc).
88 endef
89
90 define KernelPackage/openvswitch
91 SECTION:=kernel
92 CATEGORY:=Kernel modules
93 SUBMENU:=Network Support
94 TITLE:=Open vSwitch Kernel Package
95 KCONFIG:= \
96 CONFIG_BRIDGE \
97 CONFIG_OPENVSWITCH \
98 CONFIG_OPENVSWITCH_GRE=n \
99 CONFIG_OPENVSWITCH_VXLAN=n \
100 CONFIG_OPENVSWITCH_GENEVE=n
101 DEPENDS:= \
102 @IPV6 +kmod-gre +kmod-lib-crc32c +kmod-mpls \
103 +kmod-vxlan +kmod-nf-nat +kmod-nf-nat6 \
104 @($(SUPPORTED_KERNELS))
105 FILES:= $(LINUX_DIR)/net/openvswitch/openvswitch.ko
106 AUTOLOAD:=$(call AutoLoad,21,openvswitch)
107 endef
108
109 define KernelPackage/openvswitch/description
110 This package contains the Open vSwitch kernel moodule and bridge compat
111 module. Furthermore, it supports OpenFlow.
112 endef
113
114 CONFIGURE_ARGS += --with-linux=$(LINUX_DIR) --with-rundir=/var/run
115 CONFIGURE_ARGS += --enable-ndebug
116 CONFIGURE_ARGS += --disable-ssl
117 CONFIGURE_ARGS += --enable-shared
118
119 TARGET_CFLAGS += -flto -std=gnu99
120
121 CONFIGURE_VARS += KARCH=$(LINUX_KARCH)
122 MAKE_FLAGS += \
123 ARCH="$(LINUX_KARCH)" \
124 PYTHONPATH="$(HOST_PYTHONPATH)" \
125 PYTHON="$(HOST_PYTHON_BIN)"
126
127 define OvsBinUtility
128 define Package/openvswitch-$(1)
129 $(call Package/openvswitch/Default)
130 TITLE:=$(2)
131 DEPENDS:=+openvswitch-base
132 endef
133
134 define Package/openvswitch-$(1)/description
135 $(2)
136 endef
137
138 define Package/openvswitch-$(1)/install
139 $(INSTALL_DIR) $$(1)/usr/bin/ ;\
140 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/
141 endef
142 endef
143
144 define Package/openvswitch-base/install
145 $(INSTALL_DIR) $(1)/etc/openvswitch
146
147 $(INSTALL_DIR) $(1)/etc/init.d
148 $(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
149
150 $(INSTALL_DIR) $(1)/usr/lib/
151 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libofproto*.so* $(1)/usr/lib/
152 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenvswitch*.so* $(1)/usr/lib/
153 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libovsdb*.so* $(1)/usr/lib/
154 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsflow*.so* $(1)/usr/lib/
155
156 $(INSTALL_DIR) $(1)/usr/bin/
157 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovsdb-tool $(1)/usr/bin/
158
159 $(INSTALL_DIR) $(1)/usr/sbin/
160 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ovs-vswitchd $(1)/usr/sbin/
161 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ovsdb-server $(1)/usr/sbin/
162
163 $(INSTALL_DIR) $(1)/usr/share/openvswitch/
164 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/vswitch.ovsschema $(1)/usr/share/openvswitch/
165 endef
166
167 define Package/openvswitch-python/install
168 $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/ovs
169 $(CP) $(PKG_INSTALL_DIR)/usr/share/openvswitch/python/ovs/* $(1)/usr/lib/python$(PYTHON_VERSION)/ovs
170 endef
171
172 define Package/openvswitch/install
173 :
174 endef
175
176 $(eval $(call OvsBinUtility,ovs-appctl,Open vSwitch app control utility))
177 $(eval $(call OvsBinUtility,ovs-ofctl,Open vSwitch OpenFlow control utility))
178 $(eval $(call OvsBinUtility,ovs-dpctl,Open vSwitch datapath management utility))
179 $(eval $(call OvsBinUtility,ovs-vsctl,Open vSwitch ovs-vswitchd management utility))
180 $(eval $(call OvsBinUtility,ovsdb-client,Open vSwitch database JSON-RPC client))
181
182 $(foreach t,$(OVS_BIN_TOOLS),$(eval $(call BuildPackage,openvswitch-$(t))))
183
184 $(eval $(call BuildPackage,openvswitch-base))
185 $(eval $(call BuildPackage,openvswitch-python))
186 $(eval $(call BuildPackage,openvswitch))
187 $(eval $(call KernelPackage,openvswitch))
188