lol
1{ lib, stdenv, fetchurl, lockfileProgs, perlPackages }:
2
3stdenv.mkDerivation rec {
4 pname = "logcheck";
5 version = "1.3.23";
6 _name = "logcheck_${version}";
7
8 src = fetchurl {
9 url = "mirror://debian/pool/main/l/logcheck/${_name}.tar.xz";
10 sha256 = "sha256-ohiLpUn/9EEsggdLJxiE/2bSXz/bKkGRboF85naFWyk=";
11 };
12
13 prePatch = ''
14 # do not set sticky bit in nix store.
15 substituteInPlace Makefile --replace 2750 0750
16 '';
17
18 preConfigure = ''
19 substituteInPlace src/logtail --replace "/usr/bin/perl" "${perlPackages.perl}/bin/perl"
20 substituteInPlace src/logtail2 --replace "/usr/bin/perl" "${perlPackages.perl}/bin/perl"
21
22 sed -i -e 's|! -f /usr/bin/lockfile|! -f ${lockfileProgs}/bin/lockfile|' \
23 -e 's|^\([ \t]*\)lockfile-|\1${lockfileProgs}/bin/lockfile-|' \
24 -e "s|/usr/sbin/logtail2|$out/sbin/logtail2|" \
25 -e 's|mime-construct|${perlPackages.mimeConstruct}/bin/mime-construct|' \
26 -e 's|\$(run-parts --list "\$dir")|"$dir"/*|' src/logcheck
27 '';
28
29 makeFlags = [
30 "DESTDIR=$(out)"
31 "SBINDIR=sbin"
32 "BINDIR=bin"
33 "SHAREDIR=share/logtail/detectrotate"
34 ];
35
36 meta = with lib; {
37 description = "Mails anomalies in the system logfiles to the administrator";
38 longDescription = ''
39 Mails anomalies in the system logfiles to the administrator.
40
41 Logcheck helps spot problems and security violations in your logfiles automatically and will send the results to you by e-mail.
42 Logcheck was part of the Abacus Project of security tools, but this version has been rewritten.
43 '';
44 homepage = "https://salsa.debian.org/debian/logcheck";
45 license = licenses.gpl2Plus;
46 maintainers = [ maintainers.bluescreen303 ];
47 };
48}