2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, gzip, popt, autoreconfHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, mailutils ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "logrotate";
|
2020-07-18 16:06:22 +00:00
|
|
|
version = "3.17.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "logrotate";
|
|
|
|
repo = "logrotate";
|
|
|
|
rev = version;
|
2020-07-18 16:06:22 +00:00
|
|
|
sha256 = "133k4y24p918v4dva6dh70bdfv13jvwl2vlhq0mybrs3ripvnh4h";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Logrotate wants to access the 'mail' program; to be done.
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i -e 's,[a-z/]\+gzip,${gzip}/bin/gzip,' \
|
|
|
|
-e 's,[a-z/]\+gunzip,${gzip}/bin/gunzip,' configure.ac
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
${lib.optionalString (mailutils != null) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i -e 's,[a-z/]\+mail,${mailutils}/bin/mail,' configure.ac
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
|
|
|
autoreconfPhase = ''
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
buildInputs = [ popt ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://fedorahosted.org/releases/l/o/logrotate/";
|
|
|
|
description = "Rotates and compresses system logs";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = [ lib.maintainers.viric ];
|
|
|
|
platforms = lib.platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|