2012-12-04 07:53:55 +04:00
|
|
|
%if %{_use_internal_dependency_generator}
|
|
|
|
%define __noautoreq 'perl\\(Win32(.*)\\)'
|
|
|
|
%endif
|
2012-02-01 21:03:24 +04:00
|
|
|
|
|
|
|
Name: fusioninventory-agent
|
2015-02-25 13:22:03 +03:00
|
|
|
Version: 2.3.15
|
2014-10-01 00:38:03 +04:00
|
|
|
Release: 1
|
2015-02-25 13:22:03 +03:00
|
|
|
Summary: Linux agent for GLPI
|
2012-02-01 21:03:24 +04:00
|
|
|
License: GPL
|
|
|
|
Group: System/Servers
|
|
|
|
URL: http://fusioninventory.org/wordpress/
|
|
|
|
Source0: http://search.cpan.org/CPAN/authors/id/F/FU/FUSINV/FusionInventory-Agent-%{version}.tar.gz
|
|
|
|
Source1: %{name}.init
|
2014-07-28 21:39:24 +04:00
|
|
|
Source2: %{name}-config
|
|
|
|
BuildArch: noarch
|
2014-08-02 00:29:46 +04:00
|
|
|
#Requires: perl-Net-SSLeay
|
|
|
|
Requires: perl(Proc::Daemon) perl(Proc::PID::File)
|
|
|
|
Requires: perl(LWP) perl(Net::IP) perl(HTTP::Status) perl(Net::SSLeay) perl(Crypt::SSLeay)
|
2015-02-25 13:22:03 +03:00
|
|
|
Requires: perl(Archive::Extract)
|
|
|
|
#Requires: perl(Net::CUPS)
|
2014-07-28 21:39:24 +04:00
|
|
|
BuildRequires: perl-devel
|
|
|
|
BuildRequires: perl(Module::Install)
|
|
|
|
BuildRequires: perl(Module::CoreList)
|
2014-08-02 00:29:46 +04:00
|
|
|
Obsoletes: fusioninventory-agent < 2.3
|
|
|
|
|
2012-02-01 21:03:24 +04:00
|
|
|
%description
|
|
|
|
FusionInventory-Agent is an agent for OCS NG & GLPI.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n FusionInventory-Agent-%{version}
|
|
|
|
|
|
|
|
%build
|
2014-07-28 21:39:24 +04:00
|
|
|
%__perl Makefile.PL INSTALLDIRS=vendor PREFIX=/usr SYSCONFDIR=/etc/fusioninventory
|
2012-02-01 21:03:24 +04:00
|
|
|
%make
|
|
|
|
|
|
|
|
%install
|
|
|
|
rm -f run-postinst
|
|
|
|
%makeinstall_std
|
|
|
|
|
|
|
|
install -d -m 755 %{buildroot}%{_sysconfdir}/cron.daily
|
|
|
|
cat > %{buildroot}%{_sysconfdir}/cron.daily/fusioninventory-agent <<EOF
|
|
|
|
#!/bin/sh
|
2012-02-01 23:34:35 +04:00
|
|
|
. /etc/sysconfig/fusioninventory-agent
|
|
|
|
%{_bindir}/fusioninventory-agent --no-ssl-check --server="\${SERVER}" > /dev/null 2>&1
|
2012-02-01 21:03:24 +04:00
|
|
|
EOF
|
|
|
|
chmod 755 %{buildroot}%{_sysconfdir}/cron.daily/fusioninventory-agent
|
|
|
|
|
|
|
|
install -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d
|
|
|
|
cat > %{buildroot}%{_sysconfdir}/logrotate.d/fusioninventory-agent <<EOF
|
|
|
|
%{_localstatedir}/log/%{name}/*.log {
|
|
|
|
compress
|
|
|
|
notifempty
|
|
|
|
missingok
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
|
|
|
|
cat > %{buildroot}%{_sysconfdir}/sysconfig/fusioninventory-agent <<EOF
|
|
|
|
SERVER="localhost"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
install -d -m 755 %{buildroot}%{_initrddir}
|
|
|
|
install -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/fusioninventory-agent
|
|
|
|
|
2014-07-28 21:39:24 +04:00
|
|
|
install -d -m 755 %{buildroot}%{_bindir}
|
|
|
|
install -m 755 %{SOURCE2} %{buildroot}%{_bindir}/%{name}-config
|
|
|
|
|
2012-02-01 21:03:24 +04:00
|
|
|
install -d -m 755 %{buildroot}%{_localstatedir}/log/%{name}
|
|
|
|
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}
|
|
|
|
|
2014-08-02 00:29:46 +04:00
|
|
|
install -d %{buildroot}/%{perl_vendorlib}
|
|
|
|
#install -Dm644 $RPM_BUILD_DIR/FusionInventory-Agent-%{version}/lib/FusionInventory/Agent/* %{buildroot}/%{perl_vendorlib}/FusionInventory/Agent/
|
|
|
|
cp -fr $RPM_BUILD_DIR/FusionInventory-Agent-%{version}/lib/FusionInventory %{buildroot}/%{perl_vendorlib}/
|
|
|
|
|
|
|
|
|
2012-02-01 21:03:24 +04:00
|
|
|
%files
|
2014-07-28 21:39:24 +04:00
|
|
|
%doc README Changes THANKS LICENSE
|
|
|
|
%{_bindir}/fusioninventory-*
|
2012-02-01 21:03:24 +04:00
|
|
|
%{_mandir}/man1/*
|
2014-07-28 21:39:24 +04:00
|
|
|
#{_mandir}/man3/*
|
|
|
|
%{_datadir}/fusioninventory
|
|
|
|
#{_sysconfdir}/fusioniventory/agent.cfg
|
2014-08-02 00:29:46 +04:00
|
|
|
%{perl_vendorlib}/FusionInventory/
|
2014-07-28 21:39:24 +04:00
|
|
|
#{perl_vendorlib}/auto/share/dist/FusionInventory-Agent
|
2012-02-01 21:03:24 +04:00
|
|
|
%{_localstatedir}/log/fusioninventory-agent
|
|
|
|
%{_localstatedir}/lib/fusioninventory-agent
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/fusioninventory-agent
|
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/fusioninventory-agent
|
|
|
|
%config(noreplace) %{_sysconfdir}/cron.daily/fusioninventory-agent
|
2014-07-28 21:39:24 +04:00
|
|
|
%config(noreplace) %{_sysconfdir}/fusioninventory/agent.cfg
|
2015-02-25 13:22:03 +03:00
|
|
|
%{_initrddir}/fusioninventory-agent
|
|
|
|
|
|
|
|
%preun
|
|
|
|
/etc/rc.d/init.d/fusioninventory-agent
|
|
|
|
|
|
|
|
%postin
|