lsfilter: Add support for non-timestamp date formats
[ninja.git] / op5build / solaris / build
blob40fd56f92aefa2d844339b281a6f2786b6d15cdf
1 #!/bin/bash
3 builddir=$1
4 if [ ! -d "$builddir" ]; then
5 echo "I can not put my files in $builddir because it doesn't exist"
6 exit 1
7 fi
9 prefix='/opt/monitor/op5/ninja'
10 AP2CONFDIR='/etc/opt/csw/apache2/extra'
11 gsed=/opt/csw/bin/gsed
12 PATH_DEF=`echo $PATH`
13 PATH=/usr/sbin:/usr/bin:/opt/csw/bin/:/opt/csw/gcc3/bin:/usr/ccs/bin
15 rm -rf $builddir
16 ninja_dir=$builddir$prefix
17 mkdir -p $ninja_dir
19 pushd cli-helpers
20 make clean
21 make
22 popd
23 make docs
25 # Whitelist instead of blacklist
26 cp -r Documentation \
27 Kohana_License.html \
28 NinjaPDO.inc.php \
29 README \
30 application \
31 cli-helpers \
32 docs \
33 example.htaccess \
34 generateKohanaDbFieldData.php \
35 geomap-thumb.png \
36 install_scripts \
37 modules \
38 op5-upgradescripts \
39 system \
40 index.php \
41 $ninja_dir
43 # The build script always looks for the op5build dir in the build root,
44 # to use it *for* packaging, not include it *in* the package.
45 cp -r op5build $builddir
47 $gsed -i \
48 -e 's,^\(.config..site_domain.. = .\)/ninja/,\1/monitor/,' \
49 -e 's/^\(.config..product_name.. = .\)Nagios/\1op5 Monitor/' \
50 -e 's/^\(.config..show_cgi_links.. = .\)true/\1false/' \
51 -e 's/^\(.config..version_info.. = .\)\/etc\/ninja-release/\1\/etc\/op5-monitor-release/' \
52 $ninja_dir/application/config/config.php
54 $gsed -i -e "s/'IN_PRODUCTION', FALSE/'IN_PRODUCTION', TRUE/" $ninja_dir/index.php
56 # Used for the enterprise edition of Ninja
57 cp $builddir/op5build/login.png $ninja_dir/application/views/css/default/images
58 cp $builddir/op5build/favicon.ico $ninja_dir/application/views/icons/16x16/
59 cp $builddir/op5build/icon.png $ninja_dir/application/views/icons/
61 chmod -R a+r $ninja_dir
63 mkdir -p $builddir/etc/cron.d/
64 install -m 644 -c $builddir/etc/cron.d/ install_scripts/scheduled_reports.crontab
65 install -m 644 -c $builddir/etc/cron.d/ install_scripts/recurring_downtime.crontab
67 /opt/csw/bin/gsed -i -e 's/default\/cron/cron\/cron/' \
68 $builddir/etc/cron.d/scheduled_reports.crontab
69 /opt/csw/bin/gsed -i -e 's/\/usr\/bin\/php/\/opt\/csw\/php5\/bin\/php/' \
70 $builddir/etc/cron.d/scheduled_reports.crontab
71 /opt/csw/bin/gsed -i -e 's/\/usr\/bin\/php/\/opt\/csw\/php5\/bin\/php/' \
72 $builddir/etc/cron.d/recurring_downtime.crontab
73 /opt/csw/bin/gsed -i -e 's/\/usr\/bin\/php/\/opt\/csw\/php5\/bin\/php/' \
74 $builddir/opt/monitor/op5/ninja/application/controllers/default.php
75 /opt/csw/bin/gsed -i 's#tar tfz#/opt/csw/bin/gtar tfz#' $builddir/opt/monitor/op5/ninja/application/controllers/backup.php
77 # executables
78 for f in cli-helpers/apr_md5_validate install_scripts/ninja_db_init.sh;
80 chmod 755 $ninja_dir/$f
81 done
83 # The custom_widgets dir need to be writable by the apache user
84 chmod 775 $ninja_dir/application/custom_widgets
86 mkdir -p $builddir/var/www/html
87 ln -sf $prefix $builddir/var/www/html/monitor
88 ln -sf $prefix $builddir/var/www/html/ninja
90 mkdir -p $builddir$AP2CONFDIR
91 cp $builddir/op5build/solaris/ninja.httpd-conf $builddir$AP2CONFDIR/ninja.conf
94 PATH=$PATH_DEF