Subject: [alpine-aports] [PATCH] main/openvswitch: update to 2.4.0

From: Stuart Cardall <[email-masked]>
Date: Mon, 24 Aug 2015 17:50:06 +0000

*** NB: please move openvswitch-2.3.2-r1.apk in edge ---> stable ***

Changes in 2.4.0:
https://github.com/openvswitch/ovs/blob/master/NEWS

Added bash-completions

ovs 2.3.2 & 2.4.0 both have partial support for LXC:
see: https://github.com/itoffshore/lxc-scripts

ovsup / ovsdown stop LXC containers losing connectivity when networking
is restarted.
---
 main/openvswitch/APKBUILD             | 39 ++++++++++++++++++++++-------------
 main/openvswitch/musl-if_packet.patch |  6 +++---
 main/openvswitch/readme.debian.patch  | 26 +++++++++++++----------
 3 files changed, 43 insertions(+), 28 deletions(-)

diff --git a/main/openvswitch/APKBUILD b/main/openvswitch/APKBUILD
index c89d3ab..d30d60f 100644
--- a/main/openvswitch/APKBUILD
+++ b/main/openvswitch/APKBUILD
@@ -1,17 +1,16 @@
 # Contributor: Stuart Cardall <[email-masked]>
 # Maintainer: Stuart Cardall <[email-masked]>
 pkgname=openvswitch
-pkgver=2.3.2
-pkgrel=2
+pkgver=2.4.0
+pkgrel=0
 pkgdesc="A production quality, multilayer virtual switch"
 url="http://openvswitch.org/"
 arch="all"
 license="ASL 2.0"
 depends=""
 depends_dev="openssl-dev"
-makedepends="$depends_dev perl python linux-headers"
-install=""
-subpackages="$pkgname-doc $pkgname-dbg $pkgname-monitor"
+makedepends="$depends_dev perl python linux-headers bash"
+subpackages="$pkgname-doc $pkgname-dbg $pkgname-dev $pkgname-monitor $pkgname-bash-completion:bashcomp"
 source="http://openvswitch.org/releases/$pkgname-$pkgver.tar.gz
 	ovsdb-server.initd
 	ovsdb-server.confd
