3 # - see nagios-oreon.spec, merge upgrade there and cvs rm oreon.spec
5 # - use SMARTY from PLD
7 %define INSTALL_DIR_NAGIOS %{_libdir}/nagios
8 %define NAGIOS_ETC %{_sysconfdir}/nagios
9 %define PLUGINS_DIR Plugins
10 %define INSTALL_DIR_NAGIOS %{_libdir}/nagios
11 %define NAGIOS_ETC %{_sysconfdir}/nagios
12 %define NAGIOS_PLUGIN %{_libdir}/nagios/plugins
13 %define INSTALL_DIR_OREON %{_libdir}/%{name}
14 %define RRD_PERL %{perl_vendorarch}
15 %define _webapps /etc/webapps
17 %define _webconfdir %{_webapps}/%{_webapp}
18 %define _appdir %{_datadir}/%{_webapp}
20 Summary: Oreon - provide enterprise monitoring based on Nagios core.
25 Group: Applications/WWW
26 Source0: http://download.oreon-project.org/tgz/%{name}-%{version}.tar.gz
27 # Source0-md5: 31d1a2948fde3e4c0e922047c4633781
28 Source1: http://download.oreon-project.org/patch/%{name}-patch-%{version}-5.tgz
29 # Source1-md5: 08290003e1fd93134578e40a69d785f1
30 URL: http://www.oreon-project.org/
31 BuildRequires: rpmbuild(macros) >= 1.228
32 Requires(post,preun): /sbin/chkconfig
33 BuildRequires: rpm-perlprov
34 Requires: nagios-common
36 Requires: adodb >= 4.67-1.17
40 Requires: net-snmp-utils
49 Requires: webserver(php)
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 Oreon is a network supervision and monitoring tool, it is based upon
54 the most effective Open Source monitoring engine : Nagios.
55 Oreon provides a new frontend and new functionnalities to Nagios.
57 It ables you to be more efficient in your network monitoring, but also
58 allows you to make your supervision informations readable by a largest
59 range of users. Indeed, a non technical user can now use the Oreon/Nagios
60 couple to easily understand your network infrastructure thanks to charts
61 and graphical representations of the gathered informations.
63 Although, skilled users still have access to the technicals informations
67 Summary: Oreon setup package
68 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Oreona
69 Group: Applications/WWW
70 Requires: %{name} = %{version}-%{release}
73 Install this package to configure initial Oreon installation. You
74 should uninstall this package when you're done, as it considered
75 insecure to keep the setup files in place.
77 %description setup -l pl.UTF-8
78 Ten pakiet należy zainstalowć w celu wsępnej konfiguracji Oreona po
79 pierwszej instalacji. Potem należy go odinstalowć, jako że
80 pozostawienie plików instalacyjnych mołoby bć niebezpieczne.
84 find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 sed -i -e 's,\r$,,'
86 cat > apache.conf <<'EOF'
87 Alias /oreon %{_appdir}
88 <Directory %{_appdir}>
98 rm -rf $RPM_BUILD_ROOT
99 install -d $RPM_BUILD_ROOT{%{_libdir}/nagios/plugins,%{_sysconfdir}{/rc.d/init.d,/nagios},%{_bindir},%{_datadir}/%{name},%{INSTALL_DIR_OREON}/{cron/reporting/api,ODS},%{_webconfdir}}
101 # install nagios plugins
102 for fichier in %{PLUGINS_DIR}/src/*
104 if [ -d "$fichier" ]; then
107 filename=`echo $fichier | sed -e 's|.*\/\(.*\)|\1|'`
108 echo " -> $filename OK"
109 `sed -e 's|@INSTALL_DIR_NAGIOS@|'"%{INSTALL_DIR_NAGIOS}"'|g' -e 's|@NAGIOS_ETC@|'"%{NAGIOS_ETC}"'|g' -e 's|@NAGIOS_PLUGINS@|'"%{NAGIOS_PLUGIN}"'|g' -e 's|@RRDTOOL_PERL_LIB@|'"%{RRD_PERL}"'|g' -e 's|@INSTALL_DIR_OREON@|'"%{INSTALL_DIR_OREON}"'|g' "$fichier" > "$RPM_BUILD_ROOT%{NAGIOS_PLUGIN}/$filename"`
113 for fichier in %{PLUGINS_DIR}/src/traps/*
115 filename=`echo $fichier | sed -e 's|.*\/\(.*\)|\1|'`
117 `sed -e 's|@INSTALL_DIR_NAGIOS@|'"%{INSTALL_DIR_NAGIOS}"'|g' -e 's|@NAGIOS_ETC@|'"%{NAGIOS_ETC}"'|g' -e 's|@NAGIOS_PLUGINS@|'"%{NAGIOS_PLUGIN}"'|g' -e 's|@RRDTOOL_PERL_LIB@|'"%{RRD_PERL}"'|g' -e 's|@INSTALL_DIR_OREON@|'"%{INSTALL_DIR_OREON}"'|g' "$fichier" > "$RPM_BUILD_ROOT%{NAGIOS_PLUGIN}/$filename"`
120 cp -rf www $RPM_BUILD_ROOT%{_datadir}/%{name}
121 cp -rf doc $RPM_BUILD_ROOT%{_datadir}/%{name}
122 cp -rf GPL_LIB $RPM_BUILD_ROOT%{_datadir}/%{name}
124 #"filesGeneration" "filesUpload" "log" "rrd" "ODS"
127 sed -e 's|@OREON_PATH@|'"%{INSTALL_DIR_OREON}"'|g' ODS/ods.pl > $RPM_BUILD_ROOT%{INSTALL_DIR_OREON}/ODS/ods.pl
128 sed -e 's|@OREON_PATH@|'"%{INSTALL_DIR_OREON}"'|g' -e 's|@NAGIOS_USER@|'"$NAGIOS_USER"'|g' -e 's|@NAGIOS_GROUP@|'"$NAGIOS_GROUP"'|g' ODS_SRC_ETC/ods > $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/ods
129 sed -e 's|@OREON_PATH@|'"%{INSTALL_DIR_OREON}"'|g' cron/inventory_update.php > $RPM_BUILD_ROOT%{INSTALL_DIR_OREON}/cron/inventory_update.php
130 sed -e 's|@OREON_PATH@|'"%{INSTALL_DIR_OREON}"'|g' cron/reporting/ArchiveLogInDB.php > $RPM_BUILD_ROOT%{INSTALL_DIR_OREON}/cron/reporting/ArchiveLogInDB.php
131 sed -e 's|@OREON_PATH@|'"%{INSTALL_DIR_OREON}"'|g' cron/parsing_status.pl > $RPM_BUILD_ROOT%{INSTALL_DIR_OREON}/cron/parsing_status.pl
132 sed -e 's|@OREON_PATH@|'"%{INSTALL_DIR_OREON}"'|g' cron/parsing_log.pl > $RPM_BUILD_ROOT%{INSTALL_DIR_OREON}/cron/parsing_log.pl
134 install cron/delete*.pl $RPM_BUILD_ROOT%{INSTALL_DIR_OREON}/cron
135 install cron/reporting/api/* $RPM_BUILD_ROOT%{INSTALL_DIR_OREON}/cron/reporting/api
136 install apache.conf $RPM_BUILD_ROOT%{_webconfdir}/apache.conf
137 install apache.conf $RPM_BUILD_ROOT%{_webconfdir}/httpd.conf
140 rm -rf $RPM_BUILD_ROOT
147 /sbin/chkconfig --add %{name}
148 %service %{name} restart
151 if [ "$1" = "0" ]; then
152 %service -q %{name} stop
153 /sbin/chkconfig --del %{name}
156 %triggerin -- apache1 < 1.3.37-3, apache1-base
157 %webapp_register apache %{_webapp}
159 %triggerun -- apache1 < 1.3.37-3, apache1-base
160 %webapp_unregister apache %{_webapp}
162 %triggerin -- apache < 2.2.0, apache-base
163 %webapp_register httpd %{_webapp}
165 %triggerun -- apache < 2.2.0, apache-base
166 %webapp_unregister httpd %{_webapp}
169 %defattr(644,root,root,755)
170 %doc CHANGELOG README cron/*README.txt cron/reporting/*README.txt
171 %dir %attr(750,root,http) %{_sysconfdir}
172 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webconfdir}/apache.conf
173 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webconfdir}/httpd.conf
174 #%attr(755,root,root) %{_bindir}/*
176 %attr(755,root,root) %{_libdir}/nagios/plugins/*
177 #%attr(754,root,root) /etc/rc.d/init.d/%{name}
178 #%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
180 #%{_datadir}/%{name}-ext
181 %exclude %{_appdir}/www/install
184 %defattr(644,root,root,755)
185 %{_appdir}/www/install
187 %triggerin -- apache1 < 1.3.37-3, apache1-base
188 %webapp_register apache %{_webapp}
190 %triggerun -- apache1 < 1.3.37-3, apache1-base
191 %webapp_unregister apache %{_webapp}
193 %triggerin -- apache < 2.2.0, apache-base
194 %webapp_register httpd %{_webapp}
196 %triggerun -- apache < 2.2.0, apache-base
197 %webapp_unregister httpd %{_webapp}