2018-10-13 00:10:38 +01:00
|
|
|
{ stdenv, lib, fetchurl, perlPackages, nix, dmidecode, pciutils, usbutils, iproute, 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";
|
2017-10-30 15:27:40 +00:00
|
|
|
version = "2.3.21";
|
2017-11-28 07:26:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fusioninventory";
|
|
|
|
repo = "fusioninventory-agent";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "034clffcn0agx85macjgml4lyhvvck7idn94pqd2c77pk6crvw2y";
|
2017-08-10 08:46:29 +01:00
|
|
|
};
|
|
|
|
|
2017-11-28 07:26:38 +00:00
|
|
|
patches = [
|
|
|
|
./remove_software_test.patch
|
|
|
|
# support for os-release file
|
|
|
|
(fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "https://github.com/fusioninventory/fusioninventory-agent/pull/396.diff";
|
2017-11-28 07:26:38 +00:00
|
|
|
sha256 = "0bxrjmff80ab01n23xggci32ajsah6zvcmz5x4hj6ayy6dzwi6jb";
|
|
|
|
})
|
|
|
|
# support for Nix software inventory
|
|
|
|
(fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "https://github.com/fusioninventory/fusioninventory-agent/pull/397.diff";
|
2017-11-28 07:26:38 +00:00
|
|
|
sha256 = "0pyf7mp0zsb3zcqb6yysr1zfp54p9ciwjn1pzayw6s9flmcgrmbw";
|
|
|
|
})
|
|
|
|
];
|
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" \
|
|
|
|
--replace /sbin/ip ${iproute}/sbin/ip
|
|
|
|
substituteInPlace "lib/FusionInventory/Agent/Task/Inventory/Linux/Networks.pm" \
|
|
|
|
--replace /sbin/ip ${iproute}/sbin/ip
|
2017-08-10 08:46:29 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildTools = [];
|
2017-10-30 15:27:40 +00:00
|
|
|
buildInputs = [ makeWrapper ] ++ (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
|
|
|
|
];
|
|
|
|
|
|
|
|
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"
|
2017-11-28 07:26:38 +00:00
|
|
|
wrapProgram "$cur" --prefix PATH : ${lib.makeBinPath [nix dmidecode pciutils usbutils nettools iproute]}
|
2017-10-30 15:27:40 +00:00
|
|
|
fi
|
2017-08-10 08:46:29 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" ];
|
|
|
|
|
|
|
|
meta = with stdenv.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";
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.phile314 ];
|
|
|
|
};
|
|
|
|
}
|