about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/monit/default.nix
blob: 93fc74f0554d4d89127b0ec1cd1d99502e6d1036 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, stdenv
, fetchurl
, bison
, flex
, zlib
, usePAM ? stdenv.hostPlatform.isLinux
, pam
, useSSL ? true
, openssl
}:

stdenv.mkDerivation rec {
  pname = "monit";
  version = "5.32.0";

  src = fetchurl {
    url = "https://mmonit.com/monit/dist/monit-${version}.tar.gz";
    sha256 = "sha256-EHcFLUxOhIrEfRT5s3dU1GQZrsvoyaB+H4ackU+vMhY=";
  };

  nativeBuildInputs = [ bison flex ];
  buildInputs = [ zlib.dev ] ++
    lib.optionals useSSL [ openssl ] ++
    lib.optionals usePAM [ pam ];

  configureFlags = [
    (lib.withFeature usePAM "pam")
  ] ++ (if useSSL then [
    "--with-ssl-incl-dir=${openssl.dev}/include"
    "--with-ssl-lib-dir=${openssl.out}/lib"
  ] else [
    "--without-ssl"
  ]) ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
    # will need to check both these are true for musl
    "libmonit_cv_setjmp_available=yes"
    "libmonit_cv_vsnprintf_c99_conformant=yes"
  ];

  meta = {
    homepage = "https://mmonit.com/monit/";
    description = "Monitoring system";
    license = lib.licenses.agpl3;
    maintainers = with lib.maintainers; [ raskin wmertens ryantm ];
    platforms = with lib.platforms; linux;
  };
}