diff --git a/fusioninventory-agent-setup.pm.patch b/fusioninventory-agent-setup.pm.patch new file mode 100644 index 0000000..045dd9d --- /dev/null +++ b/fusioninventory-agent-setup.pm.patch @@ -0,0 +1,41 @@ +diff --git a/bin/setup.pm b/bin/setup.pm +index 3f92279..c7132f0 100644 +--- a/bin/setup.pm ++++ b/bin/setup.pm +@@ -8,30 +8,11 @@ our @EXPORT = ('%setup'); + + our %setup; + +-# From here we can setup @INC so any needed perl module can be found. We add +-# as many 'use lib' directive as needed +-# We could also define '%setup' hash while useful +- +-# Here is a sample working from sources directory or its bin subfolder +-if (-d 'lib') { +- use lib './lib' ; +- +- %setup = ( +- confdir => './etc', +- datadir => './share', +- libdir => './lib', +- vardir => './var', +- ); +- +-} elsif (-d '../lib') { +- use lib '../lib'; +- +- %setup = ( +- confdir => '../etc', +- datadir => '../share', +- libdir => '../lib', +- vardir => '../var', +- ); +-} ++%setup = ( ++ confdir => 'CONFDIR', ++ datadir => 'DATADIR', ++ libdir => 'LIBDIR', ++ vardir => 'VARDIR', ++); + + 1; diff --git a/fusioninventory-agent.spec b/fusioninventory-agent.spec index 7befc84..2a8f85b 100644 --- a/fusioninventory-agent.spec +++ b/fusioninventory-agent.spec @@ -10,12 +10,13 @@ License: GPLv2+ URL: http://fusioninventory.org/ Version: 2.3.19 -Release: 1%{?dist} +Release: 2%{?dist} Source0: https://github.com/fusioninventory/%{name}/releases/download/%{version}/FusionInventory-Agent-%{version}.tar.gz Source1: %{name}.cron #Use systemd override capabilities Source10: %{name}.service Source11: %{name}.service.conf +Patch0: %{name}-setup.pm.patch Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) BuildRequires: perl-generators @@ -151,6 +152,14 @@ FusionInventory agent %prep %setup -q -n FusionInventory-Agent-%{version} +%patch0 -p1 +sed \ + -e "s|CONFDIR|%{_sysconfdir}/fusioninventory|" \ + -e "s|DATADIR|%{_datarootdir}/fusioninventory|" \ + -e "s|LIBDIR|%{_datarootdir}/fusioninventory/lib|" \ + -e "s|VARDIR|%{_sharedstatedir}/fusioninventory|" \ + -i bin/setup.pm + # This work only on older version, and is ignored on recent cat < - 2.3.19-2 +- Fix setup.pm values + * Sat Feb 18 2017 Johan Cwiklinski - 2.3.19-1 - Last upstream release