2021-03-11 15:31:32 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, perl, lvm2, libaio, gzip, readline, systemd, liburcu, json_c, kmod }:
|
2011-04-06 14:57:31 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "multipath-tools";
|
2019-10-07 19:11:55 +00:00
|
|
|
version = "0.8.3";
|
2011-04-06 14:57:31 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
name = "${pname}-${version}.tar.gz";
|
2019-05-17 14:26:15 +00:00
|
|
|
url = "https://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=snapshot;h=refs/tags/${version};sf=tgz";
|
2019-10-07 19:11:55 +00:00
|
|
|
sha256 = "1mgjylklh1cx8px8ffgl12kyc0ln3445vbabd2sy8chq31rpiiq8";
|
2011-04-06 14:57:31 +00:00
|
|
|
};
|
|
|
|
|
2020-06-18 12:56:20 +00:00
|
|
|
patches = [
|
|
|
|
# fix build with json-c 0.14 https://www.redhat.com/archives/dm-devel/2020-May/msg00261.html
|
|
|
|
./json-c-0.14.patch
|
|
|
|
];
|
|
|
|
|
2016-01-21 14:29:02 +00:00
|
|
|
postPatch = ''
|
2021-03-11 15:31:32 +00:00
|
|
|
substituteInPlace libmultipath/Makefile \
|
|
|
|
--replace /usr/include/libdevmapper.h ${lib.getDev lvm2}/include/libdevmapper.h
|
|
|
|
|
|
|
|
substituteInPlace multipathd/multipathd.service \
|
|
|
|
--replace /sbin/modprobe ${lib.getBin kmod}/sbin/modprobe \
|
|
|
|
--replace /sbin/multipathd "$out/bin/multipathd"
|
|
|
|
|
2016-01-21 14:29:02 +00:00
|
|
|
sed -i -re '
|
|
|
|
s,^( *#define +DEFAULT_MULTIPATHDIR\>).*,\1 "'"$out/lib/multipath"'",
|
|
|
|
' libmultipath/defaults.h
|
|
|
|
sed -i -e 's,\$(DESTDIR)/\(usr/\)\?,$(prefix)/,g' \
|
|
|
|
kpartx/Makefile libmpathpersist/Makefile
|
2020-06-02 14:50:01 +00:00
|
|
|
sed -i -e "s,GZIP,GZ," \
|
|
|
|
$(find * -name Makefile\*)
|
2016-01-21 14:29:02 +00:00
|
|
|
'';
|
2011-04-06 14:57:31 +00:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ gzip pkg-config perl ];
|
2019-05-17 14:26:15 +00:00
|
|
|
buildInputs = [ systemd lvm2 libaio readline liburcu json_c ];
|
2011-04-06 14:57:31 +00:00
|
|
|
|
2016-01-21 14:29:02 +00:00
|
|
|
makeFlags = [
|
|
|
|
"LIB=lib"
|
|
|
|
"prefix=$(out)"
|
2019-11-06 18:12:52 +00:00
|
|
|
"man8dir=$(out)/share/man/man8"
|
2016-01-21 14:29:02 +00:00
|
|
|
"man5dir=$(out)/share/man/man5"
|
|
|
|
"man3dir=$(out)/share/man/man3"
|
2019-11-06 18:12:52 +00:00
|
|
|
"SYSTEMDPATH=lib"
|
2016-01-21 14:29:02 +00:00
|
|
|
];
|
2011-04-06 14:57:31 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2011-04-06 14:57:31 +00:00
|
|
|
description = "Tools for the Linux multipathing driver";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://christophe.varoqui.free.fr/";
|
2018-08-30 19:37:57 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2011-04-06 14:57:31 +00:00
|
|
|
};
|
|
|
|
}
|