From 054c297c3ee32d6b584bc2bcb3477d646bc30167 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 18 Feb 2014 13:25:19 +0000
Subject: [PATCH] main/multipath-tools: upgrade to 0.5.0

---
 main/multipath-tools/APKBUILD        | 59 ++++++++++++++++++----------
 main/multipath-tools/daddr_t.patch   | 11 ++++++
 main/multipath-tools/sys-types.patch | 11 ++++++
 3 files changed, 61 insertions(+), 20 deletions(-)
 create mode 100644 main/multipath-tools/daddr_t.patch
 create mode 100644 main/multipath-tools/sys-types.patch

diff --git a/main/multipath-tools/APKBUILD b/main/multipath-tools/APKBUILD
index bb733a0642d7..6bad71a0a3b4 100644
--- a/main/multipath-tools/APKBUILD
+++ b/main/multipath-tools/APKBUILD
@@ -1,34 +1,38 @@
 # Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
 pkgname="multipath-tools"
-pkgver=0.4.9_git20120127
+pkgver=0.5.0
 pkgrel=0
 pkgdesc="Device Mapper Multipathing Driver"
 url="http://christophe.varoqui.free.fr/"
 arch="all"
 license="GPL"
 depends="udev"
-makedepends="lvm2-dev libaio-dev readline-dev ncurses-dev"
+makedepends="lvm2-dev libaio-dev readline-dev ncurses-dev udev-dev"
 install=
 subpackages="$pkgname-doc"
-source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.gz
+source="http://christophe.varoqui.free.fr/multipath-tools/multipath-tools-$pkgver.tar.bz2
+	multipath-tools.conf
+	multipath-tools.confd
+	multipath-tools.initd
+
+	sys-types.patch
+	daddr_t.patch
 	"
-#source="http://christophe.varoqui.free.fr/$pkgname/$pkgname-$pkgver.tar.bz2
 
