# $Id$ # Authority: vip-ire # Name: Daniel Berteaud Name: ocsinventory Summary: Open Computer and Software Inventory Next Generation Version: 1.02 Release: 2.rc3%{?dist} Group: Applications/Internet License: GPLv2 URL: http://www.ocsinventory-ng.org/ Source0: OCSNG_UNIX_SERVER_1.02RC3.tar.gz Source1: ocsinventory-reports.conf Source2: ocsinventory-images.tgz Source3: OCSNG_UNIX_SERVER_1.02RC3_Patch1.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: perl(ExtUtils::MakeMaker) # Main package is a dummy package Requires: ocsinventory-server = %{version}-%{release} Requires: ocsinventory-reports = %{version}-%{release} Requires: mysql-server %description Open Computer and Software Inventory Next Generation is an application designed to help a network or system administrator keep track of the computers configuration and software that are installed on the network. OCS Inventory is also able to detect all active devices on your network, such as switch, router, network printer and unattended devices. OCS Inventory NG includes package deployment feature on client computers %description -l fr Open Computer and Software Inventory Next Generation est une application déstinée pour aider l'administrateur système ou réseau à garder un oeil sur la configuration des machines du réseau et sur les logiciels qui y sont installés. OCS Inventory est aussi capable de détecter tout périphérique actif sur le réseau, comme les commutateurs, routeurs, imprimantes et autres matéreils inattendus. OCS Inventory NG intègre des fonctionnalités de télédiffusion de paquets sur les machines clients. %package server Group: Applications/Internet Summary: OCS Inventory NG - Communication server Requires: mod_perl Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: perl(Compress::Zlib) >= 1.33 Requires: perl(DBI) >= 1.40 Requires: perl(Apache::DBI) >= 0.93 Requires: perl(DBD::mysql) >= 2.9004 Requires: perl(XML::Simple) >= 2.12 Requires: perl(Net::IP) >= 1.21 Requires: perl(SOAP::Lite) >= 0.66 Requires: perl(XML::Entities) >= 0.02 %description server This package provides the Communication server, which will handle HTTP communications between database server and agents. %description -l fr server Ce paquet fournit le serveur de communication (Communication server), qui gère les communications HTTP entre les agents et le serveur de base de données. %package reports Group: Applications/Internet Summary: OCS Inventory NG - Communication server Requires: php Requires: perl(DBI) >= 1.40 Requires: perl(DBD::mysql) >= 2.9004 Requires: perl(XML::Simple) >= 2.12 Requires: perl(Net::IP) >= 1.21 %description reports This package provides the Administration console, which will allow administrators to query the database server through their favorite browser. %description -l fr reports Ce paquet fournit la console d'administration (Administration console), qui autorise les administrateurs à interroger la base de données via leur navigateur favori. %prep %setup -q -n OCSNG_UNIX_SERVER_1.02RC3 tar xzf %{SOURCE2} tar xzf %{SOURCE3} # patching doc_root => /var/lib for fic in $(find ocsreports -type f -exec grep -q "DOCUMENT_ROOT" {} \; -print) do %{__sed} -i -e 's;\$_SERVER\["DOCUMENT_ROOT"\];"%{_localstatedir}/lib/ocsinventory-server";' $fic done %build cd Apache %{__perl} Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install rm -rf %{buildroot} # --- ocsinventory-server --- communication server cd Apache make pure_install PERL_INSTALL_ROOT=%{buildroot} find %{buildroot} -type f -name .packlist -exec rm -f {} ';' find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';' chmod -R u+rwX,go+rX,go-w %{buildroot}/* find %{buildroot}%{perl_vendorlib}/Apache -name \*.pm -exec chmod -x {} \; %if 0%{?rhel} == 4 # To avoid bad dependency on perl(mod_perl2) rm -f %{buildroot}%{perl_vendorlib}/Apache/Ocsinventory/Server/Modperl2.pm %else # To avoid bad dependency on perl(mod_perl) : RHEL >= 5 && Fedora >= 4 rm -f %{buildroot}%{perl_vendorlib}/Apache/Ocsinventory/Server/Modperl1.pm %endif %{__mkdir_p} %{buildroot}%{_localstatedir}/log/ocsinventory-server %{__mkdir_p} %{buildroot}%{_sysconfdir}/logrotate.d %{__sed} -e 's;PATH_TO_LOG_DIRECTORY;%{_localstatedir}/log/ocsinventory-server;' \ ./etc/logrotate.d/ocsinventory-server >%{buildroot}%{_sysconfdir}/logrotate.d/ocsinventory-server # default configuration (localhost) sould work on "simple" installation %{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf.d %{__sed} -e "s;DATABASE_SERVER;localhost;g" \ -e "s;DATABASE_PORT;3306;g" \ %if 0%{?rhel} == 4 -e "s;VERSION_MP;1;g" \ %else -e "s;VERSION_MP;2;g" \ %endif -e "s;PATH_TO_LOG_DIRECTORY;%{_localstatedir}/log/ocsinventory-server;g" \ ./etc/ocsinventory/ocsinventory-server.conf >%{buildroot}%{_sysconfdir}/httpd/conf.d/z-ocsinventory-server.conf cd .. # --- ocsinventory-reports --- administration console %{__mkdir_p} %{buildroot}/%{_datadir}/ocsinventory-reports cp -ar ocsreports %{buildroot}/%{_datadir}/ocsinventory-reports find %{buildroot}/%{_datadir}/ocsinventory-reports \( -name \*.php -o -name \*.css \) -exec chmod -x {} \; %{__mkdir_p} %{buildroot}/%{_sysconfdir}/ocsinventory/ocsinventory-reports mv %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/dbconfig.inc.php \ %{buildroot}/%{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php ln -s ../../../../%{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/dbconfig.inc.php %{__mkdir_p} %{buildroot}%{_localstatedir}/lib/ocsinventory-server/{download,ipd} %{__install} -pm 755 Apache/binutils/ipdiscover-util.pl %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/ipdiscover-util.pl %{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf.d %{__sed} -e "s;OCSREPORTS_ALIAS;/ocsreports;g" \ -e "s;PATH_TO_OCSREPORTS_DIR;%{_datadir}/ocsinventory-reports/ocsreports;g" \ -e "s;PACKAGES_ALIAS;/download;g" \ -e "s;PATH_TO_PACKAGES_DIR;%{_localstatedir}/lib/ocsinventory-server/download;g" \ %{SOURCE1} >%{buildroot}%{_sysconfdir}/httpd/conf.d/z-ocsinventory-reports.conf %clean rm -rf %{buildroot} %files %defattr(-, root, root, -) %files server %defattr(-, root, root, -) %doc LICENSE.txt README %config(noreplace) %{_sysconfdir}/logrotate.d/ocsinventory-server %config(noreplace) %{_sysconfdir}/httpd/conf.d/z-ocsinventory-server.conf %attr(750,www,root) %{_localstatedir}/log/ocsinventory-server %{perl_vendorlib}/Apache %files reports %defattr(-, root, root, -) %doc LICENSE.txt README %dir %{_sysconfdir}/ocsinventory %dir %{_sysconfdir}/ocsinventory/ocsinventory-reports %attr(640,www,root) %config(noreplace) %{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php %config(noreplace) %{_sysconfdir}/httpd/conf.d/z-ocsinventory-reports.conf %{_datadir}/ocsinventory-reports %dir %{_localstatedir}/lib/ocsinventory-server %attr(750,www,root) %dir %{_localstatedir}/lib/ocsinventory-server/ipd %attr(750,www,root) %dir %{_localstatedir}/lib/ocsinventory-server/download %changelog * Tue Dec 09 2008 Daniel B. 1.02-2.rc1 - Apply patch1 for ocs-inventory 1.02RC3 * Thu Sep 10 2008 Daniel B. 1.02-02.rc1 - small changes for SME server * Sun Mar 15 2008 Remi Collet 1.02-0.2.rc1 - fix download dir * Sat Mar 8 2008 Remi Collet 1.02-0.1.rc1 - Initial RPM