# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname="multipath-tools"
pkgver=0.7.3
pkgrel=0
pkgdesc="Device Mapper Multipathing Driver"
url="http://christophe.varoqui.free.fr/"
arch="all"
license="GPL"
depends="eudev"
makedepends="lvm2-dev libaio-dev readline-dev ncurses-dev eudev-dev
	userspace-rcu-dev json-c-dev perl"
_snapid="888735d20d6ae6f5b4363a2aa750d97174aac3ee"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://git.opensvc.com/?p=multipath-tools/.git;a=snapshot;h=$_snapid;sf=tgz
	multipath-tools.conf
	multipath-tools.confd
	multipath-tools.initd

	0001-disable-rados.patch
	"
options="!check"
_snapdirsuffix=$(echo $_snapid | cut -c1-7)
builddir="$srcdir"/multipath-tools-$_snapdirsuffix

build() {
	cd $builddir
	make prefix="/usr" \
		sysconfdir="/etc" \
		mandir="/usr/share/man" \
		infodir="/usr/share/info" || return 1
}

package() {
	cd $builddir
	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
}

sha512sums="dc0c0d4f6165c5e7c9fa4535af697a91beb7cef7cf664b15b768c76e43d63e22b21951a1909dfa59a3e34478f45bdb7b0fade940b9ccb49b0af66960293e5a98  multipath-tools-0.7.3.tar.gz
e81462b22c0cbc92ea935d7544b9f9a0c4ccbcf13f3bc03dadf6de96407c9cf49964c9bbf02f12a134e1255c66421c6fde39d54b15eef975e8df81bdc88b2213  multipath-tools.conf
303c62b7506b207ba2266310e7a701d76151e6f1544b44faf666dfabdc59c5aeb98544d380988e18b4a7b8235e4000380f025c4dd6c95d45a7b8b51bbf39dce5  multipath-tools.confd
1ca0a8be7ddd0d57b810ab4905bc35d6b89b924ef528a7ee77dad162b86b990e0b86ef714f63857def4a61e30bfabe7a3980f624d63b80108408dd876a7c468c  multipath-tools.initd
2cdf669823d24fea230784fc911bf01942980ea04c611e973996ba6baa051c64ef5defc00161deccdf6ede45e3b38c526c6f6aaaf4ba9137c010ebbc1f97038f  0001-disable-rados.patch"