2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2023-03-27 19:17:25 +00:00
|
|
|
, darwin
|
2021-09-18 10:52:07 +00:00
|
|
|
, bison
|
|
|
|
, flex
|
2020-04-24 23:36:52 +00:00
|
|
|
, zlib
|
2022-10-30 15:09:59 +00:00
|
|
|
, libxcrypt
|
2021-09-18 10:52:07 +00:00
|
|
|
, usePAM ? stdenv.hostPlatform.isLinux
|
|
|
|
, pam
|
|
|
|
, useSSL ? true
|
|
|
|
, openssl
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-22 07:53:02 +00:00
|
|
|
pname = "monit";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "5.33.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-03-30 09:31:56 +00:00
|
|
|
url = "https://mmonit.com/monit/dist/monit-${version}.tar.gz";
|
2023-03-04 12:14:45 +00:00
|
|
|
sha256 = "sha256-Gs6InAGDRzqdcBYN9lM7tuEzjcE1T1koUHgD4eKoY7U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
nativeBuildInputs = [ bison flex ] ++
|
2023-04-29 16:46:19 +00:00
|
|
|
lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-03-27 19:17:25 +00:00
|
|
|
darwin.apple_sdk.frameworks.DiskArbitration
|
2023-07-15 17:15:38 +00:00
|
|
|
darwin.apple_sdk.frameworks.System
|
2023-03-27 19:17:25 +00:00
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
buildInputs = [ zlib.dev libxcrypt ] ++
|
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 [
|
2021-09-18 10:52:07 +00:00
|
|
|
"--with-ssl-incl-dir=${openssl.dev}/include"
|
2022-04-03 18:54:34 +00:00
|
|
|
"--with-ssl-lib-dir=${lib.getLib openssl}/lib"
|
2021-09-18 10:52:07 +00:00
|
|
|
] 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 = {
|
2021-09-18 10:52:07 +00:00
|
|
|
homepage = "https://mmonit.com/monit/";
|
2020-04-24 23:36:52 +00:00
|
|
|
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 ];
|
2023-03-27 19:17:25 +00:00
|
|
|
platforms = with lib; platforms.linux ++ platforms.darwin;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "monit";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|