aboutsummaryrefslogtreecommitdiff
path: root/modules/pkgs/nagios-plugins-rabbitmq/default.nix
blob: 6ecb2e49236a5874c15583a8f5bcdf1593ffb76d (plain)
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
{ fetchurl
, makeWrapper
, perl
, perlPackages
, stdenv
}:

stdenv.mkDerivation rec {
  version = "2.0.3";
  name = "nagios-plugins-rabbitmq-${version}";

  src = fetchurl {
    url = "https://github.com/nagios-plugins-rabbitmq/nagios-plugins-rabbitmq/archive/${version}.tar.gz";
    sha256 = "1fw40hzvb8sk5ss0hvrgv338lr019d2q9cc9ayy4hvk1c5bh3ljb";
  };

  buildInputs = [
    makeWrapper
    perl
    perlPackages.JSON
    perlPackages.LWPUserAgent
    perlPackages.ModuleBuild
    perlPackages.MonitoringPlugin
    perlPackages.URI
  ];

  buildPhase = "perl Build.PL --prefix=$out; ./Build build";
  installPhase = ''
    ./Build install

    for n in "$out/bin/"*; do
      wrapProgram "$n" --prefix PERL5LIB : "$PERL5LIB"
    done
  '';
}