2021-09-02 01:53:21 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, bison
|
|
|
|
, flex
|
2018-07-29 22:48:24 +02:00
|
|
|
, zlib
|
2021-09-02 01:53:21 +02:00
|
|
|
, usePAM ? stdenv.hostPlatform.isLinux
|
|
|
|
, pam
|
|
|
|
, useSSL ? true
|
|
|
|
, openssl
|
2018-07-29 22:48:24 +02:00
|
|
|
}:
|
|
|
|
|
2014-05-04 09:51:10 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2021-07-27 16:21:24 +02:00
|
|
|
pname = "monit";
|
2021-09-02 01:53:21 +02:00
|
|
|
version = "5.29.0";
|
2016-09-24 09:42:42 +02:00
|
|
|
|
2014-05-04 09:51:10 +02:00
|
|
|
src = fetchurl {
|
2021-07-27 16:21:24 +02:00
|
|
|
url = "${meta.homepage}dist/monit-${version}.tar.gz";
|
2021-09-02 01:53:21 +02:00
|
|
|
sha256 = "sha256-9mXm3R8mp0tWgomah3k0Fn3islguBIZS7PA2MYR3iF8=";
|
2014-05-04 09:51:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ bison flex ];
|
2018-02-20 17:40:39 +01:00
|
|
|
buildInputs = [ zlib.dev ] ++
|
2021-01-15 10:19:50 +01:00
|
|
|
lib.optionals useSSL [ openssl ] ++
|
|
|
|
lib.optionals usePAM [ pam ];
|
2014-05-04 09:51:10 +02:00
|
|
|
|
2018-07-29 22:48:24 +02:00
|
|
|
configureFlags = [
|
2021-01-15 10:19:50 +01:00
|
|
|
(lib.withFeature usePAM "pam")
|
2018-07-29 22:48:24 +02:00
|
|
|
] ++ (if useSSL then [
|
2021-09-02 01:53:21 +02:00
|
|
|
"--with-ssl-incl-dir=${openssl.dev}/include"
|
|
|
|
"--with-ssl-lib-dir=${openssl.out}/lib"
|
|
|
|
] else [
|
|
|
|
"--without-ssl"
|
2021-01-15 10:19:50 +01:00
|
|
|
]) ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2018-02-20 17:40:39 +01:00
|
|
|
# will need to check both these are true for musl
|
2018-07-29 22:48:24 +02:00
|
|
|
"libmonit_cv_setjmp_available=yes"
|
|
|
|
"libmonit_cv_vsnprintf_c99_conformant=yes"
|
|
|
|
];
|
2009-08-26 18:22:20 +02:00
|
|
|
|
|
|
|
meta = {
|
2021-09-02 01:53:21 +02:00
|
|
|
homepage = "https://mmonit.com/monit/";
|
2009-08-26 18:22:20 +02:00
|
|
|
description = "Monitoring system";
|
2021-01-15 10:19:50 +01:00
|
|
|
license = lib.licenses.agpl3;
|
2021-02-26 20:37:18 +01:00
|
|
|
maintainers = with lib.maintainers; [ raskin wmertens ryantm ];
|
2021-01-15 10:19:50 +01:00
|
|
|
platforms = with lib.platforms; linux;
|
2009-08-26 18:22:20 +02:00
|
|
|
};
|
|
|
|
}
|