Files
nixpkgs/pkgs/by-name/gl/glpi-agent/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

137 lines
2.6 KiB
Nix

{
lib,
perlPackages,
nix,
dmidecode,
pciutils,
usbutils,
iproute2,
net-tools,
fetchFromGitHub,
makeWrapper,
versionCheckHook,
nix-update-script,
}:
perlPackages.buildPerlPackage rec {
pname = "glpi-agent";
version = "1.15";
src = fetchFromGitHub {
owner = "glpi-project";
repo = "glpi-agent";
tag = version;
hash = "sha256-+zHTlxfkZ1x21ePZUni7lbRJQ/NUDeoZnvOzM+yzG3M=";
};
postPatch = ''
patchShebangs bin
substituteInPlace lib/GLPI/Agent/Tools/Linux.pm \
--replace-fail "/sbin/ip" "${lib.getExe' iproute2 "ip"}"
substituteInPlace lib/GLPI/Agent/Task/Inventory/Linux/Networks.pm \
--replace-fail "/sbin/ip" "${lib.getExe' iproute2 "ip"}"
'';
nativeBuildInputs = [ makeWrapper ];
buildInputs = (
with perlPackages;
[
CGI
CpanelJSONXS
CryptDES
DataStructureUtil
DataUUID
DateTime
DigestSHA1
FileCopyRecursive
HTTPDaemon
HTTPProxy
HTTPServerSimple
HTTPServerSimpleAuthen
IOCapture
IOCompress
IOSocketSSL
IPCRun
JSON
LWPProtocolHttps
ModuleInstall
NetPing
NetSNMP
ParallelForkManager
ParseEDID
TestCompile
TestDeep
TestException
TestMockModule
TestMockObject
TestNoWarnings
URI
URIEscapeXS
XMLLibXML
YAML
]
);
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
net-tools
iproute2
]
}
fi
done
'';
outputs = [ "out" ];
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "GLPI unified Agent for UNIX, Linux, Windows and MacOSX";
homepage = "https://glpi-project.org/";
changelog = "https://github.com/glpi-project/glpi-agent/releases/tag/${src.tag}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ liberodark ];
mainProgram = "glpi-agent";
};
}