openvswitch: fix source paths for the install rule
[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:=4
16 PKG_VERSION:=2.5.0
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_PROTO:=git
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
27
28 PKG_BUILD_PARALLEL:=1
29 PKG_FIXUP:=autoreconf
30 PKG_INSTALL:=1
31
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
36
37 include $(INCLUDE_DIR)/package.mk
38 $(call include_mk, python-package.mk)
39
40 define Package/openvswitch/Default
41 SECTION:=net
42 CATEGORY:=Network
43 URL:=http://openvswitch.org/
44 MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
45 endef
46
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
54 1000V.
55 endef
56
57 define Package/openvswitch
58 $(call Package/openvswitch/Default)
59 TITLE:=Open vSwitch Userspace Package
60 DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS))
61 endef
62
63 define Package/openvswitch/description
64 Provides the main userspace components required for Open vSwitch to function.
65 endef
66
67 define Package/openvswitch-python
68 $(call Package/openvswitch/Default)
69 TITLE:=Open vSwitch Python Support
70 DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch +python
71 endef
72
73 define Package/openvswitch-python/description
74 Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
75 endef
76
77 define Package/openvswitch-ipsec
78 $(call Package/openvswitch/Default)
79 TITLE:=Open vSwitch Userspace Package
80 DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch-python
81 endef
82
83 define Package/openvswitch-ipsec/description
84 The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
85 IPsec.
86 endef
87
88 define Package/openvswitch-benchmark
89 $(call Package/openvswitch/Default)
90 TITLE:=Open vSwitch Userspace Package
91 DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch
92 endef
93
94 define Package/openvswitch-benchmark/description
95 Utility for running OpenVSwitch benchmarking
96 endef
97
98 define KernelPackage/openvswitch
99 SECTION:=kernel
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))
105 FILES:= \
106 $(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX)
107 AUTOLOAD:=$(call AutoLoad,21,openvswitch)
108 endef
109
110 define KernelPackage/openvswitch/description
111 This package contains the Open vSwitch kernel moodule and bridge compat
112 module. Furthermore, it supports OpenFlow.
113 endef
114
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
119
120 TARGET_CFLAGS += -flto -std=gnu99
121
122 CONFIGURE_VARS += KARCH=$(LINUX_KARCH)
123 MAKE_FLAGS += ARCH="$(LINUX_KARCH)"
124
125 define Package/openvswitch/install
126 $(INSTALL_DIR) $(1)/etc/openvswitch
127
128 $(INSTALL_DIR) $(1)/etc/init.d
129 $(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
130
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/
136
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/
144
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/
148
149 $(INSTALL_DIR) $(1)/usr/share/openvswitch/
150 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/vswitch.ovsschema $(1)/usr/share/openvswitch/
151 endef
152
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
156 endef
157
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/
161 endef
162
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/
166 endef
167
168 define Package/openvswitch/postinst
169 #!/bin/sh
170 [ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/openvswitch enable || true
171 endef
172
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))
178