-_builddir="$srcdir"
+_builddir="$srcdir"/multipath-tools-$pkgver
 
 prepare() {
-	cd $_builddir
-	find . -name Makefile -exec sed -i -e 's/glibc/uclibc/g' {} \;
-#	for i in ../*.patch
-#	do
-#		msg "Applying $i"
-#		patch -p1 < $i || return 1
-#	done
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
 }
 
 build() {
 	cd $_builddir
-	make -j1 prefix="/usr" \
+	make prefix="/usr" \
 		sysconfdir="/etc" \
 		mandir="/usr/share/man" \
 		infodir="/usr/share/info" || return 1
@@ -36,12 +40,27 @@ build() {
 
 package() {
 	cd $_builddir
-	make DESTDIR="$pkgdir" install
-	install -D -m644 ../$pkgname.conf $pkgdir/etc/multipath.conf
-	install -D -m644 ../$pkgname.confd $pkgdir/etc/conf.d/multipathd
-	install -D -m755 ../$pkgname.initd $pkgdir/etc/init.d/multipathd
+	make DESTDIR="$pkgdir" install || return 1
+	install -D -m644 "$srcdir"/$pkgname.conf $pkgdir/etc/multipath.conf
+	install -D -m644 "$srcdir"/$pkgname.confd $pkgdir/etc/conf.d/multipathd
+	install -D -m755 "$srcdir"/$pkgname.initd $pkgdir/etc/init.d/multipathd
 }
 
-md5sums="38503d19b66c247c7da87eca9a48d570  multipath-tools-0.4.9_git20120127.tar.gz"
-sha256sums="bc51ed7cae3fd4a60d5157d7fb3593395663362223e5fd86f30cf4b6d92f9cf4  multipath-tools-0.4.9_git20120127.tar.gz"
-sha512sums="f9f27dded1d8c7fb7f1aae0d0febc0461cc939db337c204310d9d45a2d1d138601621cb56b5048f1a4b8a08142245b852d28ed6fddbd43d6466f41c67d933a9e  multipath-tools-0.4.9_git20120127.tar.gz"
+md5sums="faf261d4cc717bf4c979557dc7bf5f52  multipath-tools-0.5.0.tar.bz2
+d364a5ef62c23da92d81baf90e7b6192  multipath-tools.conf
+52dcde0446669e9d19813b28f3dd622b  multipath-tools.confd
+6e42b2a29e72fcd2aa5955fc0a15e9fc  multipath-tools.initd
+12f2c6235caa2cc0cbe97606ae379fff  sys-types.patch
+9e7673f58a2b43798877396c4d9004fc  daddr_t.patch"
+sha256sums="f13cf1eb84e94e83b2019e68f7965526903c13e94246db43965d181668a0a6f9  multipath-tools-0.5.0.tar.bz2
+e5df29fc6cf01789db179e20aaac2705878975eb826157bd9f824a3f86a8dcd5  multipath-tools.conf
+b13587b0865ea8c39f51e2177e4fbc0ada237408a5807fab836ff4b5ebcb3e37  multipath-tools.confd
+e04fb996edb6f7d5ca582549df7ff6f01c2883c727a0595934711f122db6ec78  multipath-tools.initd
+d7bd2b5e3de194a151aaf15de4a3b136a218d064b78539027e7f2fa4613072fb  sys-types.patch
+cb6877ba73f7e8ed6efded8af902ecb16ee5be901149b3f771b5c6ccdb3fe452  daddr_t.patch"
+sha512sums="dfad21c45d0f69e39041d30d203a582c8ee8329bf390c51cde10155b3de379e7ad8fead2ac4beb268a924fd7e7dc8e1cf538ea3c70d41479fd8786fa30ba22a9  multipath-tools-0.5.0.tar.bz2
+e81462b22c0cbc92ea935d7544b9f9a0c4ccbcf13f3bc03dadf6de96407c9cf49964c9bbf02f12a134e1255c66421c6fde39d54b15eef975e8df81bdc88b2213  multipath-tools.conf
+303c62b7506b207ba2266310e7a701d76151e6f1544b44faf666dfabdc59c5aeb98544d380988e18b4a7b8235e4000380f025c4dd6c95d45a7b8b51bbf39dce5  multipath-tools.confd
+77e8314fae635bb592cb4f355af66e367e33b80cc85d49bc02fdf764981006492de965a767f2e4e00cb11638da8f9988f9eb2088d516ab41f54aedeaafd1bd1d  multipath-tools.initd
+bee0b1d18c0359a2c43719bd2cf7bc80ce073aa27e1315c9a9b9efa805474359df1b796dc832b0162a686b11b0d1aeb2c85b5bb2b36892dd472b53694c939cd4  sys-types.patch
+526707621ca2747b07192824e1269a17c81ffb7c19606d45388bb80ae7da027f68c25edd53a690d1485d00fc4ce6dab646e097d53a33394860f6c9d5b072e463  daddr_t.patch"
diff --git a/main/multipath-tools/daddr_t.patch b/main/multipath-tools/daddr_t.patch
new file mode 100644
index 000000000000..3922b123db47
--- /dev/null
+++ b/main/multipath-tools/daddr_t.patch
@@ -0,0 +1,11 @@
+--- ./kpartx/solaris.c.orig
++++ ./kpartx/solaris.c
+@@ -11,7 +11,7 @@
+ struct solaris_x86_slice {
+ 	unsigned short	s_tag;		/* ID tag of partition */
+ 	unsigned short	s_flag;		/* permision flags */
+-	daddr_t 	s_start;	/* start sector no of partition */
++	long		s_start;	/* start sector no of partition */
+ 	long		s_size;		/* # of blocks in partition */
+ };
+ 
diff --git a/main/multipath-tools/sys-types.patch b/main/multipath-tools/sys-types.patch
new file mode 100644
index 000000000000..6ee0311b3035
--- /dev/null
+++ b/main/multipath-tools/sys-types.patch
@@ -0,0 +1,11 @@
+--- ./libmultipath/util.h.orig
++++ ./libmultipath/util.h
+@@ -1,6 +1,8 @@
+ #ifndef _UTIL_H
+ #define _UTIL_H
+ 
++#include <sys/types.h>
++
+ size_t strchop(char *);
+ int basenamecpy (const char * src, char * dst, int);
+ int filepresent (char * run);
-- 
GitLab