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
|
|
|
}:
|
|
|
|
|
2018-10-13 00:10:38 +01:00
|
|
|
perlPackages.buildPerlPackage rec {
|
2019-06-20 14:07:56 +01:00
|
|
|
pname = "FusionInventory-Agent";
|
2020-10-29 11:52:26 +00:00
|
|
|
version = "2.6";
|
2017-11-28 07:26:38 +00:00
|
|
|
|
|
|
|
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-11-28 07:26:38 +00:00
|
|
|
|
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 = [];
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = (with perlPackages; [
|
2017-08-10 08:46:29 +01:00
|
|
|
CGI
|
|
|
|
DataStructureUtil
|
|
|
|
FileCopyRecursive
|
|
|
|
HTTPProxy
|
|
|
|
HTTPServerSimple
|
|
|
|
HTTPServerSimpleAuthen
|
|
|
|
IOCapture
|
|
|
|
IOSocketSSL
|
|
|
|
IPCRun
|
|
|
|
JSON
|
2018-07-22 03:03:24 +01:00
|
|
|
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" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|