commit:     8e79ec3b1dd7b76c25cf1154aa500a00fcc73881
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 10 16:48:00 2023 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Fri Nov 10 16:48:18 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e79ec3b

app-admin/ocsinventory-agent: new package, add 2.10.0

Bug: https://bugs.gentoo.org/213443
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 app-admin/ocsinventory-agent/Manifest              |  1 +
 app-admin/ocsinventory-agent/files/modules.conf    | 10 ++++
 .../files/ocsinventory-agent.cfg                   |  1 +
 .../files/ocsinventory-agent.crond                 |  1 +
 .../files/ocsinventory-agent.service               | 10 ++++
 .../files/ocsinventory-agent.timer                 | 11 +++++
 app-admin/ocsinventory-agent/metadata.xml          |  7 +++
 .../ocsinventory-agent-2.10.0.ebuild               | 54 ++++++++++++++++++++++
 8 files changed, 95 insertions(+)

diff --git a/app-admin/ocsinventory-agent/Manifest 
b/app-admin/ocsinventory-agent/Manifest
new file mode 100644
index 000000000000..6c6c3a4cc23d
--- /dev/null
+++ b/app-admin/ocsinventory-agent/Manifest
@@ -0,0 +1 @@
+DIST Ocsinventory-Unix-Agent-2.10.0.tar.gz 2319357 BLAKE2B 
5a4a403d90dc68f95ac8b1efb22b3d4fe700a6a819aea44c991f13346c2aacb0fef2f63e9cc83607054e8b7518d48c11c431e0245fa91dc20ad0c4cafcd46cf3
 SHA512 
61881caaebd869abf39ebe641feb6dfceb31cfc64b2208de4be7ddf6923c2c7382b0832bb932a6378d32ffb0d5969e0ebb8d976ac09e2493c0ac5ffd938bd2e8

diff --git a/app-admin/ocsinventory-agent/files/modules.conf 
b/app-admin/ocsinventory-agent/files/modules.conf
new file mode 100644
index 000000000000..7e3eb3fed7f6
--- /dev/null
+++ b/app-admin/ocsinventory-agent/files/modules.conf
@@ -0,0 +1,10 @@
+# this list of module will be loaded by the agent at run time
+# to check its syntax do:
+# $perl modules.conf
+# You must have NO error. Else the content will be ignored
+
+use Ocsinventory::Agent::Modules::Download;
+use Ocsinventory::Agent::Modules::Snmp;
+
+# DO NO REMOVE the 1;
+1;

diff --git a/app-admin/ocsinventory-agent/files/ocsinventory-agent.cfg 
b/app-admin/ocsinventory-agent/files/ocsinventory-agent.cfg
new file mode 100644
index 000000000000..30dec1a71c4f
--- /dev/null
+++ b/app-admin/ocsinventory-agent/files/ocsinventory-agent.cfg
@@ -0,0 +1 @@
+server=servername.yourdomain.com

diff --git a/app-admin/ocsinventory-agent/files/ocsinventory-agent.crond 
b/app-admin/ocsinventory-agent/files/ocsinventory-agent.crond
new file mode 100644
index 000000000000..66cb83335b7d
--- /dev/null
+++ b/app-admin/ocsinventory-agent/files/ocsinventory-agent.crond
@@ -0,0 +1 @@
+43 2 * * * root /usr/bin/ocsinventory-agent --lazy > /dev/null 2>&1

diff --git a/app-admin/ocsinventory-agent/files/ocsinventory-agent.service 
b/app-admin/ocsinventory-agent/files/ocsinventory-agent.service
new file mode 100644
index 000000000000..daf311e98c8a
--- /dev/null
+++ b/app-admin/ocsinventory-agent/files/ocsinventory-agent.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Cron job for OCS-Inventory agent
+After=network.target
+
+[Service]
+User=root
+ExecStart=/usr/bin/ocsinventory-agent --lazy
+
+[Install]
+WantedBy=multi-user.target

diff --git a/app-admin/ocsinventory-agent/files/ocsinventory-agent.timer 
b/app-admin/ocsinventory-agent/files/ocsinventory-agent.timer
new file mode 100644
index 000000000000..01dd060c8960
--- /dev/null
+++ b/app-admin/ocsinventory-agent/files/ocsinventory-agent.timer
@@ -0,0 +1,11 @@
+[Unit]
+Description=Launch audit
+
+[Timer]
+OnCalendar=daily
+AccuracySec=1h
+RandomizedDelaySec=240
+Persistent=true
+
+[Install]
+WantedBy=timers.target

diff --git a/app-admin/ocsinventory-agent/metadata.xml 
b/app-admin/ocsinventory-agent/metadata.xml
new file mode 100644
index 000000000000..572c7daf2ccf
--- /dev/null
+++ b/app-admin/ocsinventory-agent/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>pa...@gentoo.org</email>
+       </maintainer>
+</pkgmetadata>

diff --git a/app-admin/ocsinventory-agent/ocsinventory-agent-2.10.0.ebuild 
b/app-admin/ocsinventory-agent/ocsinventory-agent-2.10.0.ebuild
new file mode 100644
index 000000000000..68cdbc95dde1
--- /dev/null
+++ b/app-admin/ocsinventory-agent/ocsinventory-agent-2.10.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit perl-module systemd
+
+DESCRIPTION="Hardware and software inventory tool (client)"
+HOMEPAGE="http://www.ocsinventory-ng.org 
https://github.com/OCSInventory-NG/UnixAgent";
+SRC_URI="https://github.com/OCSInventory-NG/UnixAgent/releases/download/v${PV}/Ocsinventory-Unix-Agent-${PV}.tar.gz";
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="
+       dev-perl/Crypt-SSLeay
+       dev-perl/Net-IP
+       dev-perl/Net-SNMP
+       dev-perl/Net-SSLeay
+       dev-perl/Proc-Daemon
+       dev-perl/XML-NamespaceSupport
+       dev-perl/XML-SAX
+       dev-perl/XML-Simple
+       dev-perl/libwww-perl
+       sys-apps/dmidecode
+       sys-apps/pciutils
+"
+RDEPEND="${DEPEND}"
+BDEPEND=""
+
+S="${WORKDIR}/Ocsinventory-Unix-Agent-${PV}"
+
+src_compile() {
+       perl-module_src_compile
+       rm run-postinst || die
+}
+
+src_install() {
+       perl-module_src_install
+
+       keepdir "/var/lib/${PN}"
+       keepdir "/var/log/${PN}"
+
+       insinto /etc/ocsinventory
+       doins "${FILESDIR}/${PN}.cfg"
+       doins "${FILESDIR}/modules.conf"
+
+       insinto /etc/cron.d
+       newins "${FILESDIR}/${PN}.crond" ${PN}
+       systemd_dounit "${FILESDIR}/${PN}".{service,timer}
+
+       insinto /etc/logrotate.d
+       doins "contrib/cron/${PN}.logrotate"
+}

Reply via email to