Package Details: fusioninventory-agent-bin 2.6-1

Git Clone URL: https://aur.archlinux.org/fusioninventory-agent-bin.git (read-only, click to copy)
Package Base: fusioninventory-agent-bin
Description: An application for keeping track of the hardware and software
Upstream URL: https://github.com/fusioninventory/fusioninventory-agent
Licenses: GPL
Conflicts: fusioninventory-agent
Provides: fusioninventory-agent
Submitter: mlex
Maintainer: systemofapwne
Last Packager: systemofapwne
Votes: 3
Popularity: 0.35
First Submitted: 2017-08-17 10:08 (UTC)
Last Updated: 2024-12-29 23:45 (UTC)

Latest Comments

systemofapwne commented on 2024-12-29 23:46 (UTC)

Updated the package to reflect the changes proposed below

systemofapwne commented on 2024-12-12 14:32 (UTC) (edited on 2024-12-12 14:33 (UTC) by systemofapwne)

I figured that using

post_install() {
  cpanm --notest --installdeps FusionInventory::Agent
}

in my patch below might not be sufficient. Especially when the ENV is reset, e.g. by running "sudo", it won't find cpanm. In fact, the original package failed before with cpan (note the missing m at the end) when the installation was invoked via sudo.

I worked around this by prepending the perl binary directory to PATH

post_install() {
  export PATH=$PATH:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
  cpanm --notest --installdeps FusionInventory::Agent
}

Alternatively, one could also run /usr/bin/vendor_perl/cpanm --notest --installdeps FusionInventory::Agent

systemofapwne commented on 2024-12-09 14:06 (UTC) (edited on 2024-12-09 14:13 (UTC) by systemofapwne)

Regarding 2): I figured, that the maintainer did not want to make this package rely on other AURs. However by running 'cpan FusionInventory::Agent' in post_install will completely compile fusioninventory-agent from scratch. Besides this making this package redundant, this also sets the default config dir to /usr/share/fusioninventory/etc, which completely skips /etc/fusioninventory.

Using cpanm (cpanminus) instead of cpan solves this: 'cpanm --notest --installdeps FusionInventory::Agent' will only install the depedencies and skips any tests.

Here is a patch, that fixes 1) and 2) of my previous comment:

diff --git a/.INSTALL b/.INSTALL
index 1faedc5..5736d40 100644
--- a/.INSTALL
+++ b/.INSTALL
@@ -1,4 +1,3 @@
 post_install() {
-  cpan install UNIVERSAL::require
-  cpan install FusionInventory::Agent
+  cpanm --notest --installdeps FusionInventory::Agent
 }
diff --git a/PKGBUILD b/PKGBUILD
index 3114256..fbcbd62 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,6 +11,7 @@ provides=('fusioninventory-agent')
 conflicts=('fusioninventory-agent')
 install=.INSTALL
 depends=(
+  'cpanminus'
   'perl>=5.8'
   'perl-module-build'
   'perl-file-which'
@@ -24,11 +25,8 @@ depends=(
   #'perl-proc-daemon'
 )
 source=("https://github.com/fusioninventory/fusioninventory-agent/releases/download/${pkgver}/fusioninventory-agent_${pkgver}-${pkgrel}_all.deb"
-  "agent.cfg"
-)
-md5sums=('6a7599a355f03192cf16ef852bc93944'
-  'eaf2c13c8adb7e57da038f3ae521ab35'
 )
+md5sums=('6a7599a355f03192cf16ef852bc93944')


 package() {
@@ -45,5 +43,5 @@ package() {
   cp -a ${srcdir}/lib/ $pkgdir/usr/lib/
   cp -a ${srcdir}/var/ $pkgdir/var/

-  install -D -m444 ${srcdir}/agent.cfg $pkgdir/etc/fusioninventory/agent.cfg.default
+  install -D -m444 ${srcdir}/usr/share/fusioninventory/etc/agent.cfg $pkgdir/etc/fusioninventory/agent.cfg.default
 }
diff --git a/agent.cfg b/agent.cfg
deleted file mode 100644
index 2e9c50a..0000000
--- a/agent.cfg
+++ /dev/null
@@ -1,118 +0,0 @@
-# fusioninventory agent configuration
-
-# all defined values match default
-# all commented values are examples
-
-
-#
-# Target definition options
-#
-
-# send tasks results to an OCS server
-#server = http://server.domain.com/ocsinventory
-# send tasks results to a FusionInventory for GLPI server
-#server = http://server.domain.com/glpi/plugins/fusioninventory/
-# write tasks results in a directory
-local = /tmp
-
-#
-# Task definition options
-#
-
-# disable software deployment tasks
-#no-task = deploy
-#tasks = inventory,deploy,inventory
-
-#
-# Target scheduling options
-#
-
-# maximum delay before first target, in seconds
-delaytime = 3600
-# do not contact the target before next scheduled time
-lazy = 0
-
-#
-# Inventory task specific options
-#
-
-# do not list local printers
-# no-category = printer
-# allow to scan user home directories
-scan-homedirs = 0
-# allow to scan user profiles
-scan-profiles = 0
-# save the inventory as HTML
-html = 0
-# timeout for inventory modules execution
-backend-collect-timeout = 30
-# always send data to server
-force = 0
-# additional inventory content file
-additional-content =
-
-#
-# Package deployment task specific options
-#
-
-# do not use peer to peer to download files
-no-p2p = 0
-
-#
-# Network options
-#
-
-# proxy address
-proxy =
-# user name for server authentication
-user = glpi
-# password for server authentication
-password = glpi
-# CA certificates directory
-ca-cert-dir =
-# CA certificates file
-ca-cert-file =
-# do not check server SSL certificate
-no-ssl-check = 0
-# connection timeout, in seconds
-timeout = 180
-
-#
-# Web interface options
-#
-
-# disable embedded web server
-no-httpd = 0
-# network interface to listen to
-httpd-ip = 
-# network port to listen to
-httpd-port = 62354
-# trust requests without authentication token
-httpd-trust = 127.0.0.1/32
-
-#
-# Logging options
-#
-
-# Logger backend, either Stderr, File or Syslog (Stderr)
-logger = stderr
-# log file
-#logfile = /var/log/fusioninventory.log
-# maximum log file size, in MB
-#logfile-maxsize = 0
-# Syslog facility
-logfacility = LOG_USER
-# Use color in the console
-color = 0
-
-#
-# Execution mode options
-#
-
-# add given tag to inventory results
-tag = 
-# debug mode
-debug = 2
-
-# time to wait to reload config (0 means no reload, it's default value)
-# conf-reload-interval = 0

systemofapwne commented on 2024-12-05 22:09 (UTC)

I have two comments here:

1) agent.cfg should be updated to the 2.4+ skeleton. It is missing a

include "conf.d/"

at the end, which made my config not work on my arch system, since I put it in the existing /etc/fusioninventory/conf.d folder.

2) Is the post_install hook really required? And if so: Could you at least disable the tests for the modules, that cpan wants to install? When installing this package, cpan locks up on some module tests for like 30+ minutes. Using 'cpan -T <module>' will at least skip the tests. However, I still don't see, why we need cpan call at all: Aren't we installing all dependencies already via PKGBUILD and dropping the "binaries" as they were in the DEB?

FredDeschenes commented on 2020-01-15 14:36 (UTC)

I created a patch to update to 2.5-3 here : https://gist.github.com/FredDeschenes/73dd48cc48c670c37d833283ee62915f