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
-livestatus monitor
-nagvis
78 Requires: rubygem20
-op5cucumber
80 Requires: op5license
-generator
82 # For performance graph links on extinfo
86 Additional
test files
for ninja
89 Summary: Development files
for ninja
91 Requires: monitor
-ninja
= %version
94 Development files files
for ninja
99 find
-type f
-exec %{__sed} '{}'
-i
-e 's
#var/www/html#srv/www/htdocs#g' \;
100 find
-type f
-exec %{__sed} '{}'
-i
-e 's
#var/www#srv/www#g' \;
113 mkdir -p
-m
755 %buildroot%prefix
114 mkdir -p
-m
775 %buildroot%prefix/upload
115 mkdir -p
-m
775 %buildroot%prefix/application
/logs
117 make install-devel SYSCONFDIR
=%buildroot%_sysconfdir PREFIX
=%buildroot%prefix PHPDIR
=%buildroot%phpdir ETC_USER
=$
(id
-un
) ETC_GROUP
=$
(id
-gn
)
119 # copy everything and then remove what we don't want to ship
120 cp
-r
* %buildroot%prefix
121 for d
in op5build monitor
-ninja.spec ninja.doxy \
122 php2doxy.sh example.htaccess cli
-helpers
/apr_md5_validate.c \
123 README docs
/README xdoc
125 rm -rf
%buildroot%prefix/$d
128 sed
-i "s
/\
(IN_PRODUCTION'
, \
)FALSE
/\
1TRUE
/" \
129 %buildroot%prefix/index.php
131 -e 's
,^\
(.config..site_domain..
= .\
)/ninja
/,\
1/monitor
/,' \
132 -e 's
/^\
(.config..product_name..
= .\
)Nagios
/\
1op5 Monitor
/' \
133 -e 's
/^\
(.config..version_info..
= .\
)\
/etc\
/ninja
-release
/\
1\
/etc\
/op5
-monitor
-release
/' \
134 %buildroot%prefix/application
/config
/config.php
136 cp op5build
/login.png \
137 %buildroot%prefix/application
/views
/css
/default
/images
138 cp op5build
/favicon.ico \
139 %buildroot%prefix/application
/views
/icons
/16x16
/
140 cp op5build
/icon.png \
141 %buildroot%prefix/application
/views
/icons
/
143 find
%buildroot -print0 | xargs
-0 chmod a
+r
144 find
%buildroot -type d
-print0 | xargs
-0 chmod a
+x
146 mkdir -p
%buildroot/etc
/cron.d
/
147 install -m
644 install_scripts
/scheduled_reports.crontab
%buildroot/etc
/cron.d
/scheduled
-reports
148 install -m
644 install_scripts
/recurring_downtime.crontab
%buildroot/etc
/cron.d
/recurring
-downtime
151 for f
in cli
-helpers
/apr_md5_validate \
152 install_scripts
/ninja_db_init.sh
; do
153 chmod
755 %buildroot%prefix/$f
156 # The custom_widgets dir need to be writable by the apache user
157 chmod
775 %buildroot%prefix/application
/custom_widgets
159 mkdir -p
%buildroot/opt
/monitor
/op5
/nacoma
/hooks
/save
160 install -m
755 install_scripts
/nacoma_hooks.py
%buildroot/opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.py
161 %if 0%{?sles_version}
162 %{py_compile %buildroot/opt/monitor/op5/nacoma/hooks/save}
163 %{py_compile -O %buildroot/opt/monitor/op5/nacoma/hooks/save}
166 mkdir -p
%buildroot%_sysconfdir/%{httpconfdir}
167 install -m
640 op5build
/ninja.httpd
-conf
%buildroot/etc
/%{httpconfdir}/monitor
-ninja.conf
169 # we don't need the git directories
170 rm -rf
%buildroot%prefix/application
/vendor
/phptap
/.git
172 sed
-i 's
/Ninja
/op5 Monitor
/'
%buildroot%prefix/application
/media
/report_footer.html
174 mkdir -p
%buildroot%prefix/application
/config
/custom
175 install -m
755 test/configs
/kohana
-configs
/exception.php
%buildroot%prefix/application
/config
/custom
/exception.php
176 rm %buildroot%prefix/test/configs
/kohana
-configs
/exception.php
179 # This needs to be removed for us to be able to upgrade ninja 2.0.7
181 if test -d
%buildroot%prefix/application
/vendor
/phptap
/.git
; then
182 rm -rf
%buildroot%prefix/application
/vendor
/phptap
/.git
187 # Verify that mysql-server is installed and running before executing sql scripts
188 $
(mysql
-Be "quit"
2>/dev
/null
) && MYSQL_AVAILABLE
=1
189 if [ -n "$MYSQL_AVAILABLE"
]; then
191 sh install_scripts
/ninja_db_init.sh
194 echo "WARNING
: mysql
-server is not installed or not running."
195 echo "If Oracle database is to be used this is ok."
196 echo "If MySQL database is to be used you need to maually run
:"
197 echo "
%prefix/install_scripts
/ninja_db_init.sh"
198 echo "to complete the setup of
%name"
201 $
(php
%prefix/index.php cli
/save_widget
--page 'tac
/index'
--name nagvis
--friendly_name "Nagvis"
&> /dev
/null
)
202 $
(php
%prefix/index.php cli
/save_widget
--page 'tac
/index'
--name listview
--friendly_name "List view"
&> /dev
/null
)
203 if [ "$?"
-ne
0 ]; then
204 echo "WARNING
: mysql
-server is not installed or not running."
205 echo "If Oracle database is to be used this is ok."
206 echo "If MySQL database is to be used you need to maually"
207 echo "setup the merlin database to complete the setup of
%name"
210 # Cleanup symlinks we don't use anymore
211 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
213 if [ -f $link
]; then
219 %defattr(-,%daemon_user,%daemon_group)
221 %attr(644,root
,root
) /etc
/cron.d
/*
222 %attr(755,root
,root
) /opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.py
223 %attr(644,root
,root
) /opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.pyc
224 %attr(644,root
,root
) /opt
/monitor
/op5
/nacoma
/hooks
/save
/ninja_hooks.pyo
225 %attr(-,root
,%daemon_group) /etc
/%{httpconfdir}/monitor
-ninja.conf
227 %exclude %prefix/test
228 %exclude %prefix/modules
/test
229 %exclude %prefix/Makefile
230 %exclude %prefix/features
231 %exclude %prefix/application
/config
/custom
/exception.php
234 %defattr(-,root
,root
)
235 %phpdir/op5
/ninja_sdk
239 %defattr(-,monitor
,%daemon_group)
245 %prefix/application
/config
/custom
/exception.php