2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, php, gd, libpng, zlib, unzip, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nagios";
|
2020-05-15 21:57:56 +00:00
|
|
|
version = "4.4.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/nagios/nagios-4.x/${pname}-${version}/${pname}-${version}.tar.gz";
|
2020-05-15 21:57:56 +00:00
|
|
|
sha256 = "1x5hb97zbvkm73q53ydp1gwj8nnznm72q9c4rm6ny7phr995l3db";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./nagios.patch ];
|
|
|
|
buildInputs = [ php perl gd libpng zlib unzip ];
|
|
|
|
|
|
|
|
configureFlags = [ "--localstatedir=/var/lib/nagios" ];
|
|
|
|
buildFlags = [ "all" ];
|
2020-09-25 04:45:31 +00:00
|
|
|
CFLAGS = "-ldl";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Do not create /var directories
|
|
|
|
preInstall = ''
|
|
|
|
substituteInPlace Makefile --replace '$(MAKE) install-basic' ""
|
|
|
|
'';
|
|
|
|
installTargets = "install install-config";
|
|
|
|
postInstall = ''
|
|
|
|
# don't make default files use hardcoded paths to commands
|
|
|
|
sed -i 's@command_line *[^ ]*/\([^/]*\) @command_line \1 @' $out/etc/objects/commands.cfg
|
|
|
|
sed -i 's@/usr/bin/@@g' $out/etc/objects/commands.cfg
|
|
|
|
sed -i 's@/bin/@@g' $out/etc/objects/commands.cfg
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) nagios;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A host, service and network monitoring program";
|
|
|
|
homepage = "https://www.nagios.org/";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ immae thoughtpolice relrod ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|