depot/third_party/nixpkgs/pkgs/servers/monitoring/nagios/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

77 lines
1.8 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, perl
, php
, gd
, libpng
, openssl
, zlib
, unzip
, nixosTests
, nix-update-script
}:
stdenv.mkDerivation rec {
pname = "nagios";
version = "4.5.0";
src = fetchFromGitHub {
owner = "NagiosEnterprises";
repo = "nagioscore";
rev = "refs/tags/nagios-${version}";
hash = "sha256-km0vB/bopysS7eejDFDKaonXzTzBonIqiw1T+C2lKiQ=";
};
patches = [ ./nagios.patch ];
nativeBuildInputs = [ unzip ];
buildInputs = [
php
perl
gd
libpng
openssl
zlib
];
configureFlags = [
"--localstatedir=/var/lib/nagios"
"--with-ssl=${openssl.dev}"
"--with-ssl-inc=${openssl.dev}/include"
"--with-ssl-lib=${lib.getLib openssl}/lib"
];
buildFlags = [ "all" ];
# 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;
};
updateScript = nix-update-script {
extraArgs = [ "--version-regex" "nagios-(.*)" ];
};
};
meta = {
description = "A host, service and network monitoring program";
homepage = "https://www.nagios.org/";
changelog = "https://github.com/NagiosEnterprises/nagioscore/blob/nagios-${version}/Changelog";
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
mainProgram = "nagios";
maintainers = with lib.maintainers; [ immae thoughtpolice relrod anthonyroussel ];
};
}