about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/networking/zs-apc-spdu-ctl/default.nix
blob: 44dc0bdd3a098a497f73f8eb3702cd1faafc19a9 (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
{ cmake
, fetchFromGitHub
, fping
, lib
, libowlevelzs
, net-snmp
, stdenv
}:

# TODO: add a services entry for the /etc/zs-apc-spdu.conf file
stdenv.mkDerivation rec {
  pname = "zs-apc-spdu-ctl";
  version = "0.0.2";

  src = fetchFromGitHub {
    owner = "fogti";
    repo = "zs-apc-spdu-ctl";
    rev = "v${version}";
    sha256 = "TMV9ETWBVeXq6tZ2e0CrvHBXoyKfOLCQurjBdf/iw/M=";
  };

  nativeBuildInputs = [ cmake ];
  buildInputs = [ libowlevelzs net-snmp ];

  postPatch = ''
    substituteInPlace src/confent.cxx \
      --replace /usr/sbin/fping "${fping}/bin/fping"
  '';

  meta = with lib; {
    description = "APC SPDU control utility";
    license = licenses.mit;
    maintainers = [ maintainers.fogti ];
    platforms = platforms.linux;
  };
}