[packages/glpi-agent] Initial
arekm
arekm at pld-linux.org
Thu Apr 2 01:01:01 CEST 2026
commit 27a78d92be18d9e713d2b22a531c6e8a906652ed
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Apr 2 01:00:44 2026 +0200
Initial
glpi-agent-config.patch | 17 ++++
glpi-agent.init | 89 ++++++++++++++++
glpi-agent.spec | 266 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 372 insertions(+)
---
diff --git a/glpi-agent.spec b/glpi-agent.spec
new file mode 100644
index 0000000..86f52db
--- /dev/null
+++ b/glpi-agent.spec
@@ -0,0 +1,266 @@
+Summary: GLPI inventory and management agent
+Summary(pl.UTF-8): Agent inwentaryzacji i zarządzania GLPI
+Name: glpi-agent
+Version: 1.17
+Release: 1
+License: GPL v2
+Group: Applications/System
+Source0: https://github.com/glpi-project/glpi-agent/archive/refs/tags/%{version}.tar.gz
+# Source0-md5: 0729c7bc0d288ac140bf92675b188896
+Source1: %{name}.init
+Patch0: %{name}-config.patch
+URL: https://glpi-project.org/
+# setup.pm is a bundled internal module, not a CPAN dependency
+%define _noautoreq_perl setup
+BuildRequires: perl-devel >= 1:5.8.0
+BuildRequires: rpm-perlprov >= 4.1-13
+BuildRequires: rpmbuild(macros) >= 1.644
+Requires(post,preun): /sbin/chkconfig
+Requires(post,preun,postun): systemd-units >= 38
+Requires: perl(Data::UUID)
+Requires: perl(DateTime)
+Requires: perl(Digest::SHA)
+Requires: perl(File::Which)
+Requires: perl(HTTP::Daemon)
+Requires: perl(IO::Socket::SSL)
+Requires: perl(LWP::UserAgent)
+Requires: perl(Net::IP)
+Requires: perl(Text::Template)
+Requires: perl(UNIVERSAL::require)
+Requires: perl(XML::LibXML)
+Requires: perl(YAML::Tiny)
+Requires: systemd-units >= 38
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+GLPI Agent is an inventory and management agent for the GLPI asset
+management software. It collects hardware and software information
+from the machine it runs on and sends it to a GLPI server.
+
+%description -l pl.UTF-8
+GLPI Agent to agent inwentaryzacji i zarządzania dla oprogramowania do
+zarządzania zasobami GLPI. Zbiera informacje o sprzęcie i
+oprogramowaniu z maszyny, na której działa, i wysyła je do serwera
+GLPI.
+
+%package task-network
+Summary: Network discovery and inventory task for GLPI agent
+Summary(pl.UTF-8): Zadanie wykrywania i inwentaryzacji sieci dla agenta GLPI
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+Requires: perl(Net::SNMP)
+Requires: perl(Thread::Queue)
+
+%description task-network
+This package provides the network discovery and network inventory
+tasks for the GLPI agent. It uses SNMP to scan and inventory network
+devices.
+
+%description task-network -l pl.UTF-8
+Ten pakiet dostarcza zadania wykrywania i inwentaryzacji sieci dla
+agenta GLPI. Używa SNMP do skanowania i inwentaryzacji urządzeń
+sieciowych.
+
+%package task-deploy
+Summary: Software deployment task for GLPI agent
+Summary(pl.UTF-8): Zadanie wdrażania oprogramowania dla agenta GLPI
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+Requires: perl(File::Copy::Recursive)
+Requires: perl(Parallel::ForkManager)
+Requires: perl(URI::Escape)
+
+%description task-deploy
+This package provides the software deployment task for the GLPI agent.
+It allows deploying and updating software packages from the GLPI
+server.
+
+%description task-deploy -l pl.UTF-8
+Ten pakiet dostarcza zadanie wdrażania oprogramowania dla agenta GLPI.
+Pozwala na wdrażanie i aktualizację pakietów oprogramowania z serwera
+GLPI.
+
+%package task-esx
+Summary: VMware ESX inventory task for GLPI agent
+Summary(pl.UTF-8): Zadanie inwentaryzacji VMware ESX dla agenta GLPI
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+
+%description task-esx
+This package provides the VMware ESX inventory task for the GLPI
+agent. It collects inventory data from VMware vCenter/ESX servers.
+
+%description task-esx -l pl.UTF-8
+Ten pakiet dostarcza zadanie inwentaryzacji VMware ESX dla agenta
+GLPI. Zbiera dane inwentaryzacyjne z serwerów VMware vCenter/ESX.
+
+%package task-collect
+Summary: Custom data collection task for GLPI agent
+Summary(pl.UTF-8): Zadanie zbierania niestandardowych danych dla agenta GLPI
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+
+%description task-collect
+This package provides the custom data collection task for the GLPI
+agent. It allows collecting custom data from managed machines.
+
+%description task-collect -l pl.UTF-8
+Ten pakiet dostarcza zadanie zbierania niestandardowych danych dla
+agenta GLPI. Pozwala na zbieranie niestandardowych danych z
+zarządzanych maszyn.
+
+%package task-wakeonlan
+Summary: Wake-on-LAN task for GLPI agent
+Summary(pl.UTF-8): Zadanie Wake-on-LAN dla agenta GLPI
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+
+%description task-wakeonlan
+This package provides the Wake-on-LAN task for the GLPI agent. It
+allows waking up machines using Wake-on-LAN magic packets.
+
+%description task-wakeonlan -l pl.UTF-8
+Ten pakiet dostarcza zadanie Wake-on-LAN dla agenta GLPI. Pozwala na
+budzenie maszyn za pomocą pakietów magicznych Wake-on-LAN.
+
+%prep
+%setup -q
+%patch -P0 -p1
+
+%build
+%{__perl} Makefile.PL \
+ PREFIX=%{_prefix} \
+ SYSCONFDIR=/etc/%{name} \
+ LOCALSTATEDIR=/var/lib/%{name} \
+ INSTALLDIRS=vendor \
+ INSTALLSCRIPT=%{_bindir}
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/%{name}/conf.d,%{systemdunitdir},%{_mandir}/man1,/var/lib/%{name}}
+install -p contrib/unix/%{name}.service $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+
+# Remove Windows-specific files
+%{__rm} -f $RPM_BUILD_ROOT%{_bindir}/glpi-win32-service
+# Remove .new config files created by make install
+%{__rm} -f $RPM_BUILD_ROOT/etc/%{name}/*.cfg.new
+# Remove .packlist
+%{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/GLPI/Agent/.packlist
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/sbin/chkconfig --add %{name}
+%service %{name} restart
+%systemd_post %{name}.service
+if [ "$1" = "1" ]; then
+%banner %{name} <<EOF
+GLPI Agent has been installed. Configure the server URL:
+ Edit /etc/glpi-agent/agent.cfg and set:
+ server = https://your-glpi-server/glpi/
+ Or create a drop-in config:
+ echo "server = https://your-glpi-server/glpi/" > /etc/glpi-agent/conf.d/server.cfg
+ Then restart the agent:
+ service glpi-agent restart
+EOF
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+ %service -q %{name} stop
+ /sbin/chkconfig --del %{name}
+fi
+%systemd_preun %{name}.service
+
+%postun
+%systemd_reload
+
+%files
+%defattr(644,root,root,755)
+%doc Changes LICENSE README.md THANKS
+%attr(754,root,root) /etc/rc.d/init.d/%{name}
+%dir /etc/%{name}
+%dir /etc/%{name}/conf.d
+%config(noreplace) %verify(not md5 mtime size) /etc/%{name}/agent.cfg
+%config(noreplace) %verify(not md5 mtime size) /etc/%{name}/basic-authentication-server-plugin.cfg
+%config(noreplace) %verify(not md5 mtime size) /etc/%{name}/inventory-server-plugin.cfg
+%config(noreplace) %verify(not md5 mtime size) /etc/%{name}/proxy-server-plugin.cfg
+%config(noreplace) %verify(not md5 mtime size) /etc/%{name}/proxy2-server-plugin.cfg
+%config(noreplace) %verify(not md5 mtime size) /etc/%{name}/server-test-plugin.cfg
+%config(noreplace) %verify(not md5 mtime size) /etc/%{name}/snmp-advanced-support.cfg
+%config(noreplace) %verify(not md5 mtime size) /etc/%{name}/ssl-server-plugin.cfg
+%config(noreplace) %verify(not md5 mtime size) /etc/%{name}/toolbox-plugin.cfg
+%attr(755,root,root) %{_bindir}/glpi-agent
+%attr(755,root,root) %{_bindir}/glpi-injector
+%attr(755,root,root) %{_bindir}/glpi-inventory
+%attr(755,root,root) %{_bindir}/glpi-remote
+%{systemdunitdir}/%{name}.service
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}/lib
+%{_datadir}/%{name}/html
+%{_datadir}/%{name}/edid.ids
+%{_datadir}/%{name}/pci.ids
+%{_datadir}/%{name}/usb.ids
+%{_datadir}/%{name}/sysobject.ids
+%dir /var/lib/%{name}
+%{_mandir}/man1/glpi-agent.1*
+%{_mandir}/man1/glpi-injector.1*
+%{_mandir}/man1/glpi-inventory.1*
+%{_mandir}/man1/glpi-remote.1*
+# Task files are in subpackages
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/Collect
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/Collect.pm
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/Deploy
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/Deploy.pm
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/ESX
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/ESX.pm
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/NetDiscovery
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/NetDiscovery.pm
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/NetInventory
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/NetInventory.pm
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/WakeOnLan
+%exclude %{_datadir}/%{name}/lib/GLPI/Agent/Task/WakeOnLan.pm
+
+%files task-network
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/glpi-netdiscovery
+%attr(755,root,root) %{_bindir}/glpi-netinventory
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/NetDiscovery
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/NetDiscovery.pm
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/NetInventory
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/NetInventory.pm
+%{_mandir}/man1/glpi-netdiscovery.1*
+%{_mandir}/man1/glpi-netinventory.1*
+
+%files task-deploy
+%defattr(644,root,root,755)
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/Deploy
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/Deploy.pm
+
+%files task-esx
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/glpi-esx
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/ESX
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/ESX.pm
+%{_mandir}/man1/glpi-esx.1*
+
+%files task-collect
+%defattr(644,root,root,755)
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/Collect
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/Collect.pm
+
+%files task-wakeonlan
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/glpi-wakeonlan
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/WakeOnLan
+%{_datadir}/%{name}/lib/GLPI/Agent/Task/WakeOnLan.pm
+%{_mandir}/man1/glpi-wakeonlan.1*
diff --git a/glpi-agent-config.patch b/glpi-agent-config.patch
new file mode 100644
index 0000000..0a0e1b1
--- /dev/null
+++ b/glpi-agent-config.patch
@@ -0,0 +1,17 @@
+--- glpi-agent-1.17/etc/agent.cfg.orig 2024-01-01 00:00:00.000000000 +0100
++++ glpi-agent-1.17/etc/agent.cfg 2024-01-01 00:00:00.000000000 +0100
+@@ -131,13 +131,13 @@
+ #
+
+ # Logger backend, either Stderr, File or Syslog (Stderr)
+-logger = stderr
++logger = syslog
+ # log file
+ #logfile = /var/log/glpi-agent.log
+ # maximum log file size, in MB
+ #logfile-maxsize = 0
+ # Syslog facility
+-logfacility = LOG_USER
++logfacility = LOG_DAEMON
+ # Use color in the console
+ color = 0
diff --git a/glpi-agent.init b/glpi-agent.init
new file mode 100644
index 0000000..03bf163
--- /dev/null
+++ b/glpi-agent.init
@@ -0,0 +1,89 @@
+#!/bin/sh
+#
+# glpi-agent GLPI Agent (inventory and management)
+#
+# chkconfig: 345 90 10
+# description: GLPI Agent for hardware/software inventory
+# processname: glpi-agent
+#
+### BEGIN INIT INFO
+# Provides: glpi-agent
+# Required-Start: $network $syslog
+# Required-Stop: $network $syslog
+# Default-Start:
+# Default-Stop:
+# Short-Description: GLPI inventory agent
+# Description: GLPI Agent for hardware and software inventory
+### END INIT INFO
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get sysconfig
+[ -f /etc/sysconfig/glpi-agent ] && . /etc/sysconfig/glpi-agent
+
+AGENT=/usr/bin/glpi-agent
+PIDFILE=/var/run/glpi-agent.pid
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/glpi-agent ]; then
+ msg_already_running "GLPI Agent"
+ return
+ fi
+
+ msg_starting "GLPI Agent"
+ daemon --pidfile $PIDFILE $AGENT --daemon $OPTIONS
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/glpi-agent
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/glpi-agent ]; then
+ msg_not_running "GLPI Agent"
+ return
+ fi
+
+ msg_stopping "GLPI Agent"
+ killproc --pidfile $PIDFILE glpi-agent
+ rm -f /var/lock/subsys/glpi-agent
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/glpi-agent ]; then
+ msg_not_running "GLPI Agent"
+ RETVAL=$1
+ return
+ fi
+
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status --pidfile $PIDFILE glpi-agent
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+ exit 3
+ ;;
+esac
+exit $RETVAL
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/glpi-agent.git/commitdiff/27a78d92be18d9e713d2b22a531c6e8a906652ed
More information about the pld-cvs-commit
mailing list