/[smecontribs]/rpms/ocsinventory/contribs7/ocsinventory.spec
ViewVC logotype

Diff of /rpms/ocsinventory/contribs7/ocsinventory.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.2 by slords, Mon Mar 2 23:53:29 2009 UTC Revision 1.3 by slords, Wed Mar 18 14:37:45 2009 UTC
# Line 1  Line 1 
1  # $Id$  # $Id: ocsinventory.spec,v 1.2 2009/03/02 23:53:29 slords Exp $
2  # Authority: vip-ire  # Authority: vip-ire
3  # Name: Daniel Berteaud  # Name: Daniel Berteaud
4    
5    %if %{?fedora}%{?rhel} >= 5
6    %define useselinux 1
7    %else
8    %define useselinux 0
9    %endif
10    
11    %define tarname OCSNG_UNIX_SERVER_1.02RC3
12    
13  Name:        ocsinventory  Name:        ocsinventory
14  Summary:     Open Computer and Software Inventory Next Generation  Summary:     Open Computer and Software Inventory Next Generation
15    
16  Version:     1.02  Version:     1.02
17  Release:     2.rc3%{?dist}  Release:     0.10.rc3%{?dist}.2
18    
19  Group:       Applications/Internet  Group:       Applications/Internet
20  License:     GPLv2  License:     GPLv2
21  URL:         http://www.ocsinventory-ng.org/  URL:         http://www.ocsinventory-ng.org/
22    
23  Source0:     OCSNG_UNIX_SERVER_1.02RC3.tar.gz  Source0:     http://downloads.sourceforge.net/%{name}/%{tarname}.tar.gz
24  Source1:     ocsinventory-reports.conf  Source1:     ocsinventory-reports.conf
25  Source2:     ocsinventory-images.tgz  
26  Source3:     OCSNG_UNIX_SERVER_1.02RC3_Patch1.tar.gz  # Database Schema
27    # http://ocsinventory.svn.sourceforge.net/viewvc/ocsinventory/trunk/server/ocsreports/files/ocsbase.sql?r1=1390&r2=1413&view=patch
28    Patch0:      ocsinventory-r1413.patch
29    # Update Script
30    # http://ocsinventory.svn.sourceforge.net/viewvc/ocsinventory/trunk/server/ocsreports/install.php?r1=1108&r2=1423&view=patch
31    Patch1:      ocsinventory-r1423.patch
32    # Missing Include
33    # http://ocsinventory.svn.sourceforge.net/viewvc/ocsinventory/trunk/server/Apache/Ocsinventory/Server/Inventory.pm?r1=1035&r2=1447&pathrev=1447&sortby=date&view=patch
34    Patch2:      ocsinventory-r1447.patch
35    # Clean XML
36    # http://ocsinventory.svn.sourceforge.net/viewvc/ocsinventory/trunk/server/Apache/Ocsinventory/Interface/Inventory.pm?r1=981&r2=1462&pathrev=1462&sortby=date&view=patch
37    Patch3:      ocsinventory-r1462.patch
38    
39  BuildArch:   noarch  BuildArch:   noarch
40  BuildRoot:   %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)  BuildRoot:   %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
41  BuildRequires: perl(ExtUtils::MakeMaker)  BuildRequires: perl(ExtUtils::MakeMaker)
42    BuildRequires: perl(Apache::DBI)
43    BuildRequires: perl(DBD::mysql)
44    BuildRequires: perl(Net::IP)
45    BuildRequires: perl(XML::Simple)
46    
47  # Main package is a dummy package  # Main package is a dummy package
48  Requires:    ocsinventory-server  = %{version}-%{release}  Requires:    ocsinventory-server  = %{version}-%{release}
# Line 35  computers configuration and software tha Line 58  computers configuration and software tha
58  OCS Inventory is also able to detect all active devices on your network,  OCS Inventory is also able to detect all active devices on your network,
59  such as switch, router, network printer and unattended devices.  such as switch, router, network printer and unattended devices.
60    
61  OCS Inventory NG includes package deployment feature on client computers  OCS Inventory NG includes package deployment feature on client computers.
62    
63    ocsinventory is a metapackage that will install the communication server,
64    the administration console and the database server (MySQL).
65    
66  %description -l fr  %description -l fr
67  Open Computer and Software Inventory Next Generation est une application  Open Computer and Software Inventory Next Generation est une application
68  déstinée pour aider l'administrateur système ou réseau à garder un oeil  destinée à aider l'administrateur système ou réseau à garder un oeil
69  sur la configuration des machines du réseau et sur les logiciels qui y  sur la configuration des machines du réseau et sur les logiciels qui y
70  sont installés.  sont installés.
71    
72  OCS Inventory est aussi capable de détecter tout périphérique actif sur  OCS Inventory est aussi capable de détecter tout périphérique actif sur
73  le réseau, comme les commutateurs, routeurs, imprimantes et autres matéreils  le réseau, comme les commutateurs, routeurs, imprimantes et autres matériels
74  inattendus.  autonomes.
75    
76  OCS Inventory NG intègre des fonctionnalités de télédiffusion de paquets  OCS Inventory NG intègre des fonctionnalités de télédiffusion de paquets
77  sur les machines clients.  sur les machines clients.
78    
79    ocsinventory est un metapaquet qui installera le serveur de communication,
80    la console d'administration et le serveur de base de données (MySQL).
81    
82  %package server  %package server
83  Group:    Applications/Internet  Group:    Applications/Internet
84  Summary:  OCS Inventory NG - Communication server  Summary:  OCS Inventory NG - Communication server
85  Requires: mod_perl  Requires: mod_perl
86    %if 0%{?rhel} != 4
87    # when use with mod_perl2
88    Requires: perl(SOAP::Transport::HTTP2)
89    %endif
90  Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))  Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
91  Requires: perl(Compress::Zlib) >= 1.33  # Required by the original setup script, but not detected automatically :
92  Requires: perl(DBI) >= 1.40  # Apache::DBI drags in DBI
93  Requires: perl(Apache::DBI) >= 0.93  Requires: perl(Apache::DBI)
94  Requires: perl(DBD::mysql) >= 2.9004  Requires: perl(Net::IP)
95  Requires: perl(XML::Simple) >= 2.12  Requires: perl(DBD::mysql)
96  Requires: perl(Net::IP) >= 1.21  # Optional, not detected automatically :
97  Requires: perl(SOAP::Lite) >= 0.66  Requires: perl(SOAP::Lite)
98  Requires: perl(XML::Entities) >= 0.02  Requires: perl(XML::Entities)
99    %if %{useselinux}
100    Requires: policycoreutils
101    %endif
102    
103  %description server  %description server
104  This package provides the Communication server, which will handle HTTP  This package provides the Communication server, which will handle HTTP
# Line 78  de données. Line 113  de données.
113  %package reports  %package reports
114  Group:    Applications/Internet  Group:    Applications/Internet
115  Summary:  OCS Inventory NG - Communication server  Summary:  OCS Inventory NG - Communication server
116    # From PHP_Compat : date, mysql, ereg, pcre, zip, hash, xml, gd, zlib
117  Requires: php  Requires: php
118  Requires: perl(DBI) >= 1.40  Requires: php-mysql php-zip php-gd
119  Requires: perl(DBD::mysql) >= 2.9004  %if 0%{?rhel} == 4
120  Requires: perl(XML::Simple) >= 2.12  Requires:       php-domxml
121  Requires: perl(Net::IP) >= 1.21  %else
122    Requires:       php-xml
123    %endif
124    # Required by the original setup script, but not detected automatically :
125    Requires: perl(DBD::mysql)
126    # Required by ipdiscover-util.pl (nmap and nmblookup)
127    Requires: nmap samba-client
128    %if %{useselinux}
129    Requires: policycoreutils
130    %endif
131    
132  %description reports  %description reports
133  This package provides the Administration console, which will allow  This package provides the Administration console, which will allow
# Line 93  Ce paquet fournit la console d'administr Line 138  Ce paquet fournit la console d'administr
138  qui autorise les administrateurs à interroger la base de données via leur  qui autorise les administrateurs à interroger la base de données via leur
139  navigateur favori.  navigateur favori.
140    
141    
142  %prep  %prep
143  %setup -q -n OCSNG_UNIX_SERVER_1.02RC3  %setup -q -n %{tarname}
144  tar xzf %{SOURCE2}  
145  tar xzf %{SOURCE3}  %patch0 -p2
146    %patch1 -p2
147  # patching doc_root => /var/lib  %patch2 -p2
148  for fic in $(find ocsreports -type f -exec grep -q "DOCUMENT_ROOT" {} \; -print)  %patch3 -p2
149  do  
         %{__sed} -i -e 's;\$_SERVER\["DOCUMENT_ROOT"\];"%{_localstatedir}/lib/ocsinventory-server";' $fic  
 done  
   
