nixpkgs-suyu/pkgs/tools/security/lynis/default.nix
R. RyanTM 22087672bc lynis: 2.6.4 -> 2.6.5
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools.

This update was made based on information from https://repology.org/metapackage/lynis/versions.

These checks were done:

- built on NixOS
- /nix/store/nbrk6fjsbanqgx89v0mwgq9x6cqkwx6p-lynis-2.6.5/bin/lynis passed the binary check.
- /nix/store/nbrk6fjsbanqgx89v0mwgq9x6cqkwx6p-lynis-2.6.5/bin/.lynis-wrapped passed the binary check.
- 2 of 2 passed binary check by having a zero exit code.
- 2 of 2 passed binary check by having the new version present in output.
- found 2.6.5 with grep in /nix/store/nbrk6fjsbanqgx89v0mwgq9x6cqkwx6p-lynis-2.6.5
- directory tree listing: https://gist.github.com/4ec2eae2a408cbec08c7f34ea3d85e66
- du listing: https://gist.github.com/f8d9c962be7ba2b02df3ad9111a622ae
2018-06-27 18:03:45 -07:00

38 lines
1.2 KiB
Nix

{ stdenv, makeWrapper, fetchFromGitHub, gawk, perl }:
stdenv.mkDerivation rec {
pname = "lynis";
version = "2.6.5";
name = "${pname}-${version}";
src = fetchFromGitHub {
owner = "CISOfy";
repo = "${pname}";
rev = "${version}";
sha256 = "0q8irq7hmb0nalmc8xn13d08j0qf6sxfiq2c9s7z1c0gd357gmh9";
};
nativeBuildInputs = [ makeWrapper perl ];
postPatch = ''
grep -rl '/usr/local/lynis' ./ | xargs sed -i "s@/usr/local/lynis@$out/share/lynis@g"
# Don't use predefined binary paths. See https://github.com/CISOfy/lynis/issues/468
perl -i -p0e 's/BIN_PATHS="[^"]*"/BIN_PATHS=\$\(echo \$PATH\ | sed "s\/:\/ \/g")/sm;' include/consts
'';
installPhase = ''
mkdir -p $out/share/lynis
cp -r include db default.prf $out/share/lynis/
mkdir -p $out/bin
cp -a lynis $out/bin
wrapProgram "$out/bin/lynis" --prefix PATH : ${stdenv.lib.makeBinPath [ gawk ]}
'';
meta = with stdenv.lib; {
description = "Security auditing tool for Linux, macOS, and UNIX-based systems";
homepage = "https://cisofy.com/lynis/";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = [ maintainers.ryneeverett ];
};
}