3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/monitoring/fusion-inventory/default.nix

84 lines
1.8 KiB
Nix
Raw Normal View History

2021-03-14 16:05:16 +00:00
{ lib, perlPackages, nix, dmidecode, pciutils, usbutils, iproute2, nettools
2017-10-30 15:27:40 +00:00
, fetchFromGitHub, makeWrapper
2017-08-10 08:46:29 +01: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 08:46:29 +01:00
};
postPatch = ''
2017-08-10 08:46:29 +01:00
patchShebangs bin
2017-10-30 15:27:40 +00:00
substituteInPlace "lib/FusionInventory/Agent/Tools/Linux.pm" \
2021-03-14 16:05:16 +00:00
--replace /sbin/ip ${iproute2}/sbin/ip
2017-10-30 15:27:40 +00:00
substituteInPlace "lib/FusionInventory/Agent/Task/Inventory/Linux/Networks.pm" \
2021-03-14 16:05:16 +00:00
--replace /sbin/ip ${iproute2}/sbin/ip
2017-08-10 08:46:29 +01:00
'';
buildTools = [];
nativeBuildInputs = [ makeWrapper ];
buildInputs = (with perlPackages; [
2017-08-10 08:46:29 +01:00
CGI
DataStructureUtil
FileCopyRecursive
HTTPProxy
HTTPServerSimple
HTTPServerSimpleAuthen
IOCapture
IOSocketSSL
IPCRun
JSON
LWPProtocolHttps
2017-10-30 15:27:40 +00:00
ModuleInstall
2017-08-10 08:46:29 +01:00
NetSNMP
TestCompile
TestDeep
TestException
TestMockModule
TestMockObject
TestNoWarnings
2017-10-30 15:27:40 +00:00
]);
2017-08-10 08:46:29 +01: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 08:46:29 +01: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"
2021-03-14 16:05:16 +00:00
wrapProgram "$cur" --prefix PATH : ${lib.makeBinPath [nix dmidecode pciutils usbutils nettools iproute2]}
2017-10-30 15:27:40 +00:00
fi
2017-08-10 08:46:29 +01:00
done
'';
outputs = [ "out" ];
meta = with lib; {
homepage = "http://www.fusioninventory.org";
2017-08-10 08:46:29 +01: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 08:46:29 +01:00
maintainers = [ maintainers.phile314 ];
};
}