Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glpi-agent: init at 1.11 #361746

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions pkgs/by-name/gl/glpi-agent/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
lib,
perlPackages,
nix,
dmidecode,
pciutils,
usbutils,
iproute2,
nettools,
fetchFromGitHub,
makeWrapper,
versionCheckHook,
nix-update-script,
}:

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-fail "/sbin/ip" $"{iproute2}/sbin/ip"
substituteInPlace lib/GLPI/Agent/Task/Inventory/Linux/Networks.pm \
--replace-fail "/sbin/ip" "${iproute2}/sbin/ip"
'';

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" ];

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";
GaetanLepage marked this conversation as resolved.
Show resolved Hide resolved
};
}
Loading