1{ lib, stdenv, fetchFromGitHub, gzip, popt, autoreconfHook
2, aclSupport ? true, acl
3, nixosTests
4}:
5
6stdenv.mkDerivation rec {
7 pname = "logrotate";
8 version = "3.21.0";
9
10 src = fetchFromGitHub {
11 owner = "logrotate";
12 repo = "logrotate";
13 rev = version;
14 sha256 = "sha256-w86y6bz/nvH/0mIbn2XrSs5KdOM/xadnlZMQZp4LdGQ=";
15 };
16
17 # Logrotate wants to access the 'mail' program; to be done.
18 configureFlags = [
19 "--with-compress-command=${gzip}/bin/gzip"
20 "--with-uncompress-command=${gzip}/bin/gunzip"
21 ];
22
23 nativeBuildInputs = [ autoreconfHook ];
24 buildInputs = [ popt ] ++ lib.optionals aclSupport [ acl ];
25
26 passthru.tests = {
27 nixos-logrotate = nixosTests.logrotate;
28 };
29
30 meta = with lib; {
31 homepage = "https://github.com/logrotate/logrotate";
32 description = "Rotates and compresses system logs";
33 license = licenses.gpl2Plus;
34 maintainers = [ maintainers.viric ];
35 platforms = platforms.all;
36 };
37}