# Maintainer: Markus M. May <triplem@tu.archserver.org>
# Contributor: Michael P <ptchinster@archlinux.us>
# Contributor: Matt Heagney <matt@heagney.com>
pkgname=multipath-tools
pkgver=0.4.9
pkgrel=3
pkgdesc="Multipath Tools For Linux"
arch=('i686' 'x86_64')
url="http://christophe.varoqui.free.fr/"
license=('GPL')
depends=(libaio device-mapper)
makedepends=()
provides=()
conflicts=()
replaces=()
backup=('etc/multipath.conf', 'etc/multipath.conf.annotated', 'etc/rc.d/multipathd' )
install=
source=(http://christophe.varoqui.free.fr/multipath-tools/$pkgname-$pkgver.tar.bz2
	multipath.conf multipath.conf.annotated multipathd )
noextract=()
md5sums=('a6d4b48afc28f1f50f5ee4b1b06d2765'
         'f35acf160a4e1f17cbeb96b94af004ee'
         '5a93f993ec05fc99094d5139aabd3925'
         '035faa08e0126b4e84734794485128a0')

build() {
	#Needs to be fixed upstream. Refer to
	# https://bbs.archlinux.org/viewtopic.php?pid=793814#p793814
	export LDFLAGS=${LDFLAGS//-Wl,--as-needed}
	
	cd "${srcdir}"

	make
}

package() {
	cd $srcdir
	make DESTDIR="${pkgdir}" install

	install -D -m 644 ${startdir}/multipath.conf ${pkgdir}/etc/multipath.conf
	install -D -m 644 ${startdir}/multipath.conf.annotated ${pkgdir}/etc/multipath.conf.annotated
	install -D -m 755 ${startdir}/multipathd ${pkgdir}/etc/rc.d/multipathd
}
