b308c05
# Can, optionaly, be define at build time (see README.RPM)
b308c05
# - ocstag    : administrative tag
b308c05
# - ocsserver : OCS Inventory NG communication serveur
b308c05
b308c05
Name:      ocsinventory-agent
b308c05
Summary:   Open Computer and Software Inventory Next Generation client
b308c05
424991a
Version:   2.0.5
4595180
Release:   6%{?dist}%{?ocstag:.%{ocstag}}
b308c05
c8dd055
Source0:   http://launchpad.net/ocsinventory-unix-agent/stable-2.0/%{version}/+download/Ocsinventory-Unix-Agent-%{version}.tar.gz
b308c05
b308c05
Source1:   %{name}.logrotate
b308c05
Source2:   %{name}.cron
b308c05
b308c05
Source11:   %{name}.README
b308c05
Source12:   %{name}.README.fr
b308c05
5517e23
# Fix ifconfig output parsing on fedora >= 17 #853982
5517e23
# https://bugs.launchpad.net/bugs/1045356
5517e23
# http://bazaar.launchpad.net/~ocsinventory-dev/ocsinventory-unix-agent/trunk/revision/1112
5517e23
# http://bazaar.launchpad.net/~ocsinventory-dev/ocsinventory-unix-agent/trunk/revision/1123
5517e23
# http://bazaar.launchpad.net/~ocsinventory-dev/ocsinventory-unix-agent/trunk/revision/1133
5517e23
# http://bazaar.launchpad.net/~ocsinventory-dev/ocsinventory-unix-agent/trunk/revision/1134
5517e23
Patch0:     %{name}-ifconfig.patch
5517e23
b308c05
Group:     Development/Libraries
e42e57c
License:   GPLv2+
b308c05
URL:       http://www.ocsinventory-ng.org/
b308c05
b308c05
BuildArch: noarch
b308c05
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
b308c05
24e6c03
BuildRequires: perl(Module::Install)
a8875ed
BuildRequires: perl(XML::Simple) perl(LWP) perl(Net::IP)
a8875ed
BuildRequires: perl(Digest::MD5) perl(File::Temp)
a8875ed
b308c05
Requires:  perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
b308c05
Requires:  net-tools, pciutils
b308c05
Requires:  %{_sysconfdir}/logrotate.d, %{_sysconfdir}/cron.hourly
9fb24a7
Requires:  perl(HTTP::Request)
a8875ed
Requires:  perl(Net::SSLeay) perl(Crypt::SSLeay) perl(Net::IP)
b78243a
Requires:  nmap monitor-edid which
24e6c03
Requires:  perl(Proc::Daemon)
b78243a
Requires:  smartmontools
b308c05
# Optionnal : dmidecode on x86, /proc in ppc
b308c05
# Requires:  %{_sbindir}/dmidecode
be3be39
# Optionnal : ipdiscover or nmap, monitor-edid
e42e57c
# Requires: ocsinventory-ipdiscover, nmap, monitor-edid, bridge-utils
5b50a97
Obsoletes: ocsinventory-client < %{version}
5b50a97
Provides:  ocsinventory-client = %{version}-%{release}
b308c05
c8dd055
%{?perl_default_filter}
c8dd055
b308c05
b308c05
%description
b308c05
Open Computer and Software Inventory Next Generation is an application
b308c05
designed to help a network or system administrator keep track of computer
b308c05
configuration and software installed on the network. 
b308c05
b308c05
It also allows deploying softwares, commands or files on Windows and 
b308c05
Linux client computers.
b308c05
b308c05
%{name} provides the client for Linux (Unified Unix Agent).
b308c05
b308c05
b308c05
%description -l fr
b308c05
Open Computer and Software Inventory Next Generation est une application
b308c05
destinée à aider l'administrateur système ou réseau à garder un oeil sur
b308c05
la configuration des machines du réseau et sur les logiciels qui y sont
b308c05
installés. 
b308c05
b308c05
Elle autorise aussi la télédiffusion (ou déploiement) de logiciels, 
b308c05
de commandes ou de fichiers sur les clients Windows ou Linux.
b308c05
b308c05
%{name} fournit le client pour Linux (Agent Unix Unifié)
b308c05
b308c05
b308c05
%prep
c8dd055
%setup -q -n Ocsinventory-Unix-Agent-%{version}
c8dd055
5517e23
%patch0 -p0
5517e23
c8dd055
# avoid rpmlint warning
c8dd055
sed -i -e 's/\r//' lib/Ocsinventory/Agent/Modules/Download.pm
c8dd055
c8dd055
chmod -x lib/Ocsinventory/Agent/Modules/Snmp.pm \
c8dd055
         lib/Ocsinventory/Agent/Modules/Download.pm \
