Subject: [alpine-aports] [PATCH] main/bridge-utils: build fixes

From: Isaac Dunham <[email-masked]>
Date: Sat, 30 Jan 2016 18:40:53 -0800

* restore prepare() function
* include correct headers
--
This should solve the issue reported by Paul Roland on the alpine-devel list.

A few headers were missing so brctl failed to build, but somehow make
didn't die; the result was a 'dummy' package.
---
 main/bridge-utils/00-musl-headers.patch | 53 +++++++++++++++++++++++++++++++++
 main/bridge-utils/APKBUILD              | 27 +++++++++++++----
 2 files changed, 75 insertions(+), 5 deletions(-)
 create mode 100644 main/bridge-utils/00-musl-headers.patch

diff --git a/main/bridge-utils/00-musl-headers.patch b/main/bridge-utils/00-musl-headers.patch
new file mode 100644
index 0000000..a970731
--- /dev/null
+++ b/main/bridge-utils/00-musl-headers.patch
@@ -0,0 +1,53 @@
+diff --git a/brctl/brctl.c b/brctl/brctl.c
+index 454b8dd..8a7f095 100644
+--- a/brctl/brctl.c
++++ b/brctl/brctl.c
+@@ -19,7 +19,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <getopt.h>
+ 
+ #include "libbridge.h"
+diff --git a/libbridge/libbridge.h b/libbridge/libbridge.h
+index 39964f2..73de4fb 100644
+--- a/libbridge/libbridge.h
++++ b/libbridge/libbridge.h
+@@ -23,6 +23,9 @@
+ #include <linux/if.h>
+ #include <linux/if_bridge.h>
+ 
++#include <sys/types.h>
++#include <sys/time.h>
++
+ /* defined in net/if.h but that conflicts with linux/if.h... */
+ extern unsigned int if_nametoindex (const char *__ifname);
+ extern char *if_indextoname (unsigned int __ifindex, char *__ifname);
+diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c
+index aa8bc36..1da3549 100644
+--- a/libbridge/libbridge_devif.c
++++ b/libbridge/libbridge_devif.c
+@@ -23,7 +23,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <dirent.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ 
+ #include "libbridge.h"
+ #include "libbridge_private.h"
+diff --git a/libbridge/libbridge_if.c b/libbridge/libbridge_if.c
+index 77d3f8a..9cf4bac 100644
+--- a/libbridge/libbridge_if.c
++++ b/libbridge/libbridge_if.c
+@@ -20,7 +20,7 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/ioctl.h>
+ 
+ #include "libbridge.h"
diff --git a/main/bridge-utils/APKBUILD b/main/bridge-utils/APKBUILD
index 74151a5..bb6c385 100644
--- a/main/bridge-utils/APKBUILD
+++ b/main/bridge-utils/APKBUILD
@@ -1,7 +1,7 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=bridge-utils
 pkgver=1.5
-pkgrel=2
+pkgrel=3
 pkgdesc="Tools for configuring the Linux kernel 802.1d Ethernet Bridge"
 url="http://sourceforge.net/projects/bridge/"
 arch="all"
@@ -9,9 +9,23 @@ license="GPL2+"
 subpackages="$pkgname-doc"
 depends=""
 makedepends="autoconf"
-source="http://downloads.sourceforge.net/project/bridge/bridge/bridge-utils-$pkgver.tar.gz"
+source="http://downloads.sourceforge.net/project/bridge/bridge/bridge-utils-$pkgver.tar.gz
+	00-musl-headers.patch
+	"
 
 _builddir="$srcdir"/$pkgname-$pkgver
+
+prepare() {
+	cd "${_builddir}" || return 1
+	for p in $source; do
+		case $p in
+			*.patch)
+				msg $p; patch -p1 -i "$srcdir"/$p || return 1
+			;;
+		esac
+	done
+}
+
 build() {
 	cd "$_builddir"
 	autoconf
@@ -31,6 +45,9 @@ package() {
 	make install DESTDIR="$pkgdir" || return 1
 }
 
-md5sums="ec7b381160b340648dede58c31bb2238  bridge-utils-1.5.tar.gz"
-sha256sums="42f9e5fb8f6c52e63a98a43b81bd281c227c529f194913e1c51ec48a393b6688  bridge-utils-1.5.tar.gz"
-sha512sums="4e525fbd3defb509664ef3b728d9e5edfb92beaebdb5d7733d8203fb38cb3f4bb54d02dc1e28813889a2ee19c78b9b47da6d99c8032481a7fd7f104658dea7c3  bridge-utils-1.5.tar.gz"
+md5sums="ec7b381160b340648dede58c31bb2238  bridge-utils-1.5.tar.gz
+0835358641d481269ab6a5b2fb186060  00-musl-headers.patch"
+sha256sums="42f9e5fb8f6c52e63a98a43b81bd281c227c529f194913e1c51ec48a393b6688  bridge-utils-1.5.tar.gz
+8cf2f4b57604a8287b9103430ce40dfefa3bd48e8bbca6a08299b03924c58557  00-musl-headers.patch"
+sha512sums="4e525fbd3defb509664ef3b728d9e5edfb92beaebdb5d7733d8203fb38cb3f4bb54d02dc1e28813889a2ee19c78b9b47da6d99c8032481a7fd7f104658dea7c3  bridge-utils-1.5.tar.gz
+12d8e736bb854c33c3bfcc8fc0d32e721c6655c5aed1e4a0f368c93fb06b6d0f5090a8b19a8527cb1a824747ee6d9f9df788a35dcf955e63e7c45c1bae0f48fe  00-musl-headers.patch"
-- 
2.7.0

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