Subject: [alpine-aports] [PATCH 1/2] main/libbsd: improve abuild

From: Daniel Sabogal <[email-masked]>
Date: Sat, 27 Aug 2016 10:45:26 -0400

---
 main/libbsd/APKBUILD | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/main/libbsd/APKBUILD b/main/libbsd/APKBUILD
index f58a03f..51b93c2 100644
--- a/main/libbsd/APKBUILD
+++ b/main/libbsd/APKBUILD
@@ -3,33 +3,27 @@
 # Maintainer: William Pitcock <[email-masked]>
 pkgname=libbsd
 pkgver=0.8.1
-pkgrel=0
+pkgrel=1
 pkgdesc="commonly-used BSD functions not implemented by all libcs"
 url="http://libbsd.freedesktop.org/"
 arch="x86 x86_64"
 license="BSD"
 depends=""
-depends_dev=""
-makedepends="$depends_dev autoconf automake libtool bsd-compat-headers
-	linux-headers"
-install=""
+makedepends="autoconf automake libtool bsd-compat-headers linux-headers"
 subpackages="$pkgname-dev $pkgname-doc"
 source="http://libbsd.freedesktop.org/releases/$pkgname-$pkgver.tar.xz
 	musl-fixes.patch"
 
-_builddir="$srcdir"/libbsd-$pkgver
+builddir="$srcdir/$pkgname-$pkgver"
 prepare() {
-	cd "$_builddir"
-	for i in $source; do
-		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-		esac
-	done
+	default_prepare || return 1
+
+	cd "$builddir"
 	autoreconf -fi || return 1
 }
 
 build() {
-	cd "$_builddir"
+	cd "$builddir"
 	./configure \
 		--build=$CBUILD \
 		--host=$CHOST \
@@ -43,8 +37,8 @@ build() {
 }
 
 package() {
-	cd "$_builddir"
-	make DESTDIR="$pkgdir" install || return 1
+	make DESTDIR="$pkgdir" -C "$builddir" \
+		install || return 1
 }
 
 md5sums="f3daff0283af6e30f25d68be2deac4ef  libbsd-0.8.1.tar.xz
-- 
2.8.3

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

---

From: Daniel Sabogal <[email-masked]>
Date: Sat, 27 Aug 2016 10:45:27 -0400

CVE-2016-2090 fixed in 0.8.2
https://lists.freedesktop.org/archives/libbsd/2016-April/000133.html
https://lists.freedesktop.org/archives/libbsd/2016-April/000134.html
---
 main/libbsd/APKBUILD         | 16 ++++++++--------
 main/libbsd/musl-fixes.patch | 35 +++++++++++++++++------------------
 2 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/main/libbsd/APKBUILD b/main/libbsd/APKBUILD
index 51b93c2..2295e36 100644
--- a/main/libbsd/APKBUILD
+++ b/main/libbsd/APKBUILD
@@ -2,8 +2,8 @@
 # Contributor: William Pitcock <[email-masked]>
 # Maintainer: William Pitcock <[email-masked]>
 pkgname=libbsd
-pkgver=0.8.1
-pkgrel=1
+pkgver=0.8.3
+pkgrel=0
 pkgdesc="commonly-used BSD functions not implemented by all libcs"
 url="http://libbsd.freedesktop.org/"
 arch="x86 x86_64"
@@ -41,9 +41,9 @@ package() {
 		install || return 1
 }
 
-md5sums="f3daff0283af6e30f25d68be2deac4ef  libbsd-0.8.1.tar.xz
-4449c9cd2447a595d283441c75256fbd  musl-fixes.patch"
-sha256sums="adbc8781ad720bce939b689f38a9f0247732a36792147a7c28027c393c2af9b0  libbsd-0.8.1.tar.xz
-94bc4853e2acae9d630f01aaae2992d166dd92154446112f1e80bb186c0e6be8  musl-fixes.patch"
-sha512sums="8ae687cf6baf0364661d8452c0f2817ba9d7fc59fbf198aceda33d3b8575fd385e2915f145132b1a7fd43b18c0a7ba9306c98f0d98fc7e35412918df456364c6  libbsd-0.8.1.tar.xz
-a60b23c87dca30db2414f7f7184503cd080e2ff490f28d8b5a4c55ff48e282e80e636c0e72096753d4cf8b32f852004aa3b24eae7b6ef7e62ef85169f052335a  musl-fixes.patch"
+md5sums="e935c1bb6cc98a4a43cb1da22795493a  libbsd-0.8.3.tar.xz
+21a350d9723d667b5ed8a8b610528843  musl-fixes.patch"
+sha256sums="934b634f4dfd865b6482650b8f522c70ae65c463529de8be907b53c89c3a34a8  libbsd-0.8.3.tar.xz
+cc7d2f2dfe2cc5d823e6ea5f7c1efea236f688c7ee53ec925471264e54c72359  musl-fixes.patch"
+sha512sums="155b895d6bd62b180718d65a2cda7484946c492d52735a57b51005705dfe4528b6a72e8745acea47b01fe68e3bbbe3c036c5e9998a8d06fc79efe2b96a04767f  libbsd-0.8.3.tar.xz
+032b8de7abfe6ffec80957db05fcb02b2cec74f26ecc99ef20d2a314efd0dfd88486e31bd33dd7460ac85b48acdab3ba849cd96bdd0884cd5667e7a43ab30c3a  musl-fixes.patch"
diff --git a/main/libbsd/musl-fixes.patch b/main/libbsd/musl-fixes.patch
index f4f69bb..d07f18c 100644
--- a/main/libbsd/musl-fixes.patch
+++ b/main/libbsd/musl-fixes.patch
@@ -1,29 +1,28 @@
---- libbsd-0.7.0.orig/src/flopen.c
-+++ libbsd-0.7.0/src/flopen.c
-@@ -1,3 +1,4 @@
-+#include <fcntl.h>
- /*-
-  * Copyright (c) 2007 Dag-Erling Coïdan Smørgrav
-  * All rights reserved.
---- libbsd-0.7.0.orig/src/funopen.c
-+++ libbsd-0.7.0/src/funopen.c
+--- libbsd-0.8.3.orig/include/bsd/nlist.h
++++ libbsd-0.8.3/include/bsd/nlist.h
+@@ -28,7 +28,7 @@
+ #define LIBBSD_NLIST_H
+ 
+ #include <sys/cdefs.h>
+-#include <a.out.h>
++#include <linux/a.out.h>
+ 
+ __BEGIN_DECLS
+ extern int nlist(const char *filename, struct nlist *list);
+--- libbsd-0.8.3.orig/src/funopen.c
++++ libbsd-0.8.3/src/funopen.c
 @@ -138,5 +138,4 @@
  	return fopencookie(cookiewrap, mode, funcswrap);
  }
  #else
 -#error "Function funopen() needs to be ported."
  #endif
---- libbsd-0.7.0.orig/src/nlist.c
-+++ libbsd-0.7.0/src/nlist.c
-@@ -1,3 +1,4 @@
-+#include <fcntl.h>
- /*
-  * Copyright (c) 1989, 1993
-  *	The Regents of the University of California.  All rights reserved.
-@@ -39,7 +40,7 @@
- #include <arpa/inet.h>
+--- libbsd-0.8.3.orig/src/nlist.c
++++ libbsd-0.8.3/src/nlist.c
+@@ -40,7 +40,7 @@
  
  #include <errno.h>
+ #include <fcntl.h>
 -#include <a.out.h>
 +#include <linux/a.out.h>
  #include <stdio.h>
-- 
2.8.3

---