c8dd055
         lib/Ocsinventory/Agent/Hooks.pm \
c8dd055
         lib/Ocsinventory/Agent/Modules/Example.pm
c165f54
b308c05
b308c05
cat <<EOF >%{name}.conf
b308c05
# 
b308c05
# OCS Inventory "Unix Unified Agent" Configuration File
b308c05
# used by hourly cron job
b308c05
#
1e2141d
1e2141d
# Add tools directory if needed (tw_cli, hpacucli, ipssend, ...)
3bd66d9
PATH=/sbin:/bin:/usr/sbin:/usr/bin
1e2141d
b308c05
%if 0%{?ocsserver:1}
b308c05
# Mode, change to "none" to disable
b308c05
OCSMODE[0]=cron
b308c05
5b50a97
# used to override the %{name}.cfg setup.
5b50a97
OCSSERVER[0]=%{ocsserver}
b308c05
%else
b308c05
# Mode, change to "cron" to activate
b308c05
OCSMODE[0]=none
b308c05
b308c05
# can be used to override the %{name}.cfg setup.
0539fc9
# OCSSERVER[0]=your.ocsserver.name
b308c05
# 
b308c05
# corresponds with --local=%{_localstatedir}/lib/%{name}
b308c05
# OCSSERVER[0]=local
5b50a97
%endif
b308c05
b308c05
# Wait before inventory 
b308c05
OCSPAUSE[0]=100
b308c05
b308c05
# Administrative TAG (optional, must be filed before first inventory)
b308c05
OCSTAG[0]=%{?ocstag}
b308c05
EOF
b308c05
b308c05
cat <<EOF >%{name}.cfg
b308c05
# 
b308c05
# OCS Inventory "Unix Unified Agent" Configuration File
b308c05
#
b308c05
# options used by cron job overides this (see /etc/sysconfig/%{name})
b308c05
#
b308c05
b308c05
# Server URL, unconmment if needed
0539fc9
# server = your.ocsserver.name
c165f54
local = %{_localstatedir}/lib/%{name}
b308c05
b308c05
# Administrative TAG (optional, must be filed before first inventory)
b308c05
# tag = your_tag
b308c05
b308c05
# How to log, can be File,Stderr,Syslog
b308c05
logger = Stderr
b308c05
logfile = %{_localstatedir}/log/%{name}/%{name}.log
b308c05
EOF
b308c05
b308c05
cp %{SOURCE11} README.RPM
b308c05
cp %{SOURCE12} README.RPM.fr
b308c05
b308c05
b308c05
%build
b308c05
%{__perl} Makefile.PL INSTALLDIRS=vendor
b308c05
make %{?_smp_mflags}
b308c05
b308c05
b308c05
%install
b308c05
rm -rf %{buildroot}
b308c05
b308c05
make pure_install PERL_INSTALL_ROOT=%{buildroot}
b308c05
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
b308c05
find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';'
b308c05
b308c05
chmod -R u+rwX,go+rX,go-w %{buildroot}/*
b308c05
b308c05
# Move exe to root directory
b308c05
mv %{buildroot}%{_bindir} %{buildroot}%{_sbindir}
b308c05
c8dd055
mkdir -p %{buildroot}%{_localstatedir}/{log,lib}/%{name}
c8dd055
mkdir -p %{buildroot}%{_sysconfdir}/{logrotate.d,sysconfig,cron.hourly,ocsinventory/softwares}
b308c05
c8dd055
install -pm 644 %{SOURCE1}   %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
c8dd055
install -pm 644 %{name}.conf %{buildroot}%{_sysconfdir}/sysconfig/%{name}
b308c05
b308c05
sed -e 's;/etc/;%{_sysconfdir}/;' \
b308c05
    -e 's;/var/;%{_localstatedir}/;' \
b308c05
    -e 's;/usr/sbin/;%{_sbindir}/;' \
b308c05
    %{SOURCE2} > %{buildroot}%{_sysconfdir}/cron.hourly/%{name}
b308c05
chmod +x %{buildroot}%{_sysconfdir}/cron.hourly/%{name}
b308c05
c8dd055
install -m 644 %{name}.cfg %{buildroot}%{_sysconfdir}/ocsinventory/%{name}.cfg
c8dd055
install -m 644 etc/ocsinventory-agent/modules.conf %{buildroot}%{_sysconfdir}/ocsinventory/modules.conf
b308c05
b308c05
# Remove some unusefull files (which brings unresolvable deps)
b308c05
rm -rf %{buildroot}%{perl_vendorlib}/Ocsinventory/Agent/Backend/OS/Win32*
b308c05
b308c05
# Only need for manual installation
c8dd055
rm %{buildroot}%{perl_vendorlib}/Ocsinventory/Unix/postinst.pl
b308c05
c8dd055
# Provided by ocsinventtory-ipdiscover
c8dd055
rm %{buildroot}%{_sbindir}/ipdiscover
b308c05
5b50a97
b308c05
%clean
b308c05
rm -rf %{buildroot}
b308c05
b308c05
b308c05
%files
b308c05
%defattr(-, root, root, -)
b308c05
%doc AUTHORS Changes LICENSE README THANKS README.RPM
c8dd055
%doc etc/ocsinventory-agent/softwares/example.sh
b308c05
%lang(fr) %doc README.RPM.fr
b308c05
%{perl_vendorlib}/Ocsinventory
b308c05
%{_sbindir}/%{name}
b308c05
%dir %{_localstatedir}/log/%{name}
b308c05
%dir %{_localstatedir}/lib/%{name}
b308c05
%dir %{_sysconfdir}/ocsinventory
c8dd055
%dir %{_sysconfdir}/ocsinventory/softwares
b308c05
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
b308c05
%config(noreplace) %{_sysconfdir}/ocsinventory/%{name}.cfg
e42e57c
%config(noreplace) %{_sysconfdir}/ocsinventory/modules.conf
b308c05
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
b308c05
%{_sysconfdir}/cron.hourly/%{name}
e42e57c
%{_mandir}/man1/%{name}*
e42e57c
%{_mandir}/man3/Ocs*
b308c05
b308c05
b308c05
%changelog
4595180
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.5-6
4595180
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
4595180
5b50a97
* Mon Dec 17 2012 Remi Collet <remi@fedoraproject.org> - 2.0.5-5
5b50a97
- fix provided configuration when build with ocsserver defined
5b50a97
5517e23
* Sun Sep 23 2012 Remi Collet <remi@fedoraproject.org> - 2.0.5-4
5517e23
- fix ifconfig output parser (#853982)
5517e23
  https://bugs.launchpad.net/bugs/1045356
5517e23
09fcb52
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.5-3
09fcb52
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
09fcb52
a58593f
* Fri Jun 22 2012 Petr Pisar <ppisar@redhat.com> - 2.0.5-2
a58593f
- Perl 5.16 rebuild
a58593f
424991a
* Sat Apr 14 2012 Remi Collet <remi@fedoraproject.org> - 2.0.5-1
424991a
- update to 2.0.5
424991a
c8dd055
* Mon Feb 13 2012 Remi Collet <remi@fedoraproject.org> - 2.0.4-1
c8dd055
- update to 2.0.4
c8dd055
939c1f8
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2.1-4
939c1f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
939c1f8
Petr Sabata c416ca2
* Wed Jul 20 2011 Petr Sabata <contyk@redhat.com> - 1.1.2.1-3
Petr Sabata c416ca2
- Perl mass rebuild
Petr Sabata c416ca2
4d53387
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2.1-2
4d53387
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
4d53387
e6ae209
* Wed Oct 13 2010 Remi Collet <Fedora@famillecollet.com> 1.1.2.1-1
e6ae209
- security update for CVE-2009-0667
e6ae209
  http://bugs.debian.org/590879
e6ae209
  http://www.debian.org/security/2009/dsa-1828
e6ae209
24e6c03
* Sat Oct 09 2010 Remi Collet <Fedora@famillecollet.com> 1.1.2-3
24e6c03
- remove perl-XML-SAX optional dep, which is broken on EL5
24e6c03
  and cause overload when installed on the OCS server
24e6c03
27860b8
* Tue Jun 01 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.1.2-2
27860b8
- Mass rebuild with perl-5.12.0
27860b8
9fb24a7
* Sun Jan 03 2010 Remi Collet <Fedora@famillecollet.com> 1.1.2-1
9fb24a7
- update to 1.1.2
9fb24a7
a8875ed
* Sun Dec 27 2009 Remi Collet <Fedora@famillecollet.com> 1.1.1-2
a8875ed
- missing perl(Net::IP) requires (+ some EL3 stuff: yes, I know)
a8875ed
52f7d58
* Tue Dec 22 2009 Remi Collet <Fedora@famillecollet.com> 1.1.1-1
52f7d58
- update to 1.1.1
52f7d58
b78243a
* Sat Nov 28 2009 Remi Collet <Fedora@famillecollet.com> 1.1-2
b78243a
- add Requires: which
b78243a
e42e57c
* Sat Nov 07 2009 Remi Collet <Fedora@famillecollet.com> 1.1-1
e42e57c
- update to 1.1
e42e57c
- add missing modules.conf
e42e57c
- new Requires perl(Net::SSLeay), perl(Crypt::SSLeay), smartmontools
e42e57c
- download URL to launchpad
e42e57c
630a0d9
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-5
630a0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
630a0d9
3bd66d9
* Thu May 14 2009 Remi Collet <Fedora@famillecollet.com> 1.0.1-4
3bd66d9
- fix typo
3bd66d9
1e2141d
* Thu May 14 2009 Remi Collet <Fedora@famillecollet.com> 1.0.1-3
1e2141d
- define PATH in config (workaround for #500594 + tool path if needed)
1e2141d
 
0539fc9
* Fri Apr 24 2009 Remi Collet <Fedora@famillecollet.com> 1.0.1-2
0539fc9
- update the README.RPM (new configuration file)
0539fc9
- change from URL to only servername in config comment
0539fc9
63ac38b
* Sun Mar 29 2009 Remi Collet <Fedora@famillecollet.com> 1.0.1-1
63ac38b
- update to 1.0.1
63ac38b
dbc457b
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.9.2-3
dbc457b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
dbc457b
090999d
* Wed Oct 20 2008 Remi Collet <Fedora@famillecollet.com> 0.0.9.2-2
090999d
- fix FTBFS (#465073)
090999d
9f2eba1
* Sun Apr 20 2008 Remi Collet <Fedora@famillecollet.com> 0.0.9.2-1
9f2eba1
- update to 0.0.9.2 (minor bug fix)
9f2eba1
be3be39
* Mon Apr 07 2008 Remi Collet <Fedora@famillecollet.com> 0.0.9.1-2
be3be39
- add Requires monitor-edid
be3be39
f35fbfe
* Thu Apr 03 2008 Remi Collet <Fedora@famillecollet.com> 0.0.9.1-1
f35fbfe
- update to 0.0.9.1 (minor bug fix)
f35fbfe
- swicth back to nobundle sources
f35fbfe
c165f54
* Wed Apr 02 2008 Remi Collet <Fedora@famillecollet.com> 0.0.9-1
c165f54
- update to 0.0.9 finale
c165f54
- provides default config to file (need options.patch)
c165f54
- add requires nmap (for ipdiscover)
c165f54
- add BR perl(XML::SAX) (to avoid install of bundled one)
c165f54
fbe2e9d
* Mon Mar 10 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.6.20080305
fbe2e9d
- rebuild against perl 5.10
fbe2e9d
b308c05
* Fri Mar  7 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.5.20080305
b308c05
- patches from review (Patrice Dumas)
b308c05
b308c05
* Wed Mar  5 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.4.20080305
b308c05
- update to 2008-03-05
b308c05
- add /etc/sysconfig/ocsinventory-agent config file for cron job
b308c05
b308c05
* Mon Mar  3 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.3.20080302
b308c05
- only enable cron when server is configured
b308c05
b308c05
* Sun Mar  2 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.2.20080302
b308c05
- from Review, see #435593
b308c05
b308c05
* Sun Mar  2 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.1.20080302
b308c05
- update to 0.0.8.2 from CVS
b308c05
b308c05
* Fri Feb 22 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.1.20080222
b308c05
- update to 0.0.8.2 from CVS
b308c05
b308c05
* Sun Feb 17 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.1-0.1.20080217
b308c05
- update to 0.0.8.1 from CVS
b308c05
- change config file used
b308c05
   from /etc/ocsinventory-agent/ocsinv.conf 
b308c05
     to /etc/ocsinventory/ocsinventory-agent.cfg
b308c05
b308c05
* Sat Jan 26 2008 Remi Collet <Fedora@famillecollet.com> 0.0.7-1
b308c05
- update to 0.0.7
b308c05
b308c05
* Sat Dec 28 2007 Remi Collet <Fedora@famillecollet.com> 0.0.6.2-1
b308c05
- update to 0.0.6.2
b308c05
b308c05
* Mon Apr 16 2007 Remi Collet <Fedora@famillecollet.com> 0.0.6-1
b308c05
- update to 0.0.6
b308c05
b308c05
* Sat Feb 10 2007 Remi Collet <Fedora@famillecollet.com> 0.0.5-0.20070409
b308c05
- cvs update 20070409
b308c05
- create cron.daily file
b308c05
- create logrotate.d file
b308c05
- create ocsinv.conf
b308c05
- cvs update 20070405
b308c05
- cvs update 20070403
b308c05
b308c05
* Sat Feb 10 2007 Remi Collet <Fedora@famillecollet.com> 0.0.2-0.20070210
b308c05
- initial spec