2021-03-09 03:18:52 +00:00
|
|
|
{ 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 {
|
2023-10-09 19:29:22 +00:00
|
|
|
owner = "fogti";
|
2021-03-09 03:18:52 +00:00
|
|
|
repo = "zs-apc-spdu-ctl";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "TMV9ETWBVeXq6tZ2e0CrvHBXoyKfOLCQurjBdf/iw/M=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2021-03-20 04:20:00 +00:00
|
|
|
buildInputs = [ libowlevelzs net-snmp ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/confent.cxx \
|
2021-03-20 04:20:00 +00:00
|
|
|
--replace /usr/sbin/fping "${fping}/bin/fping"
|
2021-03-09 03:18:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "APC SPDU control utility";
|
|
|
|
license = licenses.mit;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = [ ];
|
2021-03-09 03:18:52 +00:00
|
|
|
platforms = platforms.linux;
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "zs-apc-spdu-ctl";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
}
|