2010-09-27 13:49:13 +00:00
|
|
|
{stdenv, libcap}:
|
|
|
|
|
|
|
|
assert stdenv.isLinux;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "libcap-progs-${libcap.version}";
|
|
|
|
|
|
|
|
inherit (libcap) src makeFlags;
|
|
|
|
|
|
|
|
buildInputs = [ libcap ];
|
|
|
|
|
2015-02-03 09:25:16 +00:00
|
|
|
prePatch = ''
|
2015-02-03 10:11:17 +00:00
|
|
|
# use relative bash path
|
|
|
|
substituteInPlace progs/capsh.c --replace "/bin/bash" "bash"
|
|
|
|
|
|
|
|
# ensure capsh can find bash in $PATH
|
|
|
|
substituteInPlace progs/capsh.c --replace execve execvpe
|
2015-02-03 09:25:16 +00:00
|
|
|
'';
|
2015-02-02 20:22:06 +00:00
|
|
|
|
2010-09-27 13:49:13 +00:00
|
|
|
preConfigure = "cd progs";
|
|
|
|
|
2012-07-19 14:25:56 +00:00
|
|
|
installFlags = "RAISE_SETFCAP=no";
|
|
|
|
|
2010-09-27 13:49:13 +00:00
|
|
|
postInstall = libcap.postinst name;
|
|
|
|
}
|