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
137f9e2
Version:   1.0.1
137f9e2
Release:   1%{?dist}%{?ocstag:.%{ocstag}}
b308c05
137f9e2
Source0:   http://search.cpan.org/CPAN/authors/id/G/GO/GONERI/Ocsinventory-Agent-%{version}.tar.gz
137f9e2
#Source0:    http://nana.rulezlan.org/~goneri/ocsinventory-agent/Ocsinventory-Agent-nobundle-%{version}.tar.gz
b308c05
b308c05
Source1:   %{name}.logrotate
b308c05
Source2:   %{name}.cron
b308c05
b308c05
Source11:   %{name}.README
b308c05
Source12:   %{name}.README.fr
b308c05
c165f54
Patch1:    %{name}-options.patch
c165f54
b308c05
Group:     Development/Libraries
b308c05
License:   GPLv2
b308c05
URL:       http://www.ocsinventory-ng.org/
b308c05
b308c05
BuildArch: noarch
b308c05
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
b308c05
c165f54
BuildRequires: perl(Module::Install) perl(XML::Simple) perl(LWP) perl(Net::IP)
c165f54
BuildRequires: perl(Digest::MD5) perl(File::Temp) perl(XML::SAX)
b308c05
Requires:  perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
b308c05
Requires:  net-tools, pciutils
b308c05
Requires:  %{_sysconfdir}/logrotate.d, %{_sysconfdir}/cron.hourly
b308c05
Requires:  perl(HTTP::Request)
b308c05
Requires:  perl(Proc::Daemon)
c165f54
Requires:  nmap
be3be39
Requires:  monitor-edid
b308c05
# Optionnal : dmidecode on x86, /proc in ppc
b308c05
# Requires:  %{_sbindir}/dmidecode
be3be39
# Optionnal : ipdiscover or nmap, monitor-edid
b308c05
# Requires: ocsinventory-ipdiscover, nmap, monitor-edid
b308c05
Obsoletes: ocsinventory-client <= 1.01
b308c05
Provides:  ocsinventory-client  = 1.02
b308c05
# use the following line when version is strictly above 1.01
b308c05
# ocsinventory-client = %{version}-%{release}
b308c05
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
c165f54
%setup -q -n Ocsinventory-Agent-%{version}
c165f54
c165f54
%patch1 -p0
b308c05
b308c05
cat <<EOF >%{name}.conf
b308c05
# 
b308c05
# OCS Inventory "Unix Unified Agent" Configuration File
b308c05
# used by hourly cron job
b308c05
#
b308c05
%if 0%{?ocsserver:1}
b308c05
# Mode, change to "none" to disable
b308c05
OCSMODE[0]=cron
b308c05
b308c05
%else
b308c05
# Mode, change to "cron" to activate
b308c05
OCSMODE[0]=none
b308c05
b308c05
%endif
b308c05
b308c05
# can be used to override the %{name}.cfg setup.
b308c05
# OCSSERVER[0]=http://your.ocsserver.name/ocsinventory
b308c05
# 
b308c05
# corresponds with --local=%{_localstatedir}/lib/%{name}
b308c05
# OCSSERVER[0]=local
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
%if 0%{?ocsserver:1}
b308c05
server = http://%{ocsserver}/ocsinventory
b308c05
%else
b308c05
# Server URL, unconmment if needed
b308c05
# server = http://your.ocsserver.name/ocsinventory
c165f54
local = %{_localstatedir}/lib/%{name}
b308c05
%endif
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
b308c05
%{__mkdir_p} %{buildroot}%{_localstatedir}/{log,lib}/%{name}
b308c05
%{__mkdir_p} %{buildroot}%{_sysconfdir}/{logrotate.d,sysconfig,cron.hourly,ocsinventory}
b308c05
b308c05
%{__install} -pm 644 %{SOURCE1}   %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
b308c05
%{__install} -m 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
b308c05
%{__install} -m 644 %{name}.cfg %{buildroot}%{_sysconfdir}/ocsinventory/%{name}.cfg
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
b308c05
rm %{buildroot}%{perl_vendorlib}/Ocsinventory/postinst.pl
b308c05
b308c05
b308c05
%clean
b308c05
rm -rf %{buildroot}
b308c05
b308c05
b308c05
%files
b308c05
%defattr(-, root, root, -)
b308c05
%doc AUTHORS Changes LICENSE README THANKS README.RPM
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
b308c05
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
b308c05
%config(noreplace) %{_sysconfdir}/ocsinventory/%{name}.cfg
b308c05
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
b308c05
%{_sysconfdir}/cron.hourly/%{name}
b308c05
%{_mandir}/man1/%{name}.*
b308c05
b308c05
b308c05
%changelog
137f9e2
* Sun Mar 29 2009 Remi Collet <Fedora@famillecollet.com> 1.0.1-1
137f9e2
- update to 1.0.1
137f9e2
137f9e2
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.9.2-3
137f9e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
137f9e2
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