2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl, bison, flex
|
|
|
|
, zlib
|
|
|
|
, usePAM ? stdenv.hostPlatform.isLinux, pam
|
|
|
|
, useSSL ? true, openssl
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-02-05 17:12:51 +00:00
|
|
|
name = "monit-5.27.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${meta.homepage}dist/${name}.tar.gz";
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "sha256-2ICceNXcHtenujKlpVxRFIVRMsxNpIBfjTqvjPRuqkw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ bison flex ];
|
|
|
|
buildInputs = [ zlib.dev ] ++
|
2021-01-15 22:18:51 +00:00
|
|
|
lib.optionals useSSL [ openssl ] ++
|
|
|
|
lib.optionals usePAM [ pam ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2021-01-15 22:18:51 +00:00
|
|
|
(lib.withFeature usePAM "pam")
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ (if useSSL then [
|
|
|
|
"--with-ssl-incl-dir=${openssl.dev}/include"
|
|
|
|
"--with-ssl-lib-dir=${openssl.out}/lib"
|
|
|
|
] else [
|
|
|
|
"--without-ssl"
|
2021-01-15 22:18:51 +00:00
|
|
|
]) ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2020-04-24 23:36:52 +00:00
|
|
|
# will need to check both these are true for musl
|
|
|
|
"libmonit_cv_setjmp_available=yes"
|
|
|
|
"libmonit_cv_vsnprintf_c99_conformant=yes"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://mmonit.com/monit/";
|
|
|
|
description = "Monitoring system";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.agpl3;
|
2021-03-09 03:18:52 +00:00
|
|
|
maintainers = with lib.maintainers; [ raskin wmertens ryantm ];
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = with lib.platforms; linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|