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_FILE
:=COPYING
22 PKG_SOURCE_URL
:=https
://github.com
/openvswitch
/ovs
23 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
24 PKG_SOURCE_VERSION
:=2b70c4b929d18d1f36dcdeb71ea5c383cbb662e9
25 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_SOURCE_VERSION
).
tar.gz
27 include $(INCLUDE_DIR
)/package.mk
28 include $(INCLUDE_DIR
)/kernel.mk
29 $(call include_mk
, python-package.mk
)
33 define Package
/openvswitch
/Default
36 URL
:=http
://openvswitch.org
/
37 MAINTAINER
:=Alexandru Ardelean
<ardeleanalex@gmail.com
>
40 define Package
/openvswitch
/Default
/description
41 Open vSwitch is a production quality
, multilayer
, software-based
, Ethernet
42 virtual switch. It is designed to enable massive network automation through
43 programmatic extension
, while still supporting standard management interfaces
44 and protocols
(e.g. NetFlow
, sFlow
, SPAN
, RSPAN
, CLI
, LACP
, 802.1ag
). In
45 addition
, it is designed to support distribution across multiple physical
46 servers similar to VMware
's vNetwork distributed vswitch or Cisco's Nexus
50 define Package
/openvswitch
51 $(call Package
/openvswitch
/Default
)
52 TITLE
:=Open vSwitch Userspace Package
53 DEPENDS
:=+libpcap
+libopenssl
+librt
+libatomic
+kmod-openvswitch
56 define Package
/openvswitch
/description
57 Provides the main userspace components required for Open vSwitch to function.
60 define Package
/openvswitch-python
61 $(call Package
/openvswitch
/Default
)
62 TITLE
:=Open vSwitch Python Support
63 DEPENDS
:=@PACKAGE_openvswitch
+PACKAGE_openvswitch
:openvswitch
+python
66 define Package
/openvswitch-python
/description
67 Provides bindings and libraries for using Python to manipulate
/work with Open vSwitch.
70 define Package
/openvswitch-ipsec
71 $(call Package
/openvswitch
/Default
)
72 TITLE
:=Open vSwitch Userspace Package
73 DEPENDS
:=@PACKAGE_openvswitch
+PACKAGE_openvswitch
:openvswitch-python
76 define Package
/openvswitch-ipsec
/description
77 The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
81 define Package
/openvswitch-benchmark
82 $(call Package
/openvswitch
/Default
)
83 TITLE
:=Open vSwitch Userspace Package
84 DEPENDS
:=@PACKAGE_openvswitch
+PACKAGE_openvswitch
:openvswitch
87 define Package
/openvswitch-benchmark
/description
88 Utility for running OpenVSwitch benchmarking
91 define KernelPackage
/openvswitch
93 CATEGORY
:=Kernel modules
94 SUBMENU
:=Network Support
95 TITLE
:=Open vSwitch Kernel Package
96 KCONFIG
:=CONFIG_BRIDGE
97 DEPENDS
:=+kmod-stp
+kmod-ipv6
+kmod-gre
+kmod-lib-crc32c
99 $(PKG_BUILD_DIR
)/datapath
/linux
/openvswitch.
$(LINUX_KMOD_SUFFIX
)
100 AUTOLOAD
:=$(call AutoLoad
,21,openvswitch
)
103 define KernelPackage
/openvswitch
/description
104 This package contains the Open vSwitch kernel moodule and bridge compat
105 module. Furthermore
, it supports OpenFlow.
108 CONFIGURE_ARGS
+= --with-linux
=$(LINUX_DIR
) --with-rundir
=/var
/run
109 CONFIGURE_ARGS
+= --enable-ndebug
110 CONFIGURE_ARGS
+= --disable-ssl
111 CONFIGURE_ARGS
+= --enable-shared
113 TARGET_CFLAGS
+= -flto
115 define Build
/Configure
116 (cd
$(PKG_BUILD_DIR
); \
117 autoreconf
-v
--install --force || exit
1 \
119 $(call Build
/Configure
/Default
,$(CONFIGURE_ARGS
))
123 ifeq ($(CONFIG_GCC_VERSION_4_9
),y
)
124 KCFLAGS
:=-Wno-error
=date-time
128 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
129 $(TARGET_CONFIGURE_OPTS
) \
130 CFLAGS
="-I$(PKG_BUILD_DIR)/lib $(TARGET_CFLAGS) -std=gnu99" \
131 LDFLAGS
="-L$(PKG_BUILD_DIR)/lib $(TARGET_LDFLAGS)" \
132 LDFLAGS_MODULES
="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR)/lib" \
133 STAGING_DIR
="$(STAGING_DIR)" \
134 DESTDIR
="$(PKG_INSTALL_DIR)/usr" \
135 CROSS_COMPILE
="$(TARGET_CROSS)" \
136 ARCH
="$(LINUX_KARCH)" \
137 SUBDIRS
="$(PKG_BUILD_DIR)/datapath/linux" \
138 PATH
="$(TARGET_PATH)" \
139 KCFLAGS
="$(KCFLAGS)" \
143 define Package
/openvswitch
/install
144 $(INSTALL_DIR
) $(1)/etc
/openvswitch
146 $(INSTALL_DIR
) $(1)/etc
/init.d
147 $(INSTALL_BIN
) .
/files
/etc
/init.d
/openvswitch.init
$(1)/etc
/init.d
/openvswitch
149 $(INSTALL_DIR
) $(1)/usr
/lib
/
150 $(CP
) $(PKG_BUILD_DIR
)/lib
/.libs
/libsflow-
$(PKG_VERSION
).so
$(1)/usr
/lib
/
151 $(CP
) $(PKG_BUILD_DIR
)/lib
/.libs
/libopenvswitch-
$(PKG_VERSION
).so
$(1)/usr
/lib
/
152 $(CP
) $(PKG_BUILD_DIR
)/ofproto
/.libs
/libofproto-
$(PKG_VERSION
).so
$(1)/usr
/lib
/
153 $(CP
) $(PKG_BUILD_DIR
)/ovsdb
/.libs
/libovsdb-
$(PKG_VERSION
).so
$(1)/usr
/lib
/
155 $(INSTALL_DIR
) $(1)/usr
/bin
/
156 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-appctl
$(1)/usr
/bin
/
157 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-ofctl
$(1)/usr
/bin
/
158 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ovsdb
/.libs
/ovsdb-client
$(1)/usr
/bin
/
160 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-dpctl
$(1)/usr
/bin
/
161 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-vsctl
$(1)/usr
/bin
/
162 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ovsdb
/.libs
/ovsdb-tool
$(1)/usr
/bin
/
164 $(INSTALL_DIR
) $(1)/usr
/sbin
/
165 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/vswitchd
/.libs
/ovs-vswitchd
$(1)/usr
/sbin
/
166 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ovsdb
/.libs
/ovsdb-server
$(1)/usr
/sbin
/
168 $(INSTALL_DIR
) $(1)/usr
/share
/openvswitch
/
169 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/vswitchd
/vswitch.ovsschema
$(1)/usr
/share
/openvswitch
/
172 define Package
/openvswitch-python
/install
173 $(INSTALL_DIR
) $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/
174 $(CP
) $(PKG_BUILD_DIR
)/python
/ovs
/ $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/
177 define Package
/openvswitch-ipsec
/install
178 $(INSTALL_DIR
) $(1)/usr
/sbin
/
179 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/debian
/ovs-monitor-ipsec
$(1)/usr
/sbin
/
182 define Package
/openvswitch-benchmark
/install
183 $(INSTALL_DIR
) $(1)/usr
/bin
/
184 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/utilities
/.libs
/ovs-benchmark
$(1)/usr
/bin
/
187 define Package
/openvswitch
/postinst
189 [ -n
"$${IPKG_INSTROOT}" ] ||
/etc
/init.d
/openvswitch enable || true
192 $(eval
$(call BuildPackage
,openvswitch
))
193 $(eval
$(call BuildPackage
,openvswitch-python
))
194 $(eval
$(call BuildPackage
,openvswitch-ipsec
))
195 $(eval
$(call BuildPackage
,openvswitch-benchmark
))
196 $(eval
$(call KernelPackage
,openvswitch
))