1 |
vip-ire |
1.4 |
# $Id: ocsinventory.spec,v 1.3 2009/03/18 14:37:45 slords Exp $ |
2 |
slords |
1.2 |
# Authority: vip-ire |
3 |
|
|
# Name: Daniel Berteaud |
4 |
slords |
1.1 |
|
5 |
slords |
1.3 |
%if %{?fedora}%{?rhel} >= 5 |
6 |
|
|
%define useselinux 1 |
7 |
|
|
%else |
8 |
|
|
%define useselinux 0 |
9 |
|
|
%endif |
10 |
|
|
|
11 |
vip-ire |
1.4 |
%define tarname OCSNG_UNIX_SERVER-1.02.1 |
12 |
slords |
1.3 |
|
13 |
slords |
1.1 |
Name: ocsinventory |
14 |
|
|
Summary: Open Computer and Software Inventory Next Generation |
15 |
|
|
|
16 |
vip-ire |
1.4 |
Version: 1.02.1 |
17 |
|
|
Release: 1%{?dist} |
18 |
slords |
1.1 |
|
19 |
|
|
Group: Applications/Internet |
20 |
|
|
License: GPLv2 |
21 |
|
|
URL: http://www.ocsinventory-ng.org/ |
22 |
|
|
|
23 |
slords |
1.3 |
Source0: http://downloads.sourceforge.net/%{name}/%{tarname}.tar.gz |
24 |
slords |
1.1 |
Source1: ocsinventory-reports.conf |
25 |
slords |
1.3 |
|
26 |
slords |
1.1 |
BuildArch: noarch |
27 |
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
28 |
|
|
BuildRequires: perl(ExtUtils::MakeMaker) |
29 |
slords |
1.3 |
BuildRequires: perl(Apache::DBI) |
30 |
|
|
BuildRequires: perl(DBD::mysql) |
31 |
|
|
BuildRequires: perl(Net::IP) |
32 |
|
|
BuildRequires: perl(XML::Simple) |
33 |
slords |
1.1 |
|
34 |
|
|
# Main package is a dummy package |
35 |
|
|
Requires: ocsinventory-server = %{version}-%{release} |
36 |
|
|
Requires: ocsinventory-reports = %{version}-%{release} |
37 |
|
|
Requires: mysql-server |
38 |
|
|
|
39 |
|
|
|
40 |
|
|
%description |
41 |
|
|
Open Computer and Software Inventory Next Generation is an application |
42 |
|
|
designed to help a network or system administrator keep track of the |
43 |
|
|
computers configuration and software that are installed on the network. |
44 |
|
|
|
45 |
|
|
OCS Inventory is also able to detect all active devices on your network, |
46 |
|
|
such as switch, router, network printer and unattended devices. |
47 |
|
|
|
48 |
slords |
1.3 |
OCS Inventory NG includes package deployment feature on client computers. |
49 |
|
|
|
50 |
|
|
ocsinventory is a metapackage that will install the communication server, |
51 |
|
|
the administration console and the database server (MySQL). |
52 |
slords |
1.1 |
|
53 |
|
|
%description -l fr |
54 |
|
|
Open Computer and Software Inventory Next Generation est une application |
55 |
slords |
1.3 |
destinée à aider l'administrateur système ou réseau à garder un oeil |
56 |
slords |
1.1 |
sur la configuration des machines du réseau et sur les logiciels qui y |
57 |
|
|
sont installés. |
58 |
|
|
|
59 |
|
|
OCS Inventory est aussi capable de détecter tout périphérique actif sur |
60 |
slords |
1.3 |
le réseau, comme les commutateurs, routeurs, imprimantes et autres matériels |
61 |
|
|
autonomes. |
62 |
slords |
1.1 |
|
63 |
|
|
OCS Inventory NG intègre des fonctionnalités de télédiffusion de paquets |
64 |
|
|
sur les machines clients. |
65 |
|
|
|
66 |
slords |
1.3 |
ocsinventory est un metapaquet qui installera le serveur de communication, |
67 |
|
|
la console d'administration et le serveur de base de données (MySQL). |
68 |
slords |
1.1 |
|
69 |
|
|
%package server |
70 |
|
|
Group: Applications/Internet |
71 |
|
|
Summary: OCS Inventory NG - Communication server |
72 |
|
|
Requires: mod_perl |
73 |
slords |
1.3 |
%if 0%{?rhel} != 4 |
74 |
|
|
# when use with mod_perl2 |
75 |
|
|
Requires: perl(SOAP::Transport::HTTP2) |
76 |
|
|
%endif |
77 |
slords |
1.1 |
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) |
78 |
slords |
1.3 |
# Required by the original setup script, but not detected automatically : |
79 |
|
|
# Apache::DBI drags in DBI |
80 |
|
|
Requires: perl(Apache::DBI) |
81 |
|
|
Requires: perl(Net::IP) |
82 |
|
|
Requires: perl(DBD::mysql) |
83 |
|
|
# Optional, not detected automatically : |
84 |
|
|
Requires: perl(SOAP::Lite) |
85 |
|
|
Requires: perl(XML::Entities) |
86 |
|
|
%if %{useselinux} |
87 |
|
|
Requires: policycoreutils |
88 |
|
|
%endif |
89 |
slords |
1.1 |
|
90 |
|
|
%description server |
91 |
|
|
This package provides the Communication server, which will handle HTTP |
92 |
|
|
communications between database server and agents. |
93 |
|
|
|
94 |
|
|
%description -l fr server |
95 |
|
|
Ce paquet fournit le serveur de communication (Communication server), |
96 |
|
|
qui gère les communications HTTP entre les agents et le serveur de base |
97 |
|
|
de données. |
98 |
|
|
|
99 |
|
|
|
100 |
|
|
%package reports |
101 |
|
|
Group: Applications/Internet |
102 |
|
|
Summary: OCS Inventory NG - Communication server |
103 |
slords |
1.3 |
# From PHP_Compat : date, mysql, ereg, pcre, zip, hash, xml, gd, zlib |
104 |
slords |
1.1 |
Requires: php |
105 |
slords |
1.3 |
Requires: php-mysql php-zip php-gd |
106 |
|
|
%if 0%{?rhel} == 4 |
107 |
|
|
Requires: php-domxml |
108 |
|
|
%else |
109 |
|
|
Requires: php-xml |
110 |
|
|
%endif |
111 |
|
|
# Required by the original setup script, but not detected automatically : |
112 |
|
|
Requires: perl(DBD::mysql) |
113 |
|
|
# Required by ipdiscover-util.pl (nmap and nmblookup) |
114 |
|
|
Requires: nmap samba-client |
115 |
|
|
%if %{useselinux} |
116 |
|
|
Requires: policycoreutils |
117 |
|
|
%endif |
118 |
slords |
1.1 |
|
119 |
|
|
%description reports |
120 |
|
|
This package provides the Administration console, which will allow |
121 |
|
|
administrators to query the database server through their favorite browser. |
122 |
|
|
|
123 |
|
|
%description -l fr reports |
124 |
|
|
Ce paquet fournit la console d'administration (Administration console), |
125 |
|
|
qui autorise les administrateurs à interroger la base de données via leur |
126 |
|
|
navigateur favori. |
127 |
|
|
|
128 |
slords |
1.3 |
|
129 |
slords |
1.1 |
%prep |
130 |
slords |
1.3 |
%setup -q -n %{tarname} |
131 |
|
|
|
132 |
slords |
1.1 |
%build |
133 |
|
|
cd Apache |
134 |
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor |
135 |
|
|
make %{?_smp_mflags} |
136 |
|
|
|
137 |
slords |
1.3 |
|
138 |
slords |
1.1 |
%install |
139 |
|
|
rm -rf %{buildroot} |
140 |
|
|
|
141 |
|
|
# --- ocsinventory-server --- communication server |
142 |
|
|
cd Apache |
143 |
|
|
make pure_install PERL_INSTALL_ROOT=%{buildroot} |
144 |
|
|
find %{buildroot} -type f -name .packlist -exec rm -f {} ';' |
145 |
|
|
find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';' |
146 |
|
|
|
147 |
|
|
chmod -R u+rwX,go+rX,go-w %{buildroot}/* |
148 |
|
|
find %{buildroot}%{perl_vendorlib}/Apache -name \*.pm -exec chmod -x {} \; |
149 |
|
|
|
150 |
|
|
%if 0%{?rhel} == 4 |
151 |
|
|
# To avoid bad dependency on perl(mod_perl2) |
152 |
|
|
rm -f %{buildroot}%{perl_vendorlib}/Apache/Ocsinventory/Server/Modperl2.pm |
153 |
|
|
%else |
154 |
|
|
# To avoid bad dependency on perl(mod_perl) : RHEL >= 5 && Fedora >= 4 |
155 |
|
|
rm -f %{buildroot}%{perl_vendorlib}/Apache/Ocsinventory/Server/Modperl1.pm |
156 |
|
|
%endif |
157 |
|
|
|
158 |
|
|
%{__mkdir_p} %{buildroot}%{_localstatedir}/log/ocsinventory-server |
159 |
|
|
|
160 |
|
|
%{__mkdir_p} %{buildroot}%{_sysconfdir}/logrotate.d |
161 |
|
|
%{__sed} -e 's;PATH_TO_LOG_DIRECTORY;%{_localstatedir}/log/ocsinventory-server;' \ |
162 |
|
|
./etc/logrotate.d/ocsinventory-server >%{buildroot}%{_sysconfdir}/logrotate.d/ocsinventory-server |
163 |
|
|
|
164 |
slords |
1.3 |
# default configuration (localhost) should work on "simple" installation |
165 |
slords |
1.1 |
%{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf.d |
166 |
|
|
%{__sed} -e "s;DATABASE_SERVER;localhost;g" \ |
167 |
slords |
1.3 |
-e "s;DATABASE_PORT;3306;g" \ |
168 |
slords |
1.1 |
%if 0%{?rhel} == 4 |
169 |
slords |
1.3 |
-e "s;VERSION_MP;1;g" \ |
170 |
slords |
1.1 |
%else |
171 |
slords |
1.3 |
-e "s;VERSION_MP;2;g" \ |
172 |
slords |
1.1 |
%endif |
173 |
slords |
1.3 |
-e "s;PATH_TO_LOG_DIRECTORY;%{_localstatedir}/log/ocsinventory-server;g" \ |
174 |
|
|
./etc/ocsinventory/ocsinventory-server.conf | \ |
175 |
|
|
grep -v IfModule >%{buildroot}%{_sysconfdir}/httpd/conf.d/ocsinventory-server.conf |
176 |
slords |
1.1 |
cd .. |
177 |
|
|
|
178 |
|
|
# --- ocsinventory-reports --- administration console |
179 |
|
|
|
180 |
|
|
%{__mkdir_p} %{buildroot}/%{_datadir}/ocsinventory-reports |
181 |
|
|
cp -ar ocsreports %{buildroot}/%{_datadir}/ocsinventory-reports |
182 |
|
|
find %{buildroot}/%{_datadir}/ocsinventory-reports \( -name \*.php -o -name \*.css \) -exec chmod -x {} \; |
183 |
|
|
|
184 |
|
|
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/ocsinventory/ocsinventory-reports |
185 |
slords |
1.3 |
|
186 |
slords |
1.1 |
mv %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/dbconfig.inc.php \ |
187 |
|
|
%{buildroot}/%{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php |
188 |
|
|
ln -s ../../../../%{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/dbconfig.inc.php |
189 |
|
|
|
190 |
slords |
1.3 |
%{__mkdir_p} %{buildroot}%{_localstatedir}/lib/ocsinventory-reports/{download,ipd} |
191 |
slords |
1.1 |
|
192 |
|
|
%{__install} -pm 755 Apache/binutils/ipdiscover-util.pl %{buildroot}/%{_datadir}/ocsinventory-reports/ocsreports/ipdiscover-util.pl |
193 |
|
|
|
194 |
|
|
%{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf.d |
195 |
|
|
%{__sed} -e "s;OCSREPORTS_ALIAS;/ocsreports;g" \ |
196 |
|
|
-e "s;PATH_TO_OCSREPORTS_DIR;%{_datadir}/ocsinventory-reports/ocsreports;g" \ |
197 |
|
|
-e "s;PACKAGES_ALIAS;/download;g" \ |
198 |
slords |
1.3 |
-e "s;PATH_TO_PACKAGES_DIR;%{_localstatedir}/lib/ocsinventory-reports/download;g" \ |
199 |
|
|
%{SOURCE1} >%{buildroot}%{_sysconfdir}/httpd/conf.d/ocsinventory-reports.conf |
200 |
slords |
1.1 |
|
201 |
|
|
|
202 |
|
|
%clean |
203 |
|
|
rm -rf %{buildroot} |
204 |
|
|
|
205 |
slords |
1.3 |
|
206 |
|
|
%post server |
207 |
|
|
%if %{useselinux} |
208 |
|
|
( |
209 |
|
|
# New File context |
210 |
|
|
semanage fcontext -a -s system_u -t httpd_log_t -r s0 "%{_localstatedir}/log/ocsinventory-server(/.*)?" |
211 |
|
|
# files created by app |
212 |
|
|
restorecon -R %{_localstatedir}/log/ocsinventory-server |
213 |
|
|
) &>/dev/null ||: |
214 |
|
|
%endif |
215 |
|
|
|
216 |
|
|
|
217 |
|
|
%post reports |
218 |
|
|
%if %{useselinux} |
219 |
|
|
( |
220 |
|
|
# New File context |
221 |
|
|
semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_sysconfdir}/ocsinventory/ocsinventory-reports(/.*)?" |
222 |
|
|
semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_localstatedir}/lib/ocsinventory-reports(/.*)?" |
223 |
|
|
# files created by app |
224 |
|
|
restorecon -R %{_sysconfdir}/ocsinventory/ocsinventory-reports |
225 |
|
|
restorecon -R %{_localstatedir}/lib/ocsinventory-reports |
226 |
|
|
) &>/dev/null ||: |
227 |
|
|
%endif |
228 |
|
|
|
229 |
|
|
|
230 |
|
|
%postun server |
231 |
|
|
%if %{useselinux} |
232 |
|
|
if [ "$1" -eq "0" ]; then |
233 |
|
|
# Remove the File Context |
234 |
|
|
semanage fcontext -d "%{_localstatedir}/log/ocsinventory-server(/.*)?" &>/dev/null || : |
235 |
|
|
fi |
236 |
|
|
%endif |
237 |
|
|
|
238 |
|
|
|
239 |
|
|
%postun reports |
240 |
|
|
%if %{useselinux} |
241 |
|
|
if [ "$1" -eq "0" ]; then |
242 |
|
|
# Remove the File Context |
243 |
|
|
semanage fcontext -d "%{_sysconfdir}/ocsinventory/ocsinventory-reports(/.*)?" &>/dev/null ||: |
244 |
|
|
semanage fcontext -d "%{_localstatedir}/lib/ocsinventory-reports(/.*)?" &>/dev/null ||: |
245 |
|
|
fi |
246 |
|
|
%endif |
247 |
|
|
|
248 |
|
|
|
249 |
slords |
1.1 |
%files |
250 |
|
|
%defattr(-, root, root, -) |
251 |
|
|
|
252 |
|
|
|
253 |
|
|
%files server |
254 |
|
|
%defattr(-, root, root, -) |
255 |
|
|
%doc LICENSE.txt README |
256 |
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/ocsinventory-server |
257 |
slords |
1.3 |
%config(noreplace) %{_sysconfdir}/httpd/conf.d/ocsinventory-server.conf |
258 |
|
|
%attr(755,www,root) %{_localstatedir}/log/ocsinventory-server |
259 |
slords |
1.1 |
%{perl_vendorlib}/Apache |
260 |
|
|
|
261 |
|
|
|
262 |
|
|
%files reports |
263 |
|
|
%defattr(-, root, root, -) |
264 |
|
|
%doc LICENSE.txt README |
265 |
|
|
%dir %{_sysconfdir}/ocsinventory |
266 |
|
|
%dir %{_sysconfdir}/ocsinventory/ocsinventory-reports |
267 |
|
|
%attr(640,www,root) %config(noreplace) %{_sysconfdir}/ocsinventory/ocsinventory-reports/dbconfig.inc.php |
268 |
slords |
1.3 |
%config(noreplace) %{_sysconfdir}/httpd/conf.d/ocsinventory-reports.conf |
269 |
slords |
1.1 |
%{_datadir}/ocsinventory-reports |
270 |
slords |
1.3 |
%attr(755,www,root) %dir %{_localstatedir}/lib/ocsinventory-reports |
271 |
|
|
%attr(755,www,root) %dir %{_localstatedir}/lib/ocsinventory-reports/ipd |
272 |
|
|
%attr(755,www,root) %dir %{_localstatedir}/lib/ocsinventory-reports/download |
273 |
slords |
1.1 |
|
274 |
|
|
|
275 |
|
|
%changelog |
276 |
vip-ire |
1.4 |
* Fri Jun 12 2009 Daniel B. <daniel@firewall-services.com> 1.02.1-1.el4.sme |
277 |
|
|
- update to OCS Inventory NG 1.02.1 |
278 |
|
|
|
279 |
slords |
1.3 |
* Wed Mar 13 2009 Daniel B. <daniel@firewall-services.com> 1.02-0.10.rc3.el4.2 |
280 |
|
|
- Changes for SME Server (apache=>www) |
281 |
|
|
|
282 |
|
|
* Sun Jan 18 2009 Remi Collet <Fedora@famillecollet.com> 1.02-0.10.rc3.el4.1 |
283 |
|
|
- fix php-xml > php-domxml in EL-4 |
284 |
|
|
|
285 |
|
|
* Sun Jan 11 2009 Remi Collet <Fedora@famillecollet.com> 1.02-0.10.rc3 |
286 |
|
|
- add r1447 and r1462 patch |
287 |
|
|
- change log selinux context (httpd_log_t) |
288 |
|
|
|
289 |
|
|
* Fri Oct 17 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.9.rc3 |
290 |
|
|
- upstream r1423 patch - migration script |
291 |
|
|
|
292 |
|
|
* Sat Oct 11 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.8.rc3 |
293 |
|
|
- upstream r1413 patch - database schema |
294 |
|
|
|
295 |
|
|
* Sat Oct 11 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.7.rc3 |
296 |
|
|
- update to RC3 |
297 |
|
|
|
298 |
|
|
* Tue Jul 22 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.6.rc2 |
299 |
|
|
- add missing requires perl(SOAP::Transport::HTTP2) (with mod_perl2) |
300 |
|
|
- AddDefaultCharset ISO-8859-1 in httpd config |
301 |
|
|
- fix SElinux path |
302 |
|
|
|
303 |
|
|
* Sat Jun 14 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.5.rc2 |
304 |
|
|
- change dir from /var/lib/ocsinventory-server to /var/lib/ocsinventory-reports |
305 |
|
|
- add Requires nmap and samba-client (nmblookup) |
306 |
|
|
|
307 |
|
|
* Sun May 18 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.4.rc2 |
308 |
|
|
- remove <IfModule> from ocsinventory-server.conf |
309 |
|
|
- change perm to 755 on /var/lib/ocsinventory-server |
310 |
|
|
- metapackage description closer to upstream components name |
311 |
|
|
- add BR perl(DBD::mysql) to avoid build warning |
312 |
|
|
|
313 |
|
|
* Fri May 16 2008 Xavier Bachelot <xavier@bachelot.org> 1.02-0.3.rc2.1 |
314 |
|
|
- Fix BuildRequires and Requires. |
315 |
|
|
- Fix %%description french translations and a few typos. |
316 |
|
|
- Rename apache confs. |
317 |
|
|
|
318 |
|
|
* Sat May 10 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.3.rc2 |
319 |
|
|
- add missing requires for php extensions (from PHP_Compat result) |
320 |
|
|
- add selinux stuff |
321 |
slords |
1.1 |
|
322 |
slords |
1.3 |
* Thu May 08 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.2.rc2 |
323 |
|
|
- update to RC2 |
324 |
slords |
1.1 |
|
325 |
|
|
* Sun Mar 15 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.2.rc1 |
326 |
|
|
- fix download dir |
327 |
|
|
|
328 |
|
|
* Sat Mar 8 2008 Remi Collet <Fedora@famillecollet.com> 1.02-0.1.rc1 |
329 |
|
|
- Initial RPM |
330 |
|
|
|