]> git.pld-linux.org Git - SPECS.git/blob - oreon.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / oreon.spec
1
2 #TODO
3 # - see nagios-oreon.spec, merge upgrade there and cvs rm oreon.spec
4
5 # - use SMARTY from PLD
6
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
16 %define         _webapp         oreon
17 %define         _webconfdir     %{_webapps}/%{_webapp}
18 %define         _appdir         %{_datadir}/%{_webapp}
19
20 Summary:        Oreon - provide enterprise monitoring based on Nagios core.
21 Name:           oreon
22 Version:        1.4
23 Release:        0.1
24 License:        Apache v2.0
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
35 Requires:       perl-GD
36 Requires:       adodb >= 4.67-1.17
37 Requires:       crondaemon
38 Requires:       libgd2
39 Requires:       libpng
40 Requires:       net-snmp-utils
41 Requires:       php(gd)
42 Requires:       php(mysql)
43 Requires:       php(pcre)
44 Requires:       php(snmp)
45 Requires:       php(xml)
46 Requires:       php-cli
47 Requires:       rrdtool
48 Requires:       webserver
49 Requires:       webserver(php)
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52 %description
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.
56
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.
62
63 Although, skilled users still have access to the technicals informations 
64 collected by Nagios.
65
66 %package setup
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}
71
72 %description setup
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.
76
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.
81
82 %prep
83 %setup -q
84 find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 sed -i -e 's,\r$,,'
85
86 cat > apache.conf <<'EOF'
87 Alias /oreon %{_appdir}
88 <Directory %{_appdir}>
89         Allow from all
90         Options None
91         AllowOverride None
92 </Directory>
93 EOF
94
95 %build
96
97 %install
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}}
100
101 # install nagios  plugins
102 for fichier in %{PLUGINS_DIR}/src/*
103         do
104                 if [ -d "$fichier" ]; then
105                       echo ""
106         else
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"`
110                 fi
111 done
112                 
113 for fichier in %{PLUGINS_DIR}/src/traps/*
114         do
115                 filename=`echo $fichier  | sed -e 's|.*\/\(.*\)|\1|'`
116                 echo "-> $filename"
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"`
118 done            
119
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}
123
124 #"filesGeneration" "filesUpload"  "log" "rrd" "ODS" 
125
126 #instal 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
133
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
138
139 %clean
140 rm -rf $RPM_BUILD_ROOT
141
142 %pre
143
144 %postun
145
146 %post
147 /sbin/chkconfig --add %{name}
148 %service %{name} restart
149
150 %preun
151 if [ "$1" = "0" ]; then
152         %service -q %{name} stop
153         /sbin/chkconfig --del %{name}
154 fi
155
156 %triggerin -- apache1 < 1.3.37-3, apache1-base
157 %webapp_register apache %{_webapp}
158
159 %triggerun -- apache1 < 1.3.37-3, apache1-base
160 %webapp_unregister apache %{_webapp}
161
162 %triggerin -- apache < 2.2.0, apache-base
163 %webapp_register httpd %{_webapp}
164
165 %triggerun -- apache < 2.2.0, apache-base
166 %webapp_unregister httpd %{_webapp}
167
168 %files
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}/*
175 %{_datadir}/%{name}
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}
179 #%doc extras/*.gz
180 #%{_datadir}/%{name}-ext
181 %exclude %{_appdir}/www/install
182
183 %files setup
184 %defattr(644,root,root,755)
185 %{_appdir}/www/install
186
187 %triggerin -- apache1 < 1.3.37-3, apache1-base
188 %webapp_register apache %{_webapp}
189
190 %triggerun -- apache1 < 1.3.37-3, apache1-base
191 %webapp_unregister apache %{_webapp}
192
193 %triggerin -- apache < 2.2.0, apache-base
194 %webapp_register httpd %{_webapp}
195
196 %triggerun -- apache < 2.2.0, apache-base
197 %webapp_unregister httpd %{_webapp}
This page took 1.557316 seconds and 3 git commands to generate.