Merge pull request #91659 from danieldk/lynis-shell-files

lynis: install man page and Bash shell completion
This commit is contained in:
Maximilian Bosch 2020-06-27 15:06:55 +02:00 committed by GitHub
commit 1695258f31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ stdenv, makeWrapper, fetchFromGitHub, gawk }:
{ stdenv, makeWrapper, fetchFromGitHub, gawk, installShellFiles }:
stdenv.mkDerivation rec {
pname = "lynis";
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "05p8h2ww4jcc6lgxrm796cbvlfmw26rxq5fmw0xxavbpadiw752j";
};
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ installShellFiles makeWrapper ];
postPatch = ''
grep -rl '/usr/local/lynis' ./ | xargs sed -i "s@/usr/local/lynis@$out/share/lynis@g"
@ -22,6 +22,10 @@ stdenv.mkDerivation rec {
cp -r include db default.prf $out/share/lynis/
cp -a lynis $out/bin
wrapProgram "$out/bin/lynis" --prefix PATH : ${stdenv.lib.makeBinPath [ gawk ]}
installManPage lynis.8
installShellCompletion --bash --name lynis.bash \
extras/bash_completion.d/lynis
'';
meta = with stdenv.lib; {