multipath_tools: Cleanup and update to v0.5.0

Previously, version 0.4.9 was a tarbomb and in version 0.5.0 this
fortunately isn't the case anymore so we don't need to set sourceRoot by
ourselves.

I've also moved the definition of makeFlagsArray to the attribute
makeFlags, because we can use $(var) to substitute shell variables
within make.

The references to /lib/udev/scsi_id no longer exist in version 0.5.0 and
it seems that libudev is used directly.

Nevertheless, there are still references to FHS paths such as /var/run,
/etc/multipath.conf and /etc/multipath but these are only relevant at
runtime and can be configured to point to a different path elsewhere.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>

aszlig 05fed13d 4d5293d8

+19 -17
+19 -17
pkgs/os-specific/linux/multipath-tools/default.nix
··· 1 1 { stdenv, fetchurl, lvm2, libaio, gzip, readline, udev }: 2 2 3 3 stdenv.mkDerivation rec { 4 - name = "multipath-tools-0.4.9"; 4 + name = "multipath-tools-0.5.0"; 5 5 6 6 src = fetchurl { 7 7 url = "http://christophe.varoqui.free.fr/multipath-tools/${name}.tar.bz2"; 8 - sha256 = "04n7kazp1zrlqfza32phmqla0xkcq4zwn176qff5ida4a60whi4d"; 8 + sha256 = "1yd6l1l1c62xjr1xnij2x49kr416anbgfs4y06r86kp9hkmz2g7i"; 9 9 }; 10 10 11 - sourceRoot = "."; 12 - 13 - buildInputs = [ lvm2 libaio readline ]; 11 + postPatch = '' 12 + sed -i -re ' 13 + s,^( *#define +DEFAULT_MULTIPATHDIR\>).*,\1 "'"$out/lib/multipath"'", 14 + ' libmultipath/defaults.h 15 + sed -i -e 's,\$(DESTDIR)/\(usr/\)\?,$(prefix)/,g' \ 16 + kpartx/Makefile libmpathpersist/Makefile 17 + ''; 14 18 15 - preBuild = 16 - '' 17 - makeFlagsArray=(GZIP="${gzip}/bin/gzip -9n -c" prefix=$out mandir=$out/share/man/man8 man5dir=$out/share/man/man5 LIB=lib) 18 - 19 - substituteInPlace multipath/Makefile --replace /etc $out/etc 20 - substituteInPlace kpartx/Makefile --replace /etc $out/etc 21 - 22 - substituteInPlace kpartx/kpartx.rules --replace /sbin/kpartx $out/sbin/kpartx 23 - substituteInPlace kpartx/kpartx_id --replace /sbin/dmsetup ${lvm2}/sbin/dmsetup 19 + nativeBuildInputs = [ gzip ]; 20 + buildInputs = [ udev lvm2 libaio readline ]; 24 21 25 - substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${udev}/lib/udev/scsi_id 26 - substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${udev}/lib/udev/scsi_id 27 - ''; 22 + makeFlags = [ 23 + "LIB=lib" 24 + "prefix=$(out)" 25 + "mandir=$(out)/share/man/man8" 26 + "man5dir=$(out)/share/man/man5" 27 + "man3dir=$(out)/share/man/man3" 28 + "unitdir=$(out)/lib/systemd/system" 29 + ]; 28 30 29 31 meta = { 30 32 description = "Tools for the Linux multipathing driver";