Browse Source

openvswitch: split bin tools into separate packages

And move them under an "Open vSwitch" submenu.
It's cleaner this way.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean 9 years ago
parent
commit
0600bf728c
1 changed files with 53 additions and 13 deletions
  1. 53
    13
      net/openvswitch/Makefile

+ 53
- 13
net/openvswitch/Makefile View File

@@ -39,6 +39,7 @@ $(call include_mk, python-package.mk)
39 39
 
40 40
 define Package/openvswitch/Default
41 41
   SECTION:=net
42
+  SUBMENU:=Open vSwitch
42 43
   CATEGORY:=Network
43 44
   URL:=http://openvswitch.org/
44 45
   MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
@@ -54,20 +55,22 @@ define Package/openvswitch/Default/description
54 55
   1000V.
55 56
 endef
56 57
 
57
-define Package/openvswitch
58
+define Package/openvswitch-base
58 59
   $(call Package/openvswitch/Default)
59
-  TITLE:=Open vSwitch Userspace Package
60
+  TITLE:=Open vSwitch Userspace Package (base)
60 61
   DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS))
61 62
 endef
62 63
 
63
-define Package/openvswitch/description
64
+define Package/openvswitch-base/description
64 65
   Provides the main userspace components required for Open vSwitch to function.
66
+  The main OVS tools (ovs-vsctl, ovs-ofctl, etc) are packaged separately
67
+  to conserve some room and allow more configurability.
65 68
 endef
66 69
 
67 70
 define Package/openvswitch-python
68 71
   $(call Package/openvswitch/Default)
69 72
   TITLE:=Open vSwitch Python Support
70
-  DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch +python
73
+  DEPENDS:=+openvswitch +python
71 74
 endef
72 75
 
73 76
 define Package/openvswitch-python/description
@@ -77,7 +80,7 @@ endef
77 80
 define Package/openvswitch-ipsec
78 81
   $(call Package/openvswitch/Default)
79 82
   TITLE:=Open vSwitch GRE through IPsec tool
80
-  DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch-python
83
+  DEPENDS:=+openvswitch-python
81 84
 endef
82 85
 
83 86
 define Package/openvswitch-ipsec/description
@@ -88,13 +91,25 @@ endef
88 91
 define Package/openvswitch-benchmark
89 92
   $(call Package/openvswitch/Default)
90 93
   TITLE:=Open vSwitch flow setup benchmark utility
91
-  DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch
94
+  DEPENDS:=+openvswitch
92 95
 endef
93 96
 
94 97
 define Package/openvswitch-benchmark/description
95 98
   Utility for running OpenVSwitch benchmarking
96 99
 endef
97 100
 
101
+OVS_BIN_TOOLS:=ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovsdb-client
102
+define Package/openvswitch
103
+  $(call Package/openvswitch/Default)
104
+  TITLE:=Open vSwitch Userspace Package
105
+  DEPENDS:=+openvswitch-base $(foreach t,$(OVS_BIN_TOOLS),+openvswitch-$(t))
106
+endef
107
+
108
+define Package/openvswitch/description
109
+  Provides the main userspace components required for Open vSwitch to function.
110
+  Includes also the main OVS utilities (ovs-appctl, ovs-vsctl, etc).
111
+endef
112
+
98 113
 define KernelPackage/openvswitch
99 114
   SECTION:=kernel
100 115
   CATEGORY:=Kernel modules
@@ -122,7 +137,24 @@ TARGET_CFLAGS += -flto -std=gnu99
122 137
 CONFIGURE_VARS += KARCH=$(LINUX_KARCH)
123 138
 MAKE_FLAGS += ARCH="$(LINUX_KARCH)"
124 139
 
125
-define Package/openvswitch/install
140
+define OvsBinUtility
141
+  define Package/openvswitch-$(1)
142
+     $(call Package/openvswitch/Default)
143
+     TITLE:=$(2)
144
+     DEPENDS:=+openvswitch-base
145
+  endef
146
+
147
+  define Package/openvswitch-$(1)/description
148
+    $(2)
149
+  endef
150
+
151
+  define Package/openvswitch-$(1)/install
152
+    $(INSTALL_DIR) $$(1)/usr/bin/ ;\
153
+    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/
154
+  endef
155
+endef
156
+
157
+define Package/openvswitch-base/install
126 158
 	$(INSTALL_DIR) $(1)/etc/openvswitch
127 159
 
128 160
 	$(INSTALL_DIR) $(1)/etc/init.d
@@ -135,11 +167,6 @@ define Package/openvswitch/install
135 167
 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsflow.so*  $(1)/usr/lib/
136 168
 
137 169
 	$(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 170
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovsdb-tool $(1)/usr/bin/
144 171
 
145 172
 	$(INSTALL_DIR) $(1)/usr/sbin/
@@ -165,9 +192,22 @@ define Package/openvswitch-benchmark/install
165 192
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-benchmark $(1)/usr/bin/
166 193
 endef
167 194
 
168
-$(eval $(call BuildPackage,openvswitch))
195
+define Package/openvswitch/install
196
+	:
197
+endef
198
+
199
+$(eval $(call OvsBinUtility,ovs-appctl,Open vSwitch app control utility))
200
+$(eval $(call OvsBinUtility,ovs-ofctl,Open vSwitch OpenFlow control utility))
201
+$(eval $(call OvsBinUtility,ovs-dpctl,Open vSwitch datapath management utility))
202
+$(eval $(call OvsBinUtility,ovs-vsctl,Open vSwitch ovs-vswitchd management utility))
203
+$(eval $(call OvsBinUtility,ovsdb-client,Open vSwitch database JSON-RPC client))
204
+
205
+$(foreach t,$(OVS_BIN_TOOLS),$(eval $(call BuildPackage,openvswitch-$(t))))
206
+
207
+$(eval $(call BuildPackage,openvswitch-base))
169 208
 $(eval $(call BuildPackage,openvswitch-python))
170 209
 $(eval $(call BuildPackage,openvswitch-ipsec))
171 210
 $(eval $(call BuildPackage,openvswitch-benchmark))
211
+$(eval $(call BuildPackage,openvswitch))
172 212
 $(eval $(call KernelPackage,openvswitch))
173 213