summaryrefslogtreecommitdiff
path: root/pkgs/naemon/default.nix
blob: 080a226d4dfd7ead0894350619ffc78b018da0f9 (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
{ stdenv, mylibs, help2man, monitoring-plugins, autoconf, automake,
  libtool, glib, pkg-config, gperf,
  varDir ? "/var/lib/naemon",
  etcDir ? "/etc/naemon",
  cacheDir ? "/var/cache/naemon",
  logDir ? "/var/log/naemon",
  runDir ? "/run/naemon",
  user   ? "naemon",
  group  ? "naemon"
}:
stdenv.mkDerivation (mylibs.fetchedGithub ./naemon.json // {
  preConfigure = ''
    ./autogen.sh || true
    '';

  configureFlags = [
    "--localstatedir=${varDir}"
    "--sysconfdir=${etcDir}"
    "--with-pkgconfdir=${etcDir}"
    "--with-pluginsdir=${monitoring-plugins}/libexec"
    "--with-tempdir=${cacheDir}"
    "--with-checkresultdir=${cacheDir}/checkresults"
    "--with-logdir=${logDir}"
    "--with-naemon-user=${user}"
    "--with-naemon-group=${group}"
    "--with-lockfile=${runDir}/naemon.pid"
  ];

  preInstall = ''
    substituteInPlace Makefile --replace '$(MAKE) $(AM_MAKEFLAGS) install-exec-hook' ""
  '';

  buildInputs = [ autoconf automake help2man libtool glib pkg-config gperf ];
})