1 %define daemon_user monitor
3 %define htmlroot
/srv
/www
/htdocs
4 %define httpconfdir apache2
/conf.d
5 %define daemon_group www
7 %define htmlroot
/var
/www
/html
8 %define httpconfdir httpd
/conf.d
9 %define daemon_group apache
13 Version: %{op5version}
14 Release: %{op5release}%{?dist}
15 License: GPLv2 and LGPLv2 and ASL
2.0 and BSD and MIT and
(MIT or GPL
+) and
(MIT or GPLv2
+)
17 BuildRoot: %{_tmppath}/%{name}-%{version}
18 Summary: op5 monitor ninja
20 Prefix: /opt
/monitor
/op5
/ninja
21 Requires: monitor
-gui
-core
22 Requires: merlin
-apps
>= 0.8.0
24 Requires: monitor
-merlin
25 Requires: php
-op5lib
>= 1.1.0
27 Requires: op5
-monitor
-supported
-database
28 Requires: op5
-monitor
-supported
-webserver
29 Requires: monitor
-livestatus
30 Requires: monitor
-nacoma
31 Requires: monitor
-backup
32 Requires: op5
-bootstrap
33 BuildRequires
: php
-op5lib
>= 1.1.0-beta14
34 BuildRequires
: rubygem
(compass
)
35 BuildRequires
: doxygen
36 BuildRequires
: graphviz
39 Requires: php53
-gettext
44 Requires: php53
-mbstring
45 BuildRequires
: php53
-json
46 BuildRequires
: php53
-posix
47 BuildRequires
: php53
-ctype
48 BuildRequires
: util
-linux
49 BuildRequires
: pwdutils
50 BuildRequires
: graphviz
-gnome
51 BuildRequires
: ghostscript
-fonts
-std
54 BuildRequires
: php
>= 5.3
55 BuildRequires
: shadow
-utils
56 %if 0%{?rhel} >= 6 || 0%{?rhel_version} >=600 || 0%{?centos_version} >=600
58 Requires: php
-mbstring
59 BuildRequires
: php
-process
65 Source: %name-%version.tar.gz
70 Summary: Test files
for ninja
72 Requires: monitor
-ninja
= %version
73 Requires: merlin monitor
-merlin op5
-nagios
74 Requires: merlin
-apps op5
-mysql
75 Requires: monitor
-livestatus monitor
-nagvis
76 Requires: rubygem20
-op5cucumber
78 Requires: op5license
-generator
80 # For performance graph links on extinfo
84 Additional
test files
for ninja
89 find
-type f
-exec %{__sed} '{}'
-i
-e 's
#var/www/html#srv/www/htdocs#g' \;
90 find
-type f
-exec %{__sed} '{}'
-i
-e 's
#var/www#srv/www#g' \;
103 mkdir -p
-m
755 %buildroot%prefix
104 mkdir -p
-m
775 %buildroot%prefix/upload
105 mkdir -p
-m
775 %buildroot%prefix/application
/logs
107 # copy everything and then remove what we don't want to ship
108 cp
-r
* %buildroot%prefix
109 for d
in op5build monitor
-ninja.spec ninja.doxy \
110 php2doxy.sh example.htaccess cli
-helpers
/apr_md5_validate.c \
111 README docs
/README xdoc
113 rm -rf
%buildroot%prefix/$d
116 sed
-i "s
/\
(IN_PRODUCTION'
, \
)FALSE
/\
1TRUE
/" \
117 %buildroot%prefix/index.php
119 -e 's
,^\
(.config..site_domain..
= .\
)/ninja
/,\
1/monitor
/,' \
120 -e 's
/^\
(.config..product_name..
= .\
)Nagios
/\
1op5 Monitor
/' \
121 -e 's
/^\
(.config..version_info..
= .\
)\
/etc\
/ninja
-release
/\
1\
/etc\
/op5
-monitor
-release
/' \
122 %buildroot%prefix/application
/config
/config.php
124 cp op5build
/login.png \
125 %buildroot%prefix/application
/views
/css
/default
/images
126 cp op5build
/favicon.ico \
127 %buildroot%prefix/application
/views
/icons
/16x16
/
128 cp op5build
/icon.png \
129 %buildroot%prefix/application
/views
/icons
/
131 find
%buildroot -print0 | xargs
-0 chmod a
+r
132 find
%buildroot -type d
-print0 | xargs
-0 chmod a
+x
134 mkdir -p
%buildroot/etc
/cron.d
/
135 install -m
644 install_scripts
/scheduled_reports.crontab
%buildroot/etc
/cron.d
/scheduled
-reports
136 install -m
644 install_scripts
/recurring_downtime.crontab
%buildroot/etc
/cron.d
/recurring
-downtime
139 for f
in cli
-helpers
/apr_md5_validate \
140 install_scripts
/ninja_db_init.sh
; do
141 chmod
755 %buildroot%prefix/$f
144 # The custom_widgets dir need to be writable by the apache user
145 chmod
775 %buildroot%prefix/application
/custom_widgets
147 mkdir -p
%buildroot/opt
/monitor
/op5
/nacoma
/hooks
/save
148 install -m
755 install_scripts
/nacoma_hooks.py
%buildroot/opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.py
149 %if 0%{?sles_version}
150 %{py_compile %buildroot/opt/monitor/op5/nacoma/hooks/save}
151 %{py_compile -O %buildroot/opt/monitor/op5/nacoma/hooks/save}
154 mkdir -p
%buildroot%_sysconfdir/%{httpconfdir}
155 install -m
640 op5build
/ninja.httpd
-conf
%buildroot/etc
/%{httpconfdir}/monitor
-ninja.conf
157 # we don't need the git directories
158 rm -rf
%buildroot%prefix/application
/vendor
/phptap
/.git
160 sed
-i 's
/Ninja
/op5 Monitor
/'
%buildroot%prefix/application
/media
/report_footer.html
162 mkdir -p
%buildroot%prefix/application
/config
/custom
163 install -m
755 test/configs
/kohana
-configs
/exception.php
%buildroot%prefix/application
/config
/custom
/exception.php
164 rm %buildroot%prefix/test/configs
/kohana
-configs
/exception.php
167 # This needs to be removed for us to be able to upgrade ninja 2.0.7
169 if test -d
%buildroot%prefix/application
/vendor
/phptap
/.git
; then
170 rm -rf
%buildroot%prefix/application
/vendor
/phptap
/.git
175 # Verify that mysql-server is installed and running before executing sql scripts
176 $
(mysql
-Be "quit"
2>/dev
/null
) && MYSQL_AVAILABLE
=1
177 if [ -n "$MYSQL_AVAILABLE"
]; then
179 sh install_scripts
/ninja_db_init.sh
182 echo "WARNING
: mysql
-server is not installed or not running."
183 echo "If Oracle database is to be used this is ok."
184 echo "If MySQL database is to be used you need to maually run
:"
185 echo "
%prefix/install_scripts
/ninja_db_init.sh"
186 echo "to complete the setup of
%name"
189 $
(php
%prefix/index.php cli
/save_widget
--page 'tac
/index'
--name nagvis
--friendly_name "Nagvis"
&> /dev
/null
)
190 $
(php
%prefix/index.php cli
/save_widget
--page 'tac
/index'
--name listview
--friendly_name "List view"
&> /dev
/null
)
191 if [ "$?"
-ne
0 ]; then
192 echo "WARNING
: mysql
-server is not installed or not running."
193 echo "If Oracle database is to be used this is ok."
194 echo "If MySQL database is to be used you need to maually"
195 echo "setup the merlin database to complete the setup of
%name"
198 # Cleanup symlinks we don't use anymore
199 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
201 if [ -f $link
]; then
207 %defattr(-,%daemon_user,%daemon_group)
209 %attr(644,root
,root
) /etc
/cron.d
/*
210 %attr(755,root
,root
) /opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.py
211 %attr(644,root
,root
) /opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.pyc
212 %attr(644,root
,root
) /opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.pyo
213 %attr(-,root
,%daemon_group) /etc
/%{httpconfdir}/monitor
-ninja.conf
215 %exclude %prefix/test
216 %exclude %prefix/modules
/test
217 %exclude %prefix/Makefile
218 %exclude %prefix/features
219 %exclude %prefix/application
/config
/custom
/exception.php
222 %defattr(-,monitor
,%daemon_group)
228 %prefix/application
/config
/custom
/exception.php