nixpkgs/pkgs/servers/monitoring/fusion-inventory/default.nix

83 lines
1.8 KiB
Nix
Raw Normal View History

2020-10-29 11:52:26 +00:00
{ stdenv, lib, perlPackages, nix, dmidecode, pciutils, usbutils, iproute, nettools
2017-10-30 15:27:40 +00:00
, fetchFromGitHub, makeWrapper
2017-08-10 07:46:29 +00:00
}:
perlPackages.buildPerlPackage rec {
pname = "FusionInventory-Agent";
2020-10-29 11:52:26 +00:00
version = "2.6";
src = fetchFromGitHub {
owner = "fusioninventory";
repo = "fusioninventory-agent";
rev = version;
2020-10-29 11:52:26 +00:00
sha256 = "1hbp5a9m03n6a80xc8z640zs71qhqk4ifafr6fp0vvzzvq097ip2";
2017-08-10 07:46:29 +00:00
};
postPatch = ''
2017-08-10 07:46:29 +00:00
patchShebangs bin
2017-10-30 15:27:40 +00:00
substituteInPlace "lib/FusionInventory/Agent/Tools/Linux.pm" \
--replace /sbin/ip ${iproute}/sbin/ip
substituteInPlace "lib/FusionInventory/Agent/Task/Inventory/Linux/Networks.pm" \
--replace /sbin/ip ${iproute}/sbin/ip
2017-08-10 07:46:29 +00:00
'';
buildTools = [];
2017-10-30 15:27:40 +00:00
buildInputs = [ makeWrapper ] ++ (with perlPackages; [
2017-08-10 07:46:29 +00:00
CGI
DataStructureUtil
FileCopyRecursive
HTTPProxy
HTTPServerSimple
HTTPServerSimpleAuthen
IOCapture
IOSocketSSL
IPCRun
JSON
LWPProtocolHttps
2017-10-30 15:27:40 +00:00
ModuleInstall
2017-08-10 07:46:29 +00:00
NetSNMP
TestCompile
TestDeep
TestException
TestMockModule
TestMockObject
TestNoWarnings
2017-10-30 15:27:40 +00:00
]);
2017-08-10 07:46:29 +00:00
propagatedBuildInputs = with perlPackages; [
FileWhich
LWP
NetIP
TextTemplate
UNIVERSALrequire
XMLTreePP
];
2020-10-29 11:52:26 +00:00
# Test fails due to "Argument list too long"
doCheck = false;
2017-08-10 07:46:29 +00:00
installPhase = ''
mkdir -p $out
cp -r bin $out
cp -r lib $out
for cur in $out/bin/*; do
2017-10-30 15:27:40 +00:00
if [ -x "$cur" ]; then
sed -e "s|./lib|$out/lib|" -i "$cur"
wrapProgram "$cur" --prefix PATH : ${lib.makeBinPath [nix dmidecode pciutils usbutils nettools iproute]}
2017-10-30 15:27:40 +00:00
fi
2017-08-10 07:46:29 +00:00
done
'';
outputs = [ "out" ];
meta = with lib; {
homepage = "http://www.fusioninventory.org";
2017-08-10 07:46:29 +00:00
description = "FusionInventory unified Agent for UNIX, Linux, Windows and MacOSX";
2021-01-15 07:07:56 +00:00
license = lib.licenses.gpl2;
2017-08-10 07:46:29 +00:00
maintainers = [ maintainers.phile314 ];
};
}