aboutsummaryrefslogtreecommitdiff
path: root/flakes/mypackages/pkgs/cnagios/default.nix
blob: 2b8b0da1a882547d9631cb2ffb9c94c5e8554190 (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
{ stdenv, fetchFromGitHub, perl, ncurses }:
stdenv.mkDerivation (rec {
  version = "3bd27fb-master";
  pname = "cnagios";
  name = "${pname}-${version}";
  src = fetchFromGitHub {
    owner = "dannywarren";
    repo = "cnagios";
    rev = "3bd27fb40e68f61ffd01bea6234b919a667b6fe4";
    sha256 = "0iy5pmlcz6y3if72nav22xqxniiv1v8ywi0927m6s459hkw5n2rb";
    fetchSubmodules = true;
  };
  configureFlags = [
    "--with-etc-dir=/etc/cnagios"
    "--with-var-dir=/var/lib/naemon"
    "--with-status-file=/var/lib/naemon/status.dat"
    "--with-nagios-data=4"
  ];

  prePatch = ''
    sed -i -e "s/-lcurses/-lncurses/" Makefile.in
  '';
  installPhase = ''
    install -dm755 $out/share/doc/cnagios
    install -Dm644 cnagiosrc $out/share/doc/cnagios/
    install -Dm644 cnagios.help $out/share/doc/cnagios/
    install -Dm644 cnagios.pl $out/share/doc/cnagios/
    install -dm755 $out/bin
    install -Dm755 cnagios $out/bin/
  '';
  buildInputs = [ perl ncurses ];
})