1 %define daemon_user monitor
3 %define htmlroot
/srv
/www
/htdocs
4 %define httpconfdir apache2
/conf.d
5 %define phpdir
/usr
/share
/php5
6 %define daemon_group www
8 %define htmlroot
/var
/www
/html
9 %define httpconfdir httpd
/conf.d
10 %define phpdir
/usr
/share
/php
11 %define daemon_group apache
15 Version: %{op5version}
16 Release: %{op5release}%{?dist}
17 License: GPLv2 and LGPLv2 and ASL
2.0 and BSD and MIT and
(MIT or GPL
+) and
(MIT or GPLv2
+)
19 BuildRoot: %{_tmppath}/%{name}-%{version}
20 Summary: op5 monitor ninja
22 Prefix: /opt
/monitor
/op5
/ninja
23 Requires: monitor
-gui
-core
24 Requires: merlin
-apps
>= 0.8.0
26 Requires: monitor
-merlin
27 Requires: php
-op5lib
>= 1.1.0
30 Requires: op5
-monitor
-supported
-webserver
31 Requires: monitor
-livestatus
32 Requires: monitor
-nacoma
33 Requires: monitor
-backup
34 Requires: op5
-bootstrap
35 BuildRequires
: php
-op5lib
>= 1.1.0-beta14
36 BuildRequires
: rubygem
(compass
)
37 BuildRequires
: doxygen
38 BuildRequires
: graphviz
41 Requires: php53
-gettext
46 Requires: php53
-mbstring
47 BuildRequires
: php53
-json
48 BuildRequires
: php53
-posix
49 BuildRequires
: php53
-ctype
50 BuildRequires
: util
-linux
51 BuildRequires
: pwdutils
52 BuildRequires
: graphviz
-gnome
53 BuildRequires
: ghostscript
-fonts
-std
56 BuildRequires
: php
>= 5.3
57 BuildRequires
: shadow
-utils
58 %if 0%{?rhel} >= 6 || 0%{?rhel_version} >=600 || 0%{?centos_version} >=600
60 Requires: php
-mbstring
61 BuildRequires
: php
-process
67 Source: %name-%version.tar.gz
72 Summary: Test files
for ninja
74 Requires: monitor
-ninja
= %version
75 Requires: merlin monitor
-merlin op5
-nagios
77 Requires: monitor
-http
-api
78 Requires: monitor
-livestatus monitor
-nagvis
79 Requires: rubygem20
-op5cucumber
81 Requires: op5license
-generator
83 # For performance graph links on extinfo
87 Additional
test files
for ninja
90 Summary: Development files
for ninja
92 Requires: monitor
-ninja
= %version
95 Development files files
for ninja
100 find
-type f
-exec %{__sed} '{}'
-i
-e 's
#var/www/html#srv/www/htdocs#g' \;
101 find
-type f
-exec %{__sed} '{}'
-i
-e 's
#var/www#srv/www#g' \;
114 mkdir -p
-m
755 %buildroot%prefix
115 mkdir -p
-m
775 %buildroot%prefix/upload
116 mkdir -p
-m
775 %buildroot%prefix/application
/logs
118 make install-devel SYSCONFDIR
=%buildroot%_sysconfdir PREFIX
=%buildroot%prefix PHPDIR
=%buildroot%phpdir ETC_USER
=$
(id
-un
) ETC_GROUP
=$
(id
-gn
)
120 # copy everything and then remove what we don't want to ship
121 cp
-r
* %buildroot%prefix
122 for d
in op5build monitor
-ninja.spec ninja.doxy \
123 php2doxy.sh example.htaccess cli
-helpers
/apr_md5_validate.c \
124 README docs
/README xdoc
126 rm -rf
%buildroot%prefix/$d
129 sed
-i "s
/\
(IN_PRODUCTION'
, \
)FALSE
/\
1TRUE
/" \
130 %buildroot%prefix/index.php
132 -e 's
,^\
(.config..site_domain..
= .\
)/ninja
/,\
1/monitor
/,' \
133 -e 's
/^\
(.config..product_name..
= .\
)Nagios
/\
1op5 Monitor
/' \
134 -e 's
/^\
(.config..version_info..
= .\
)\
/etc\
/ninja
-release
/\
1\
/etc\
/op5
-monitor
-release
/' \
135 %buildroot%prefix/application
/config
/config.php
137 cp op5build
/login.png \
138 %buildroot%prefix/application
/views
/css
/default
/images
139 cp op5build
/favicon.ico \
140 %buildroot%prefix/application
/views
/icons
/16x16
/
141 cp op5build
/icon.png \
142 %buildroot%prefix/application
/views
/icons
/
144 find
%buildroot -print0 | xargs
-0 chmod a
+r
145 find
%buildroot -type d
-print0 | xargs
-0 chmod a
+x
147 mkdir -p
%buildroot/etc
/cron.d
/
148 install -m
644 install_scripts
/scheduled_reports.crontab
%buildroot/etc
/cron.d
/scheduled
-reports
149 install -m
644 install_scripts
/recurring_downtime.crontab
%buildroot/etc
/cron.d
/recurring
-downtime
152 for f
in cli
-helpers
/apr_md5_validate \
153 install_scripts
/ninja_db_init.sh
; do
154 chmod
755 %buildroot%prefix/$f
157 # The custom_widgets dir need to be writable by the apache user
158 chmod
775 %buildroot%prefix/application
/custom_widgets
160 mkdir -p
%buildroot/opt
/monitor
/op5
/nacoma
/hooks
/save
161 install -m
755 install_scripts
/nacoma_hooks.py
%buildroot/opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.py
162 %if 0%{?sles_version}
163 %{py_compile %buildroot/opt/monitor/op5/nacoma/hooks/save}
164 %{py_compile -O %buildroot/opt/monitor/op5/nacoma/hooks/save}
167 mkdir -p
%buildroot%_sysconfdir/%{httpconfdir}
168 install -m
640 op5build
/ninja.httpd
-conf
%buildroot/etc
/%{httpconfdir}/monitor
-ninja.conf
170 # we don't need the git directories
171 rm -rf
%buildroot%prefix/application
/vendor
/phptap
/.git
173 sed
-i 's
/Ninja
/op5 Monitor
/'
%buildroot%prefix/application
/media
/report_footer.html
175 mkdir -p
%buildroot%prefix/application
/config
/custom
176 install -m
755 test/configs
/kohana
-configs
/exception.php
%buildroot%prefix/application
/config
/custom
/exception.php
177 rm %buildroot%prefix/test/configs
/kohana
-configs
/exception.php
180 # This needs to be removed for us to be able to upgrade ninja 2.0.7
182 if test -d
%buildroot%prefix/application
/vendor
/phptap
/.git
; then
183 rm -rf
%buildroot%prefix/application
/vendor
/phptap
/.git
188 # Verify that mysql-server is installed and running before executing sql scripts
189 $
(mysql
-Be "quit"
2>/dev
/null
) && MYSQL_AVAILABLE
=1
190 if [ -n "$MYSQL_AVAILABLE"
]; then
192 sh install_scripts
/ninja_db_init.sh
195 echo "WARNING
: mysql
-server is not installed or not running."
196 echo "If Oracle database is to be used this is ok."
197 echo "If MySQL database is to be used you need to maually run
:"
198 echo "
%prefix/install_scripts
/ninja_db_init.sh"
199 echo "to complete the setup of
%name"
202 $
(php
%prefix/index.php cli
/save_widget
--page 'tac
/index'
--name nagvis
--friendly_name "Nagvis"
&> /dev
/null
)
203 $
(php
%prefix/index.php cli
/save_widget
--page 'tac
/index'
--name listview
--friendly_name "List view"
&> /dev
/null
)
204 if [ "$?"
-ne
0 ]; then
205 echo "WARNING
: mysql
-server is not installed or not running."
206 echo "If Oracle database is to be used this is ok."
207 echo "If MySQL database is to be used you need to maually"
208 echo "setup the merlin database to complete the setup of
%name"
211 # Cleanup symlinks we don't use anymore
212 for link
in %{htmlroot}/monitor %{htmlroot}/ninja
/op5
/monitor
/op5
/ninja
/op5
/opt
/monitor
/op5
/ninja
/css
/opt
/monitor
/op5
/ninja
/js
/opt
/monitor
/op5
/ninja
/images
/opt
/monitor
/op5
/ninja
/stylesheets
214 if [ -f $link
]; then
220 %defattr(-,%daemon_user,%daemon_group)
222 %attr(644,root
,root
) /etc
/cron.d
/*
223 %attr(755,root
,root
) /opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.py
224 %attr(644,root
,root
) /opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.pyc
225 %attr(644,root
,root
) /opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.pyo
226 %attr(-,root
,%daemon_group) /etc
/%{httpconfdir}/monitor
-ninja.conf
228 %exclude %prefix/test
229 %exclude %prefix/modules
/test
230 %exclude %prefix/Makefile
231 %exclude %prefix/features
232 %exclude %prefix/application
/config
/custom
/exception.php
235 %defattr(-,root
,root
)
236 %phpdir/op5
/ninja_sdk
240 %defattr(-,monitor
,%daemon_group)
246 %prefix/application
/config
/custom
/exception.php