@@ -47,6 +46,7 @@ build() {
 		--enable-ndebug \
 		|| return 1
 	make || return 1
+	#make check || return 1
 }
 
 monitor() {
@@ -84,33 +84,44 @@ package() {
                 "$pkgdir"/usr/share/doc/openvswitch/README.alpine || return 1
 }
 
-md5sums="5a5739ed82f1accac1c2d8d7553dc88f  openvswitch-2.3.2.tar.gz
+bashcomp() {
+        depends=""
+        pkgdesc="Bash completions for $pkgname"
+        install_if="$pkgname=$pkgver-r$pkgrel bash"
+        arch="noarch"
+
+        mkdir -p "$subpkgdir"/usr/share/bash-completion/completions/$pkgname
+        mv "$_builddir"/utilities/*-bashcomp.bash \
+                "$subpkgdir"/usr/share/bash-completion/completions/$pkgname/ || return 1
+}
+
+md5sums="4ff52595855c1f9e4dd3e84295599f5f  openvswitch-2.4.0.tar.gz
 a2b05882127059f79a02d1c49b58e526  ovsdb-server.initd
 f10a8ac784654bec359bda52779f16fe  ovsdb-server.confd
 384ad5bbe9dd788de78012864233a756  ovs-vswitchd.initd
 2d1e0111ea62779f49e14d62678294b2  ovs-vswitchd.confd
 45b381d434ccbc634a3224c5963edc66  ovs-modules.initd
-6e17032bd6e7caf6e6e844b5a84d7080  musl-if_packet.patch
+58bee4f4b4e632f2af74b91e27f68b5d  musl-if_packet.patch
 59fa9a6d293a25571562a5190ae559f2  0001-ovs-thread-Set-stacksize-to-1M.patch
 85d556990605747b2e5ddf782e2406db  ifupdown-alpine.patch
-7280528282e3c9ec235e013fede2f973  readme.debian.patch"
-sha256sums="386b11df94d06c68d391ee4091832360095bd3a14c72d454325fab284dad9887  openvswitch-2.3.2.tar.gz
+7f8fe9a891992bebf476a58122dabd60  readme.debian.patch"
+sha256sums="424c5a8dea1c5b153e8c1803bb041d0495e81379fb6f386dd58ee903a7681b9a  openvswitch-2.4.0.tar.gz
 737be74a4ce951cd49b9cd85696ff5cbdb54fa7ad52c831494fcf336487fc420  ovsdb-server.initd
 d0d8a6a7256f4cc47ab1b9f9f7657202388133bcfff3668e7c1d4adbcc572261  ovsdb-server.confd
 d2db312103d740fb9246ea218560995b969cb8356e3524d4c0ce79a06ccc65b8  ovs-vswitchd.initd
 cc189d5ca24708ff775a4de312df3f611c65714724b8901ec6527c9e3f22e14a  ovs-vswitchd.confd
 06079771a94dd363218f2b3561efd0178a47d85bfd73c8b6cf24eef4ec82b0de  ovs-modules.initd
-d0e9e3e30b2943b10e7efa59c41c3bf8d5b599d55fc99198146bf4761df4d8ae  musl-if_packet.patch
+ccd08d23963f3a3ac153df0746a117eea8544aa77f4adfa8f86dc5e22640a5f6  musl-if_packet.patch
 faf997814e89b0b5948c06050ef38051f0bc6b108958f76313263f77a724906c  0001-ovs-thread-Set-stacksize-to-1M.patch
 ac312e42b5d47137f860091ad041e7486107ba7956d37cd5a5c91893f7b8a3b3  ifupdown-alpine.patch
-57a2becc7210faff2fb57ef51f8e6c33978925b48e013ba5fb78d031f2f55748  readme.debian.patch"
-sha512sums="dfbd9d5b16aeecdc880efb910e0ec2e474dcc02515f0033b1e9466735387b39f2855bec49936a261aea66badb35e09598dbb9fc4b506e9a9e0c18d3441fea691  openvswitch-2.3.2.tar.gz
+942c34f14f6c6db92e2afe20c94fe6302bbb5e41eba2391713f908de101a5177  readme.debian.patch"
+sha512sums="bd66bcb37beacb0d684001609c26d9dc487efde0ecb051004813b0f8a5999039207b012617195d82d56aefe9a1756615e2158e531a71e9b1e5e10345f0370bae  openvswitch-2.4.0.tar.gz
 097d4721a78fff749c534910d98543778474406bd61b469b88a0d981a2a380556444437ec44278cead6d8688c45a38b2acbf1551acb9ab38d048f413728e3b88  ovsdb-server.initd
 b1588d076bbfc7ef2dd46fce8e46186f40cbbc4667697f7ac13ddc68e34568fdab315fde47838de7f6d32916853190336cfe3735f672ad7cb624ae14dbff55a5  ovsdb-server.confd
 4bff37f8bed32d5327b4b0433984ab8ffdce77f618034aa6ffd1ad4a7caa00703ea2bef312876dce5aafa4c17fe06dddd75e5c05c10e13bf8f5c3805a0654a96  ovs-vswitchd.initd
 346aea099f51707d2b4fc9fdc8c1502582723fb4e00c4d5d1624b0378c94dfb76674fa95e2af894f36169df52109dbe441ee6a45aa744584d9e4c74d15a46c1d  ovs-vswitchd.confd
 614c86eab826bb8f934cf4a98508fde9952a0b7211414e074510473af3455077a333729aa0e59f3634b9bf30d64847d0f7597246506c36a8f09d57573a2522fc  ovs-modules.initd
-1ebfb2629081cc0b34383e6c2f163f3c1d43da3a399b8ba8745871b77029d3b8fc21a287ff859a6a9cca2cb4885715458d4e4086cb6c17765ff7c898d4004850  musl-if_packet.patch
+c5f137bce28bf80c1e5a6ca18722dae9a5ecff03d20bf92642270951bbbb499e5fb05a08163442720e866d135fcd7426b88add0b42ed240d5f0c068aa9fcd9da  musl-if_packet.patch
 5fed04e68b58ab322154fa1cc4c4b63b08c22ed41f0b7713dbe8437f7cb4e9fd93c8aba524c2e5a46bba956da9439f5bfe5ba6fcdff2b98fa9bbcc748c5b64db  0001-ovs-thread-Set-stacksize-to-1M.patch
 0f2847986783f020f0708f2b185f10d1d34ead679bcae553a42df34a244c815e6e7346a2d73af69aff86258ecb3c855630a99ec28c6c7567bcfeacfb5379e5ee  ifupdown-alpine.patch
-27bf10138b0be024c0a9039aea9cfa42825d365de5d414872b25d7cd642f2d0d41d5c604d5282362f3d2b1782513fc792a619fe0b6de19d14c04178e11a3ccb0  readme.debian.patch"
+346f11a81f1538513151ea328fcbf2cdfc3c864aa34ea522055bc70266b9b2b2e05bdc0691593a9a1e4ef360d89d465507623edbcd9f764e3707d852736c895c  readme.debian.patch"
diff --git a/main/openvswitch/musl-if_packet.patch b/main/openvswitch/musl-if_packet.patch
index ff9d761..e57b307 100644
--- a/main/openvswitch/musl-if_packet.patch
+++ b/main/openvswitch/musl-if_packet.patch
@@ -1,9 +1,9 @@
---- ./lib/netdev-linux.c.orig
-+++ ./lib/netdev-linux.c
+--- openvswitch-2.4.0/lib/netdev-linux.c	2015-08-20 00:33:42.960971996 +0000
++++ openvswitch-2.4.0/lib/netdev-linux.c.new	2015-08-22 18:16:10.741115156 +0000
 @@ -37,10 +37,9 @@
- #include <sys/types.h>
  #include <sys/ioctl.h>
  #include <sys/socket.h>
+ #include <sys/utsname.h>
 -#include <netpacket/packet.h>
  #include <net/if.h>
  #include <net/if_arp.h>
diff --git a/main/openvswitch/readme.debian.patch b/main/openvswitch/readme.debian.patch
index 33f002e..82c186c 100644
--- a/main/openvswitch/readme.debian.patch
+++ b/main/openvswitch/readme.debian.patch
@@ -1,5 +1,5 @@
---- openvswitch-2.3.2/debian/openvswitch-switch.README.Debian	2015-06-18 19:32:47.000000000 +0000
-+++ openvswitch-2.3.2/debian/openvswitch-switch.README.Debian.new	2015-07-10 17:03:12.791341980 +0000
+--- openvswitch-2.4.0/debian/openvswitch-switch.README.Debian	2015-08-22 18:26:22.381124884 +0000
++++ openvswitch-2.4.0/debian/openvswitch-switch.README.Debian.new	2015-08-22 18:44:37.717142304 +0000
 @@ -1,44 +1,5 @@
 -README.Debian for openvswitch-switch
 ----------------------------------
@@ -47,24 +47,28 @@
  
  Debian network scripts integration
  ----------------------------------
-@@ -172,11 +133,6 @@ iface gre1 inet manual
-     ovs_tunnel_type gre
-     ovs_tunnel_options options:remote_ip=182.168.1.2 options:key=1
+@@ -202,8 +163,8 @@ iface gre1 inet manual
+ 
+ ex 8: Create and destroy bridges.
  
--ex 7: Create and destroy bridges.
--
 -ifup --allow=ovs $list_of_bridges
 -ifdown --allow=ovs $list_of_bridges
--
++ifup $list_of_bridges
++ifdown $list_of_bridges
+ 
  Notes on dependencies:
  ---------------------
- 
-@@ -203,3 +159,8 @@ in the 'auto' section, openvswitch-switc
+@@ -231,3 +192,12 @@ in the 'auto' section, openvswitch-switc
  ifupdown kicks in. In a case like this, the admin needs to make sure that /usr
  has already been mounted and that a remote $syslog (if used) is ready to
  receive openvswitch logs.
 +
 +Notes on LXC / ifupdown integration:
-+-----------------------------------
++------------------------------------
++
++LXC has partial support for ovs (ports are added but not fully removed)
++https://github.com/lxc/lxc/issues/590
 +
 +See 'ovsup' & 'ovsdown' https://github.com/itoffshore/lxc-scripts
++these scripts allow networking to be restarted & containers do not lose
++connectivity.
-- 
2.5.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---