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

78 lines
1.8 KiB
Nix
Raw Normal View History

2017-10-30 08:27:40 -07:00
{ stdenv, lib, fetchurl, buildPerlPackage, perlPackages, gnused, nix, dmidecode, pciutils, usbutils, iproute, nettools
, fetchFromGitHub, makeWrapper
2017-08-10 00:46:29 -07:00
}:
buildPerlPackage rec {
name = "FusionInventory-Agent-${version}";
2017-10-30 08:27:40 -07:00
version = "2.3.21";
2017-08-10 00:46:29 -07:00
src = fetchurl {
2017-10-30 08:27:40 -07:00
url = "mirror://cpan/authors/id/G/GB/GBOUGARD/${name}.tar.gz";
sha256 = "0c2ijild03bfw125h2gyaip2mg1jxk72dcanrlx9n6pjh2ay90zh";
2017-08-10 00:46:29 -07:00
};
patches = [ ./remove_software_test.patch ];
postPatch = ''
patchShebangs bin
2017-10-30 08:27:40 -07: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 00:46:29 -07:00
'';
buildTools = [];
2017-10-30 08:27:40 -07:00
buildInputs = [ makeWrapper ] ++ (with perlPackages; [
2017-08-10 00:46:29 -07:00
CGI
DataStructureUtil
FileCopyRecursive
HTTPProxy
HTTPServerSimple
HTTPServerSimpleAuthen
IOCapture
IOSocketSSL
IPCRun
JSON
LWPProtocolhttps
2017-10-30 08:27:40 -07:00
ModuleInstall
2017-08-10 00:46:29 -07:00
NetSNMP
TestCompile
TestDeep
TestException
TestMockModule
TestMockObject
TestNoWarnings
2017-10-30 08:27:40 -07:00
]);
2017-08-10 00:46:29 -07: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 08:27:40 -07:00
if [ -x "$cur" ]; then
sed -e "s|./lib|$out/lib|" -i "$cur"
wrapProgram "$cur" --prefix PATH : ${lib.makeBinPath [nix dmidecode pciutils usbutils nettools]}
fi
2017-08-10 00:46:29 -07:00
done
'';
outputs = [ "out" ];
meta = with stdenv.lib; {
homepage = http://www.fusioninventory.org;
description = "FusionInventory unified Agent for UNIX, Linux, Windows and MacOSX";
license = stdenv.lib.licenses.gpl2;
maintainers = [ maintainers.phile314 ];
};
}