From 528b508b879ceb21f4ff35df68c8744c5882d273 Mon Sep 17 00:00:00 2001 From: Mathijs Kwik Date: Sat, 25 Aug 2012 11:14:40 +0200 Subject: [PATCH] add logcheck 1.3.15 nixos-module follows soon --- pkgs/tools/system/logcheck/default.nix | 45 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 2 files changed, 49 insertions(+) create mode 100644 pkgs/tools/system/logcheck/default.nix diff --git a/pkgs/tools/system/logcheck/default.nix b/pkgs/tools/system/logcheck/default.nix new file mode 100644 index 000000000000..1c57711940bf --- /dev/null +++ b/pkgs/tools/system/logcheck/default.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchurl, lockfileProgs, perl, mimeConstruct }: + +stdenv.mkDerivation rec { + _name = "logcheck"; + version = "1.3.15"; + name = "${_name}-${version}"; + + src = fetchurl { + url = "mirror://debian/pool/main/l/${_name}/${_name}_${version}.tar.gz"; + sha256 = "1rdrs12hkm5i5yyz89a6cwhf4fzjkbcd4q4zy6sk148aji9lg6xj"; + }; + + preConfigure = '' + substituteInPlace src/logtail --replace "/usr/bin/perl" "${perl}/bin/perl" + substituteInPlace src/logtail2 --replace "/usr/bin/perl" "${perl}/bin/perl" + + sed -i -e 's|! -f /usr/bin/lockfile|! -f ${lockfileProgs}/bin/lockfile|' \ + -e 's|^\([ \t]*\)lockfile-|\1${lockfileProgs}/bin/lockfile-|' \ + -e "s|/usr/sbin/logtail2|$out/sbin/logtail2|" \ + -e 's|mime-construct|${mimeConstruct}/bin/mime-construct|' \ + -e 's|\$(run-parts --list "\$dir")|"$dir"/*|' src/logcheck + ''; + + makeFlags = [ + "DESTDIR=$(out)" + "SBINDIR=sbin" + "BINDIR=bin" + "SHAREDIR=share/logtail/detectrotate" + ]; + + meta = { + description = "Mails anomalies in the system logfiles to the administrator."; + longDescription = '' + Mails anomalies in the system logfiles to the administrator. + + Logcheck helps spot problems and security violations in your logfiles automatically and will send the results to you by e-mail. + Logcheck was part of the Abacus Project of security tools, but this version has been rewritten. + ''; + homepage = http://logcheck.org; + license = "GPLv2"; + + maintainers = [ stdenv.lib.maintainers.bluescreen303 ]; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6ef8f298028c..0987fcfae24b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1000,6 +1000,10 @@ let libtorrent = callPackage ../tools/networking/p2p/libtorrent { }; + logcheck = callPackage ../tools/system/logcheck { + inherit (perlPackages) mimeConstruct; + }; + logrotate = callPackage ../tools/system/logrotate { }; logstalgica = callPackage ../tools/graphics/logstalgica {};