nixpkgs/pkgs/tools/security/lynis/default.nix
R. RyanTM c3916e3c68 lynis: 2.6.5 -> 2.6.6
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.

<details><summary>Version release notes (from GitHub)</summary>
## Lynis 2.6.6 (2018-07-06)

### Improvements
* New format of changelog (https://keepachangelog.com/en/1.0.0/)
* KRNL-5830 - improved log text about running kernel version

### Fixed
* Under some condition no hostid2 value was reported
* Solved 'extra operand' issue with tr command</details>

These checks were done:

- built on NixOS
- /nix/store/ds1yfrg5q01q8j64yggb3p5ib5crg26c-lynis-2.6.6/bin/lynis passed the binary check.
- /nix/store/ds1yfrg5q01q8j64yggb3p5ib5crg26c-lynis-2.6.6/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.6 with grep in /nix/store/ds1yfrg5q01q8j64yggb3p5ib5crg26c-lynis-2.6.6
- directory tree listing: https://gist.github.com/1539c4e988dbc040136beb3577edd526
- du listing: https://gist.github.com/149b0c5b68a57473edf905b2bb6c03a8
2018-07-07 22:16:57 -07:00

39 lines
1.2 KiB
Nix

{ stdenv, makeWrapper, fetchFromGitHub, gawk, perl }:
stdenv.mkDerivation rec {
pname = "lynis";
version = "2.6.6";
name = "${pname}-${version}";
src = fetchFromGitHub {
owner = "CISOfy";
repo = "${pname}";
rev = "${version}";
sha256 = "02d8nwy78gy07c32c7dk3sl93h1z0gav0h4j7xp85m6xj852lb5a";
};
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 ];
};
}