e4b6f10
# Can, optionaly, be define at build time (see README.RPM)
e4b6f10
# - ocstag    : administrative tag
e4b6f10
# - ocsserver : OCS Inventory NG communication serveur
e4b6f10
e4b6f10
Name:      ocsinventory-agent
e4b6f10
Summary:   Open Computer and Software Inventory Next Generation client
e4b6f10
e4b6f10
Version:   0.0.9.2
e4b6f10
Release:   1%{?dist}%{?ocstag:.%{ocstag}}
e4b6f10
e4b6f10
#Source0:   http://search.cpan.org/CPAN/authors/id/G/GO/GONERI/Ocsinventory-Agent-%{version}.tar.gz
e4b6f10
Source0:    http://nana.rulezlan.org/~goneri/ocsinventory-agent/Ocsinventory-Agent-nobundle-%{version}.tar.gz
e4b6f10
e4b6f10
Source1:   %{name}.logrotate
e4b6f10
Source2:   %{name}.cron
e4b6f10
e4b6f10
Source11:   %{name}.README
e4b6f10
Source12:   %{name}.README.fr
e4b6f10
e4b6f10
Patch1:    %{name}-options.patch
e4b6f10
e4b6f10
Group:     Development/Libraries
e4b6f10
License:   GPLv2
e4b6f10
URL:       http://www.ocsinventory-ng.org/
e4b6f10
e4b6f10
BuildArch: noarch
e4b6f10
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
e4b6f10
e4b6f10
BuildRequires: perl(Module::Install) perl(XML::Simple) perl(LWP) perl(Net::IP)
e4b6f10
BuildRequires: perl(Digest::MD5) perl(File::Temp) perl(XML::SAX)
e4b6f10
Requires:  perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
e4b6f10
Requires:  net-tools, pciutils
e4b6f10
Requires:  %{_sysconfdir}/logrotate.d, %{_sysconfdir}/cron.hourly
e4b6f10
Requires:  perl(HTTP::Request)
e4b6f10
Requires:  perl(Proc::Daemon)
e4b6f10
Requires:  nmap
e4b6f10
Requires:  monitor-edid
e4b6f10
# Optionnal : dmidecode on x86, /proc in ppc
e4b6f10
# Requires:  %{_sbindir}/dmidecode
e4b6f10
# Optionnal : ipdiscover or nmap, monitor-edid
e4b6f10
# Requires: ocsinventory-ipdiscover, nmap, monitor-edid
e4b6f10
Obsoletes: ocsinventory-client <= 1.01
e4b6f10
Provides:  ocsinventory-client  = 1.02
e4b6f10
# use the following line when version is strictly above 1.01
e4b6f10
# ocsinventory-client = %{version}-%{release}
e4b6f10
e4b6f10
e4b6f10
%description
e4b6f10
Open Computer and Software Inventory Next Generation is an application
e4b6f10
designed to help a network or system administrator keep track of computer
e4b6f10
configuration and software installed on the network. 
e4b6f10
e4b6f10
It also allows deploying softwares, commands or files on Windows and 
e4b6f10
Linux client computers.
e4b6f10
e4b6f10
%{name} provides the client for Linux (Unified Unix Agent).
e4b6f10
e4b6f10
e4b6f10
%description -l fr
e4b6f10
Open Computer and Software Inventory Next Generation est une application
e4b6f10
destinée à aider l'administrateur système ou réseau à garder un oeil sur
e4b6f10
la configuration des machines du réseau et sur les logiciels qui y sont
e4b6f10
installés. 
e4b6f10
e4b6f10
Elle autorise aussi la télédiffusion (ou déploiement) de logiciels, 
e4b6f10
de commandes ou de fichiers sur les clients Windows ou Linux.
e4b6f10
e4b6f10
%{name} fournit le client pour Linux (Agent Unix Unifié)
e4b6f10
e4b6f10
e4b6f10
%prep
e4b6f10
%setup -q -n Ocsinventory-Agent-%{version}
e4b6f10
e4b6f10
%patch1 -p0
e4b6f10
e4b6f10
cat <<EOF >%{name}.conf
e4b6f10
# 
e4b6f10
# OCS Inventory "Unix Unified Agent" Configuration File
e4b6f10
# used by hourly cron job
e4b6f10
#
e4b6f10
%if 0%{?ocsserver:1}
e4b6f10
# Mode, change to "none" to disable
e4b6f10
OCSMODE[0]=cron
e4b6f10
e4b6f10
%else
e4b6f10
# Mode, change to "cron" to activate
e4b6f10
OCSMODE[0]=none
e4b6f10
e4b6f10
%endif
e4b6f10
e4b6f10
# can be used to override the %{name}.cfg setup.
e4b6f10
# OCSSERVER[0]=http://your.ocsserver.name/ocsinventory
e4b6f10
# 
e4b6f10
# corresponds with --local=%{_localstatedir}/lib/%{name}
e4b6f10
# OCSSERVER[0]=local
e4b6f10
e4b6f10
# Wait before inventory 
e4b6f10
OCSPAUSE[0]=100
e4b6f10
e4b6f10
# Administrative TAG (optional, must be filed before first inventory)
e4b6f10
OCSTAG[0]=%{?ocstag}
e4b6f10
EOF
e4b6f10
e4b6f10
cat <<EOF >%{name}.cfg
e4b6f10
# 
e4b6f10
# OCS Inventory "Unix Unified Agent" Configuration File
e4b6f10
#
e4b6f10
# options used by cron job overides this (see /etc/sysconfig/%{name})
e4b6f10
#
e4b6f10
e4b6f10
%if 0%{?ocsserver:1}
e4b6f10
server = http://%{ocsserver}/ocsinventory
e4b6f10
%else
e4b6f10
# Server URL, unconmment if needed
e4b6f10
# server = http://your.ocsserver.name/ocsinventory
e4b6f10
local = %{_localstatedir}/lib/%{name}
e4b6f10
%endif
e4b6f10
e4b6f10
# Administrative TAG (optional, must be filed before first inventory)
e4b6f10
# tag = your_tag
e4b6f10
e4b6f10
# How to log, can be File,Stderr,Syslog
e4b6f10
logger = Stderr
e4b6f10
logfile = %{_localstatedir}/log/%{name}/%{name}.log
e4b6f10
EOF
e4b6f10
e4b6f10
cp %{SOURCE11} README.RPM
e4b6f10
cp %{SOURCE12} README.RPM.fr
e4b6f10
e4b6f10
e4b6f10
%build
e4b6f10
%{__perl} Makefile.PL INSTALLDIRS=vendor
e4b6f10
make %{?_smp_mflags}
e4b6f10
e4b6f10
e4b6f10
%install
e4b6f10
rm -rf %{buildroot}
e4b6f10
e4b6f10
make pure_install PERL_INSTALL_ROOT=%{buildroot}
e4b6f10
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
e4b6f10
find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';'
e4b6f10
e4b6f10
chmod -R u+rwX,go+rX,go-w %{buildroot}/*
e4b6f10
e4b6f10
# Move exe to root directory
e4b6f10
mv %{buildroot}%{_bindir} %{buildroot}%{_sbindir}
e4b6f10
e4b6f10
%{__mkdir_p} %{buildroot}%{_localstatedir}/{log,lib}/%{name}
e4b6f10
%{__mkdir_p} %{buildroot}%{_sysconfdir}/{logrotate.d,sysconfig,cron.hourly,ocsinventory}
e4b6f10
e4b6f10
%{__install} -pm 644 %{SOURCE1}   %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
e4b6f10
%{__install} -m 644 %{name}.conf %{buildroot}%{_sysconfdir}/sysconfig/%{name}
e4b6f10
e4b6f10
sed -e 's;/etc/;%{_sysconfdir}/;' \
e4b6f10
    -e 's;/var/;%{_localstatedir}/;' \
e4b6f10
    -e 's;/usr/sbin/;%{_sbindir}/;' \
e4b6f10
    %{SOURCE2} > %{buildroot}%{_sysconfdir}/cron.hourly/%{name}
e4b6f10
chmod +x %{buildroot}%{_sysconfdir}/cron.hourly/%{name}
e4b6f10
e4b6f10
%{__install} -m 644 %{name}.cfg %{buildroot}%{_sysconfdir}/ocsinventory/%{name}.cfg
e4b6f10
e4b6f10
# Remove some unusefull files (which brings unresolvable deps)
e4b6f10
rm -rf %{buildroot}%{perl_vendorlib}/Ocsinventory/Agent/Backend/OS/Win32*
e4b6f10
e4b6f10
# Only need for manual installation
e4b6f10
rm %{buildroot}%{perl_vendorlib}/Ocsinventory/postinst.pl
e4b6f10
e4b6f10
e4b6f10
%clean
e4b6f10
rm -rf %{buildroot}
e4b6f10
e4b6f10
e4b6f10
%files
e4b6f10
%defattr(-, root, root, -)
e4b6f10
%doc AUTHORS Changes LICENSE README THANKS README.RPM
e4b6f10
%lang(fr) %doc README.RPM.fr
e4b6f10
%{perl_vendorlib}/Ocsinventory
e4b6f10
%{_sbindir}/%{name}
e4b6f10
%dir %{_localstatedir}/log/%{name}
e4b6f10
%dir %{_localstatedir}/lib/%{name}
e4b6f10
%dir %{_sysconfdir}/ocsinventory
e4b6f10
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
e4b6f10
%config(noreplace) %{_sysconfdir}/ocsinventory/%{name}.cfg
e4b6f10
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
e4b6f10
%{_sysconfdir}/cron.hourly/%{name}
e4b6f10
%{_mandir}/man1/%{name}.*
e4b6f10
e4b6f10
e4b6f10
%changelog
e4b6f10
* Sun Apr 20 2008 Remi Collet <Fedora@famillecollet.com> 0.0.9.2-1
e4b6f10
- update to 0.0.9.2 (minor bug fix)
e4b6f10
e4b6f10
* Mon Apr 07 2008 Remi Collet <Fedora@famillecollet.com> 0.0.9.1-2
e4b6f10
- add Requires monitor-edid
e4b6f10
e4b6f10
* Thu Apr 03 2008 Remi Collet <Fedora@famillecollet.com> 0.0.9.1-1
e4b6f10
- update to 0.0.9.1 (minor bug fix)
e4b6f10
- swicth back to nobundle sources
e4b6f10
e4b6f10
* Wed Apr 02 2008 Remi Collet <Fedora@famillecollet.com> 0.0.9-1
e4b6f10
- update to 0.0.9 finale
e4b6f10
- provides default config to file (need options.patch)
e4b6f10
- add requires nmap (for ipdiscover)
e4b6f10
- add BR perl(XML::SAX) (to avoid install of bundled one)
e4b6f10
e4b6f10
* Mon Mar 10 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.6.20080305
e4b6f10
- rebuild against perl 5.10
e4b6f10
e4b6f10
* Fri Mar  7 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.5.20080305
e4b6f10
- patches from review (Patrice Dumas)
e4b6f10
e4b6f10
* Wed Mar  5 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.4.20080305
e4b6f10
- update to 2008-03-05
e4b6f10
- add /etc/sysconfig/ocsinventory-agent config file for cron job
e4b6f10
e4b6f10
* Mon Mar  3 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.3.20080302
e4b6f10
- only enable cron when server is configured
e4b6f10
e4b6f10
* Sun Mar  2 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.2.20080302
e4b6f10
- from Review, see #435593
e4b6f10
e4b6f10
* Sun Mar  2 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.1.20080302
e4b6f10
- update to 0.0.8.2 from CVS
e4b6f10
e4b6f10
* Fri Feb 22 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.2-0.1.20080222
e4b6f10
- update to 0.0.8.2 from CVS
e4b6f10
e4b6f10
* Sun Feb 17 2008 Remi Collet <Fedora@famillecollet.com> 0.0.8.1-0.1.20080217
e4b6f10
- update to 0.0.8.1 from CVS
e4b6f10
- change config file used
e4b6f10
   from /etc/ocsinventory-agent/ocsinv.conf 
e4b6f10
     to /etc/ocsinventory/ocsinventory-agent.cfg
e4b6f10
e4b6f10
* Sat Jan 26 2008 Remi Collet <Fedora@famillecollet.com> 0.0.7-1
e4b6f10
- update to 0.0.7
e4b6f10
e4b6f10
* Sat Dec 28 2007 Remi Collet <Fedora@famillecollet.com> 0.0.6.2-1
e4b6f10
- update to 0.0.6.2
e4b6f10
e4b6f10
* Mon Apr 16 2007 Remi Collet <Fedora@famillecollet.com> 0.0.6-1
e4b6f10
- update to 0.0.6
e4b6f10
e4b6f10
* Sat Feb 10 2007 Remi Collet <Fedora@famillecollet.com> 0.0.5-0.20070409
e4b6f10
- cvs update 20070409
e4b6f10
- create cron.daily file
e4b6f10
- create logrotate.d file
e4b6f10
- create ocsinv.conf
e4b6f10
- cvs update 20070405
e4b6f10
- cvs update 20070403
e4b6f10
e4b6f10
* Sat Feb 10 2007 Remi Collet <Fedora@famillecollet.com> 0.0.2-0.20070210
e4b6f10
- initial spec