From 1b1607427380b1026357b1b2934ae3fdcd6c9c27 Mon Sep 17 00:00:00 2001 From: liberodark Date: Wed, 4 Dec 2024 13:45:43 +0100 Subject: [PATCH] glpi-agent: init at 1.11 --- pkgs/by-name/gl/glpi-agent/package.nix | 125 +++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 pkgs/by-name/gl/glpi-agent/package.nix diff --git a/pkgs/by-name/gl/glpi-agent/package.nix b/pkgs/by-name/gl/glpi-agent/package.nix new file mode 100644 index 00000000000000..5d08a3603936f5 --- /dev/null +++ b/pkgs/by-name/gl/glpi-agent/package.nix @@ -0,0 +1,125 @@ +{ + lib, + perlPackages, + nix, + dmidecode, + pciutils, + usbutils, + iproute2, + nettools, + fetchFromGitHub, + makeWrapper, +}: + +perlPackages.buildPerlPackage rec { + pname = "GLPI-Agent"; + version = "1.11"; + + src = fetchFromGitHub { + owner = "glpi-project"; + repo = "glpi-agent"; + tag = version; + hash = "sha256-WdQ+/ZnMCRqLZK64oJNoR9dtMPq+CghsA8NUwt3EpjA="; + }; + + postPatch = '' + patchShebangs bin + + substituteInPlace "lib/GLPI/Agent/Tools/Linux.pm" \ + --replace /sbin/ip ${iproute2}/sbin/ip + substituteInPlace "lib/GLPI/Agent/Task/Inventory/Linux/Networks.pm" \ + --replace /sbin/ip ${iproute2}/sbin/ip + ''; + + buildTools = [ ]; + nativeBuildInputs = [ makeWrapper ]; + buildInputs = ( + with perlPackages; + [ + CGI + DataStructureUtil + FileCopyRecursive + HTTPProxy + HTTPServerSimple + HTTPServerSimpleAuthen + IOCapture + IOSocketSSL + IPCRun + JSON + LWPProtocolHttps + ModuleInstall + NetSNMP + TestCompile + TestDeep + TestException + TestMockModule + TestMockObject + TestNoWarnings + CpanelJSONXS + XMLLibXML + NetPing + ParallelForkManager + DigestSHA1 + CryptDES + FileCopyRecursive + URIEscapeXS + DateTime + DataUUID + URI + HTTPDaemon + YAML + IOCompress + ] + ); + + propagatedBuildInputs = with perlPackages; [ + FileWhich + LWP + NetIP + TextTemplate + UNIVERSALrequire + XMLTreePP + CompressRawZlib + HTTPDaemon + ProcDaemon + ProcPIDFile + ]; + + # Test fails due to "Argument list too long" + doCheck = false; + + installPhase = '' + mkdir -p $out + + cp -r bin $out + cp -r lib $out + cp -r share $out + + for cur in $out/bin/*; do + if [ -x "$cur" ]; then + sed -e "s|./lib|$out/lib|" -i "$cur" + wrapProgram "$cur" --prefix PATH : ${ + lib.makeBinPath [ + nix + dmidecode + pciutils + usbutils + nettools + iproute2 + ] + } + fi + done + ''; + + outputs = [ "out" ]; + + meta = { + homepage = "https://glpi-project.org/"; + description = "GLPI unified Agent for UNIX, Linux, Windows and MacOSX"; + changelog = "https://github.com/glpi-project/glpi-agent/releases/tag/${version}"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ liberodark ]; + badPlatforms = [ lib.systems.inspect.patterns.isDarwin ]; + }; +}