nixpkgs/pkgs/os-specific/linux/ipvsadm/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, pkg-config, libnl, popt, gnugrep }:
2018-01-24 16:36:50 +00:00
stdenv.mkDerivation rec {
pname = "ipvsadm";
2020-01-06 19:05:11 +00:00
version = "1.31";
2018-01-24 16:36:50 +00:00
src = fetchurl {
url = "mirror://kernel/linux/utils/kernel/ipvsadm/${pname}-${version}.tar.xz";
2020-01-06 19:05:11 +00:00
sha256 = "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs";
2018-01-24 16:36:50 +00:00
};
postPatch = ''
substituteInPlace Makefile --replace "-lnl" "$(pkg-config --libs libnl-genl-3.0)"
'';
nativeBuildInputs = [ pkg-config ];
2018-01-24 16:36:50 +00:00
buildInputs = [ libnl popt ];
2022-01-29 10:34:05 +00:00
# Disable parallel build, errors:
# *** No rule to make target 'libipvs/libipvs.a', needed by 'ipvsadm'. Stop.
enableParallelBuilding = false;
2018-01-24 16:36:50 +00:00
preBuild = ''
makeFlagsArray+=(
INCLUDE=$(pkg-config --cflags libnl-genl-3.0)
BUILD_ROOT=$out
MANDIR=share/man
)
'';
postInstall = ''
sed -i -e "s|^PATH=.*|PATH=$out/bin:${gnugrep}/bin|" $out/sbin/ipvsadm-{restore,save}
'';
meta = with lib; {
2018-01-24 16:36:50 +00:00
description = "Linux Virtual Server support programs";
homepage = "http://www.linuxvirtualserver.org/software/ipvs.html";
2018-01-24 16:36:50 +00:00
license = licenses.gpl2;
platforms = platforms.linux;
};
}