2010-09-27 15:49:13 +02:00
|
|
|
{stdenv, libcap}:
|
|
|
|
|
|
|
|
assert stdenv.isLinux;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "libcap-progs-${libcap.version}";
|
|
|
|
|
|
|
|
inherit (libcap) src makeFlags;
|
|
|
|
|
|
|
|
buildInputs = [ libcap ];
|
|
|
|
|
2015-02-03 10:25:16 +01:00
|
|
|
prePatch = ''
|
2015-02-03 11:11:17 +01: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 10:25:16 +01:00
|
|
|
'';
|
2015-02-02 21:22:06 +01:00
|
|
|
|
2010-09-27 15:49:13 +02:00
|
|
|
preConfigure = "cd progs";
|
|
|
|
|
2012-07-19 16:25:56 +02:00
|
|
|
installFlags = "RAISE_SETFCAP=no";
|
|
|
|
|
2010-09-27 15:49:13 +02:00
|
|
|
postInstall = libcap.postinst name;
|
|
|
|
}
|