2021-01-14 23:07:56 -08:00
|
|
|
{ lib, stdenv, fetchurl, perl, php, gd, libpng, zlib, unzip, nixosTests }:
|
2006-12-27 16:48:06 -08:00
|
|
|
|
2014-08-19 23:58:50 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "nagios";
|
2020-05-05 19:10:49 -07:00
|
|
|
version = "4.4.6";
|
2006-12-27 16:48:06 -08:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 05:41:18 -07:00
|
|
|
url = "mirror://sourceforge/nagios/nagios-4.x/${pname}-${version}/${pname}-${version}.tar.gz";
|
2020-05-05 19:10:49 -07:00
|
|
|
sha256 = "1x5hb97zbvkm73q53ydp1gwj8nnznm72q9c4rm6ny7phr995l3db";
|
2006-12-27 16:48:06 -08:00
|
|
|
};
|
|
|
|
|
2014-06-21 21:35:09 -07:00
|
|
|
patches = [ ./nagios.patch ];
|
2021-02-20 13:01:53 -08:00
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
buildInputs = [ php perl gd libpng zlib ];
|
2014-06-21 21:35:09 -07:00
|
|
|
|
|
|
|
configureFlags = [ "--localstatedir=/var/lib/nagios" ];
|
2019-10-27 06:03:25 -07:00
|
|
|
buildFlags = [ "all" ];
|
2020-09-10 03:23:11 -07:00
|
|
|
CFLAGS = "-ldl";
|
2014-06-21 21:35:09 -07:00
|
|
|
|
|
|
|
# Do not create /var directories
|
|
|
|
preInstall = ''
|
|
|
|
substituteInPlace Makefile --replace '$(MAKE) install-basic' ""
|
|
|
|
'';
|
2007-01-08 10:55:06 -08:00
|
|
|
installTargets = "install install-config";
|
2019-12-26 04:00:00 -08:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2019-12-30 04:00:00 -08:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) nagios;
|
|
|
|
};
|
2007-11-08 10:17:56 -08:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A host, service and network monitoring program";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://www.nagios.org/";
|
2021-01-14 23:07:56 -08:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ immae thoughtpolice relrod ];
|
2007-11-08 10:17:56 -08:00
|
|
|
};
|
2006-12-27 16:48:06 -08:00
|
|
|
}
|