150    
151  %build  %build
152  cd Apache  cd Apache
153  %{__perl} Makefile.PL INSTALLDIRS=vendor  %{__perl} Makefile.PL INSTALLDIRS=vendor
154  make %{?_smp_mflags}  make %{?_smp_mflags}
155    
156    
157  %install  %install
158  rm -rf %{buildroot}  rm -rf %{buildroot}
159    
# Line 136  rm -f %{buildroot}%{perl_vendorlib}/Apac Line 180  rm -f %{buildroot}%{perl_vendorlib}/Apac
180  %{__sed} -e 's;PATH_TO_LOG_DIRECTORY;%{_localstatedir}/log/ocsinventory-server;' \  %{__sed} -e 's;PATH_TO_LOG_DIRECTORY;%{_localstatedir}/log/ocsinventory-server;' \
181     ./etc/logrotate.d/ocsinventory-server >%{buildroot}%{_sysconfdir}/logrotate.d/ocsinventory-server     ./etc/logrotate.d/ocsinventory-server >%{buildroot}%{_sysconfdir}/logrotate.d/ocsinventory-server
182    
183  # default configuration (localhost) sould work on "simple" installation  # default configuration (localhost) should work on "simple" installation
184  %{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf.d  %{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf.d
185  %{__sed} -e "s;DATABASE_SERVER;localhost;g" \  %{__sed} -e "s;DATABASE_SERVER;localhost;g" \
186           -e "s;DATABASE_PORT;3306;g" \      -e "s;DATABASE_PORT;3306;g" \
187  %if 0%{?rhel} == 4  %if 0%{?rhel} == 4
188           -e "s;VERSION_MP;1;g" \      -e "s;VERSION_MP;1;g" \
189  %else  %else
190           -e "s;VERSION_MP;2;g" \      -e "s;VERSION_MP;2;g" \
191  %endif  %endif
192           -e "s;PATH_TO_LOG_DIRECTORY;%{_localstatedir}/log/ocsinventory-server;g" \      -e "s;PATH_TO_LOG_DIRECTORY;%{_localstatedir}/log/ocsinventory-server;g" \
193           ./etc/ocsinventory/ocsinventory-server.conf >%{buildroot}%{_sysconfdir}/httpd/conf.d/z-ocsinventory-server.conf      ./etc/ocsinventory/ocsinventory-server.conf | \
194        grep -v IfModule >%{buildroot}%{_sysconfdir}/httpd/conf.d/ocsinventory-server.conf
195  cd ..  cd ..
196    
197  # --- ocsinventory-reports --- administration console  # --- ocsinventory-reports --- administration console
# Line 156  cp -ar ocsreports %{buildroot}/%{_datadi Line 201  cp -ar ocsreports %{buildroot}/%{_datadi
201  find %{buildroot}/%{_datadir}/ocsinventory-reports \( -name \*.php -o -name \*.css \) -exec chmod -x {} \;  find %{buildroot}/%{_datadir}/ocsinventory-reports \( -name \*.php -o -name \*.css \) -exec chmod -x {} \;
202    
203  %{__mkdir_p} %{buildroot}/%{_sysconfdir}/ocsinventory/ocsinventory-reports  %{__mkdir_p} %{buildroot}/%{_sysconfdir}/ocsinventory/ocsinventory-reports
204    
205  mv %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/dbconfig.inc.php \  mv %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/dbconfig.inc.php \
206     %{buildroot}/%{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php     %{buildroot}/%{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php
207  ln -s ../../../../%{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/dbconfig.inc.php  ln -s ../../../../%{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/dbconfig.inc.php
208    
209  %{__mkdir_p} %{buildroot}%{_localstatedir}/lib/ocsinventory-server/{download,ipd}  %{__mkdir_p} %{buildroot}%{_localstatedir}/lib/ocsinventory-reports/{download,ipd}
210    
211  %{__install} -pm 755 Apache/binutils/ipdiscover-util.pl %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/ipdiscover-util.pl  %{__install} -pm 755 Apache/binutils/ipdiscover-util.pl %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/ipdiscover-util.pl
212    
# Line 168  ln -s ../../../../%{_sysconfdir}/ocsinve Line 214  ln -s ../../../../%{_sysconfdir}/ocsinve
214  %{__sed} -e "s;OCSREPORTS_ALIAS;/ocsreports;g" \  %{__sed} -e "s;OCSREPORTS_ALIAS;/ocsreports;g" \
215           -e "s;PATH_TO_OCSREPORTS_DIR;%{_datadir}/ocsinventory-reports/ocsreports;g" \           -e "s;PATH_TO_OCSREPORTS_DIR;%{_datadir}/ocsinventory-reports/ocsreports;g" \
216           -e "s;PACKAGES_ALIAS;/download;g" \           -e "s;PACKAGES_ALIAS;/download;g" \
217           -e "s;PATH_TO_PACKAGES_DIR;%{_localstatedir}/lib/ocsinventory-server/download;g" \           -e "s;PATH_TO_PACKAGES_DIR;%{_localstatedir}/lib/ocsinventory-reports/download;g" \
218      %{SOURCE1} >%{buildroot}%{_sysconfdir}/httpd/conf.d/z-ocsinventory-reports.conf      %{SOURCE1} >%{buildroot}%{_sysconfdir}/httpd/conf.d/ocsinventory-reports.conf
219    
220    
221  %clean  %clean
222  rm -rf %{buildroot}  rm -rf %{buildroot}
223    
224    
225    %post server
226    %if %{useselinux}
227    (
228    # New File context
229    semanage fcontext -a -s system_u -t httpd_log_t -r s0 "%{_localstatedir}/log/ocsinventory-server(/.*)?"
230    # files created by app
231    restorecon -R %{_localstatedir}/log/ocsinventory-server
232    ) &>/dev/null ||:
233    %endif
234    
235    
236    %post reports
237    %if %{useselinux}
238    (
239    # New File context
240    semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_sysconfdir}/ocsinventory/ocsinventory-reports(/.*)?"
241    semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_localstatedir}/lib/ocsinventory-reports(/.*)?"
242    # files created by app
243    restorecon -R %{_sysconfdir}/ocsinventory/ocsinventory-reports
244    restorecon -R %{_localstatedir}/lib/ocsinventory-reports
245    ) &>/dev/null ||:
246    %endif
247    
248    
249    %postun server
250    %if %{useselinux}
251    if [ "$1" -eq "0" ]; then
252        # Remove the File Context
253        semanage fcontext -d "%{_localstatedir}/log/ocsinventory-server(/.*)?" &>/dev/null || :
254    fi
255    %endif
256    
257    
258    %postun reports
259    %if %{useselinux}
260    if [ "$1" -eq "0" ]; then
261        # Remove the File Context
262        semanage fcontext -d "%{_sysconfdir}/ocsinventory/ocsinventory-reports(/.*)?" &>/dev/null ||:
263        semanage fcontext -d "%{_localstatedir}/lib/ocsinventory-reports(/.*)?" &>/dev/null ||:
264    fi
265    %endif
266    
267    
268  %files  %files
269  %defattr(-, root, root, -)  %defattr(-, root, root, -)
270    
# Line 183  rm -rf %{buildroot} Line 273  rm -rf %{buildroot}
273  %defattr(-, root, root, -)  %defattr(-, root, root, -)
274  %doc LICENSE.txt README  %doc LICENSE.txt README
275  %config(noreplace) %{_sysconfdir}/logrotate.d/ocsinventory-server  %config(noreplace) %{_sysconfdir}/logrotate.d/ocsinventory-server
276  %config(noreplace) %{_sysconfdir}/httpd/conf.d/z-ocsinventory-server.conf  %config(noreplace) %{_sysconfdir}/httpd/conf.d/ocsinventory-server.conf
277  %attr(750,www,root) %{_localstatedir}/log/ocsinventory-server  %attr(755,www,root) %{_localstatedir}/log/ocsinventory-server
278  %{perl_vendorlib}/Apache  %{perl_vendorlib}/Apache
279    
280    
# Line 194  rm -rf %{buildroot} Line 284  rm -rf %{buildroot}
284  %dir %{_sysconfdir}/ocsinventory  %dir %{_sysconfdir}/ocsinventory
285  %dir %{_sysconfdir}/ocsinventory/ocsinventory-reports  %dir %{_sysconfdir}/ocsinventory/ocsinventory-reports
286  %attr(640,www,root) %config(noreplace) %{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php  %attr(640,www,root) %config(noreplace) %{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php
287  %config(noreplace) %{_sysconfdir}/httpd/conf.d/z-ocsinventory-reports.conf  %config(noreplace) %{_sysconfdir}/httpd/conf.d/ocsinventory-reports.conf
288  %{_datadir}/ocsinventory-reports  %{_datadir}/ocsinventory-reports
289  %dir %{_localstatedir}/lib/ocsinventory-server  %attr(755,www,root) %dir %{_localstatedir}/lib/ocsinventory-reports
290  %attr(750,www,root) %dir %{_localstatedir}/lib/ocsinventory-server/ipd  %attr(755,www,root) %dir %{_localstatedir}/lib/ocsinventory-reports/ipd
291  %attr(750,www,root) %dir %{_localstatedir}/lib/ocsinventory-server/download  %attr(755,www,root) %dir %{_localstatedir}/lib/ocsinventory-reports/download
292    
293    
294  %changelog  %changelog
295  * Tue Dec 09 2008 Daniel B. <daniel@firewall-services.com> 1.02-2.rc1  * Wed Mar 13 2009 Daniel B. <daniel@firewall-services.com> 1.02-0.10.rc3.el4.2
296  - Apply patch1 for ocs-inventory 1.02RC3  - Changes for SME Server (apache=>www)
297    
298    * Sun Jan 18 2009 Remi Collet <Fedora@famillecollet.com> 1.02-0.10.rc3.el4.1
299    - fix php-xml > php-domxml in EL-4
300    
301    * Sun Jan 11 2009 Remi Collet <Fedora@famillecollet.com> 1.02-0.10.rc3
302    - add r1447 and r1462 patch
303    - change log selinux context (httpd_log_t)
304    
305    * Fri Oct 17 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.9.rc3
306    - upstream r1423 patch - migration script
307    
308    * Sat Oct 11 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.8.rc3
309    - upstream r1413 patch - database schema
310    
311    * Sat Oct 11 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.7.rc3
312    - update to RC3
313    
314    * Tue Jul 22 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.6.rc2
315    - add missing requires perl(SOAP::Transport::HTTP2) (with mod_perl2)
316    - AddDefaultCharset ISO-8859-1 in httpd config
317    - fix SElinux path
318    
319    * Sat Jun 14 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.5.rc2
320    - change dir from /var/lib/ocsinventory-server to /var/lib/ocsinventory-reports
321    - add Requires nmap and samba-client (nmblookup)
322    
323    * Sun May 18 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.4.rc2
324    - remove <IfModule> from ocsinventory-server.conf
325    - change perm to 755 on /var/lib/ocsinventory-server
326    - metapackage description closer to upstream components name
327    - add BR perl(DBD::mysql) to avoid build warning
328    
329    * Fri May 16 2008 Xavier Bachelot <xavier@bachelot.org> 1.02-0.3.rc2.1
330    - Fix BuildRequires and Requires.
331    - Fix %%description french translations and a few typos.
332    - Rename apache confs.
333    
334    * Sat May 10 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.3.rc2
335    - add missing requires for php extensions (from PHP_Compat result)
336    - add selinux stuff
337    
338  * Thu Sep 10 2008 Daniel B. <daniel@firewall-services.com> 1.02-02.rc1  * Thu May 08 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.2.rc2
339  - small changes for SME server  - update to RC2
340    
341  * Sun Mar 15 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.2.rc1  * Sun Mar 15 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.2.rc1
342  - fix download dir  - fix download dir


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed