Merge branch 'master' into eg310
[sitka/sitka-tools.git] / deployment / install-eg.sh
CommitLineData
0155bbac
JD
1#!/bin/bash
2# IMPORTANT! This script assumes you have already installed OpenSRF.
3
79b2efa0 4HOSTNAME="nonprod"
8da49eaf 5DEFAULT_USER="opensrf"
bd4a0e27 6INSTALL_USER="opensrf"
bd4a0e27 7#EGRELEASE="Evergreen-ILS-2.12.beta"
9bb70e10 8#BUILDDIR="/home/${INSTALL_USER}/${EGRELEASE}"
9BUILDDIR="/home/${INSTALL_USER}/evergreen"
0155bbac 10INSTALLDIR="/srv/openils"
919fb8be
JD
11BRANCH="user/jeffdavis/upgrade-303-tpac"
12STAMP_ID="rel_3_0_3"
13ALT_STAMP_IDS="3_0_3 rel_3_0_2 3_0_2 rel_3_0_1 3_0_1 rel_3_0_0 3_0_0"
14VERSION="3.0.3.sitka.beta1"
9bb70e10 15SITKACONF="/home/${DEFAULT_USER}/sysadmin"
919fb8be 16SITKACONF_BRANCH="eg303"
341cf34e 17SITKATOOLS="/root/sitka-tools"
0155bbac 18
605401cc
JD
19THISHOST=`hostname -s`
20
e724d7db 21suwrap() {
e2ad4781 22 su -s /bin/bash -c "source ~/.bashrc ; $1" $2
e724d7db
JD
23}
24
57c67252 25while getopts ":pecwb" opt ; do
24057702
JD
26 case $opt in
27 p ) PROD="prod";;
f3b555fc 28 e ) EDI="edi";;
286e0b2b 29 c ) CRONTAB="crontab";;
676b054f 30 w ) WEBCLIENT="webclient";;
57c67252 31 b ) USEBUNDLE="usebundle";;
24057702
JD
32 esac
33done
34shift $(($OPTIND - 1))
35
36if [[ -n "$PROD" ]] ; then
37 echo 'this is a production install'
34f86bbc 38 [ "$HOSTNAME" == "nonprod" ] && HOSTNAME="prod"
24057702
JD
39else
40 echo 'this is NOT a production install'
41fi
42
0155bbac
JD
43# as DEFAULT_USER
44
45# grab Sitka config files
46if [ ! -d "${SITKACONF}" ]
47then
48 # this will fail unless DEFAULT_USER has read access to the repo
9bb70e10 49 suwrap "cd /home/${DEFAULT_USER} && git clone git+ssh://git@git.sitka.bclibraries.ca/sitka-infra/sysadmin" ${DEFAULT_USER}
0155bbac 50fi
902a19b7 51suwrap "cd ${SITKACONF} && git fetch origin && git checkout ${SITKACONF_BRANCH} && git pull" ${DEFAULT_USER}
0155bbac
JD
52
53# checkout EG source
ae9cb412
JD
54if [ ! -d "${BUILDDIR}" ]
55then
9bb70e10 56 suwrap "cd /home/${INSTALL_USER} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${INSTALL_USER}
ae9cb412 57fi
bd4a0e27 58suwrap "cd ${BUILDDIR} && git fetch origin && git checkout ${BRANCH} && git pull" ${INSTALL_USER}
71f85432
JD
59
60# download and unpack EG release
ae9cb412 61#rm -rf ${BUILDDIR}
9bb70e10 62#suwrap "cd /home/${INSTALL_USER} && wget http://open-ils.org/downloads/${EGRELEASE}.tar.gz && tar xzf ${EGRELEASE}.tar.gz" ${INSTALL_USER}
0155bbac
JD
63
64# as root
71f85432 65cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-trusty
676b054f
JD
66if [[ -n "$WEBCLIENT" ]] ; then
67 cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-trusty-developer # required for web client
68fi
0155bbac
JD
69# by default, CPAN needs some manual input at this point; you can just accept all defaults
70
a4d987d6 71# web client
72if [[ -n "$WEBCLIENT" ]] ; then
57c67252
JD
73 if [[ -n "$USEBUNDLE" ]] ; then
74 # use bundled web client dependencies from upstream
75 if [ ! -d "/home/${INSTALL_USER}/web-client-deps" ] ; then
76 suwrap "cd /home/${INSTALL_USER} && git clone git://git.sitka.bclibraries.ca/sitka/web-client-deps web-client-deps" ${INSTALL_USER}
77 fi
78 suwrap "cd /home/${INSTALL_USER}/web-client-deps && git checkout ${STAMP_ID}" ${INSTALL_USER}
79 if [ -d "${BUILDDIR}/Open-ILS/web/js/ui/default/staff/build" ] ; then rm -rf ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/build ; fi
80 suwrap "cp -r /home/${INSTALL_USER}/web-client-deps/build ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/build" ${INSTALL_USER}
81 else
82 # install dependencies
83 cd ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/
84 suwrap "npm install" ${INSTALL_USER}
85 suwrap "bower install" ${INSTALL_USER}
86 fi
a4d987d6 87 suwrap "grunt all" ${INSTALL_USER} || { echo 'Could not install files for web-based staff client' ; exit 1; }
88fi
89
bd4a0e27
JD
90# as INSTALL_USER
91suwrap "cd ${BUILDDIR} && autoreconf -i" ${INSTALL_USER} # not required for release versions
92suwrap "PATH=${INSTALLDIR}/bin:\$PATH cd ${BUILDDIR} && PATH=${INSTALLDIR}/bin:\$PATH ./configure -C --prefix=${INSTALLDIR} --sysconfdir=${INSTALLDIR}/conf --with-opensrf-headers=${INSTALLDIR}/include/ --with-opensrf-libs=${INSTALLDIR}/lib/" ${INSTALL_USER}
93suwrap "cd ${BUILDDIR} && make" ${INSTALL_USER}
94suwrap "cd ${BUILDDIR}/build/i18n && make LOCALE=fr-CA install && make LOCALE=en-CA install" ${INSTALL_USER}
0155bbac
JD
95
96# as root
4115cc36 97cd ${BUILDDIR} && make STAFF_CLIENT_VERSION=${VERSION} STAFF_CLIENT_STAMP_ID=${STAMP_ID} install
ae9cb412 98mv ${INSTALLDIR}/var/web/reports/fm_IDL.xml ${INSTALLDIR}/var/web/reports/fm_IDL.xml.orig && cp ${INSTALLDIR}/conf/fm_IDL.xml ${INSTALLDIR}/var/web/reports/
0155bbac
JD
99
100# Apache stuff (as root):
ef6f3a9f 101APACHEFILES="/etc/apache2/mods-available/mpm_prefork.conf"
0155bbac
JD
102for APACHEFILE in ${APACHEFILES}
103do
a4d987d6 104 [[ -e "${APACHEFILE}" ]] && mv ${APACHEFILE} ${APACHEFILE}.`date +%Y-%m-%d-%H%M%S`
40ce1f36 105 cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
0155bbac 106done
ef6f3a9f
JD
107cp ${BUILDDIR}/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup
108sed -i 's/export APACHE_RUN_USER=www-data/export APACHE_RUN_USER=opensrf/' /etc/apache2/envvars
a4d987d6 109a2dismod mpm_event
110a2enmod mpm_prefork
ef6f3a9f 111a2enmod headers
71f85432
JD
112# ensure opensrf can run Apache
113chown -R opensrf:opensrf /var/lock/apache2
7d30f3bf 114
ef6f3a9f 115# More Apache stuff for non-production sites
605401cc 116if [[ ! -n "$PROD" ]] ; then
09cde232
JD
117 if [ ! -d "/etc/apache2/includes" ] ; then
118 mkdir /etc/apache2/includes
119 fi
ef6f3a9f 120 SITECONFIGS="/etc/apache2/sites-available/test-server.conf"
605401cc 121 for SITECONFIG in ${SITECONFIGS} ; do
605401cc
JD
122 cp ${SITKACONF}/files/${SITECONFIG}/${HOSTNAME} ${SITECONFIG}
123 sed -i "s|__NONPROD__|${THISHOST}|g" ${SITECONFIG}
3148afad 124 sed -i "s|__VERSION__|${VERSION}|g" ${SITECONFIG}
605401cc 125 done
ef6f3a9f
JD
126 a2ensite test-server.conf
127 a2dissite 000-default
884250a7
JD
128 if [ ! -d "/etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop" ]
129 then
130 mkdir -p /etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop
131 cp ${SITKACONF}/files/etc/ssl/apache2/star.catalogue.libraries.coop/star.catalogue.libraries.coop.crt /etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop/star_catalogue_libraries_coop.crt
132 cp ${SITKACONF}/files/etc/ssl/apache2/star.catalogue.libraries.coop/star.catalogue.libraries.coop.key /etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop/star_catalogue_libraries_coop.key
133 cp ${SITKACONF}/files/etc/ssl/apache2/star.catalogue.libraries.coop/star.catalogue.libraries.coop.ca /etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop/star_catalogue_libraries_coop.ca
134 fi
605401cc
JD
135fi
136
7b2b5e72
JD
137# websockets config
138if [[ -n "$WEBCLIENT" ]] ; then
139 # use nginx proxy for websockets traffic
140 apt-get install -y nginx
cd706301 141 cp -b ${SITKACONF}/files/etc/nginx/sites-available/osrf-ws-http-proxy/${HOSTNAME} /etc/nginx/sites-available/osrf-ws-http-proxy
7b2b5e72
JD
142 ln -s /etc/nginx/sites-available/osrf-ws-http-proxy /etc/nginx/sites-enabled/osrf-ws-http-proxy
143 rm /etc/nginx/sites-enabled/default
144 cp -b ${SITKACONF}/files/etc/apache2/ports.conf/${HOSTNAME} /etc/apache2/ports.conf
145 WSJSFILES="opensrf_ws.js opensrf_ws_shared.js"
146 for WSJSFILE in ${WSJSFILES} ; do
147 # NOTE: this should be unnecessary if we installed OpenSRF with ./configure --with-websockets-port=443
148 sed -i 's/var WEBSOCKET_PORT_SSL = 7682;/var WEBSOCKET_PORT_SSL = 443;/g' ${INSTALLDIR}/lib/javascript/$WSJSFILE
149 done
150 # apache2-websockets
151 if [[ ! -n "$PROD" ]] ; then
152 if [ ! -d "/etc/apache2-websockets/ssl" ] ; then
153 cd /etc/apache2-websockets/ && ln -s /etc/apache2/ssl
154 fi
7b2b5e72 155 fi
e4d4fe00 156 if [ ! -d "/etc/apache2-websockets/includes" ] ; then
157 mkdir /etc/apache2-websockets/includes
158 fi
159 for WSINCLUDE in `ls /etc/apache2/includes` ; do
160 ln -s /etc/apache2/includes/${WSINCLUDE} /etc/apache2-websockets/includes/
161 done
162 for WSSITE in `ls /etc/apache2/sites-available` ; do
163 ln -s /etc/apache2/sites-available/${WSSITE} /etc/apache2-websockets/sites-available/
e4d4fe00 164 done
f641a675
JD
165 for WSSITEENABLED in `ls /etc/apache2/sites-enabled` ; do
166 ln -s /etc/apache2-websockets/sites-available/${WSSITEENABLED} /etc/apache2-websockets/sites-enabled/
167 done
168 if [[ -d "/etc/apache2-websockets/ssl" ]] ; then
169 rm -rf /etc/apache2-websockets/ssl
170 fi
171 cd /etc/apache2-websockets && ln -s /etc/apache2/ssl
7b2b5e72
JD
172fi
173
286e0b2b
JD
174# install default crontab, if specified
175if [[ -c "$CRONTAB" ]]; then
176 if [ ! -f "/etc/cron.d/evergreen-dailies" ] ; then
177 cp ${SITKACONF}/files/etc/cron.d/evergreen-dailies/${HOSTNAME} /etc/cron.d/evergreen-dailies
178 fi
179fi
180
26b3ea66 181# set up log rotation
702f0bd2
JD
182if [[ ! -n "$PROD" ]] ; then
183 if [ ! -f "/etc/logrotate.d/evergreen" ]
184 then
185 cp ${SITKACONF}/files/etc/logrotate.d/evergreen/${HOSTNAME} /etc/logrotate.d/evergreen
186 fi
26b3ea66 187fi
bcd0a18c
JD
188
189# action trigger filters (prod only)
190if [[ -n "$PROD" ]] ; then
191 if [ -f "${INSTALLDIR}/conf/action_trigger_filters.json" ] ; then
192 mv ${INSTALLDIR}/conf/action_trigger_filters.json ${INSTALLDIR}/conf/action_trigger_filters.json.`date +%Y-%m-%d-%H%M%S`
193 fi
194 cp ${SITKACONF}/files/${INSTALLDIR}/conf/action_trigger_filters.json/${HOSTNAME} ${INSTALLDIR}/conf/action_trigger_filters.json
195fi
0155bbac 196
0155bbac
JD
197# 0. osrf conf stuff
198# FIXME: ensure osrf conf files point at a real, distinct db!
199OSRFCONFFILES="${INSTALLDIR}/conf/opensrf.xml ${INSTALLDIR}/conf/opensrf_core.xml"
200for OSRFCONFFILE in ${OSRFCONFFILES}
201do
40ce1f36
JD
202 mv ${OSRFCONFFILE} ${OSRFCONFFILE}.`date +%Y-%m-%d-%H%M%S`
203 cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
204 sed -i "s|__HOSTNAME__|${THISHOST}|g" ${OSRFCONFFILE}
0155bbac 205done
661d99f4 206if [ ! -f "/home/opensrf/.srfsh.xml" ]
9d46f12d 207then
661d99f4 208 cp ${SITKACONF}/files/home/opensrf/.srfsh.xml/${HOSTNAME} /home/opensrf/.srfsh.xml
9d46f12d
JD
209fi
210
0155bbac 211# 1. install dojo
abcafeff 212if [ ! -f "/home/opensrf/dojo-release-1.3.3.tar.gz" ]
51a4755a
JD
213then
214 cd /home/opensrf && wget http://download.dojotoolkit.org/release-1.3.3/dojo-release-1.3.3.tar.gz
215fi
0155bbac
JD
216tar -C ${INSTALLDIR}/var/web/js -xzf /home/opensrf/dojo-release-1.3.3.tar.gz
217cp -r ${INSTALLDIR}/var/web/js/dojo-release-1.3.3/* ${INSTALLDIR}/var/web/js/dojo/.
4b074e2e
JD
218# FIXME stock dojo is probably superfluous when we use the following Evergreen-specific tarball...
219if [ ! -f "/home/opensrf/dojo.tgz" ] ; then
220 cd /home/opensrf && wget http://evergreen-ils.org/downloads/dojo.tgz
221fi
222tar -C ${INSTALLDIR}/var/web/js/dojo/ -zxf /home/opensrf/dojo.tgz
0155bbac
JD
223
224# 2. set up staff client
9d46f12d 225cd ${INSTALLDIR}/var/web/xul && rm server && rm current
0155bbac 226cd ${INSTALLDIR}/var/web/xul && ln -s ${STAMP_ID} current && ln -s current/server server
03b5e41f
JD
227for ALT_STAMP_ID in ${ALT_STAMP_IDS}
228do
229 cd ${INSTALLDIR}/var/web/xul && ln -s current ${ALT_STAMP_ID}
230done
0155bbac 231
9d46f12d 232# 3. install circ scripts and opac skins - DEPRECATED
71f85432 233
96b76bbb
JD
234# 4a. avoid 404s
235touch ${INSTALLDIR}/var/web/css/skin/default/register_custom.css
236touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/patron_custom.properties
237touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/common_custom.properties
238touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/offline_custom.properties
239touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/auth_custom.properties
240touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/cat_custom.properties
241touch ${INSTALLDIR}/var/web/xul/server/locale/en-CA/circ_custom.properties
242touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/patron_custom.properties
243touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/common_custom.properties
244touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/offline_custom.properties
245touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/auth_custom.properties
246touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/cat_custom.properties
247touch ${INSTALLDIR}/var/web/xul/server/locale/en-US/circ_custom.properties
248touch ${INSTALLDIR}/var/web/xul/server/skin/custom.js
249
250# 4b. workaround for LP#1461683
251cd ${INSTALLDIR}/var/web/xul/server/locale/en-CA && mv multiclass_search_help.html multiclass_search_help.html.orig && ln -s ../en-US/multiclass_search_help.html
71f85432
JD
252
253# 5. locale hack - XXX deprecated?
254#cd ${INSTALLDIR}/var/web/opac/locale && cp -fdr en-US en-US-bak && cp -fdr en-CA en-US
0155bbac
JD
255
256# 6. deletepatron
257# ensure apache conf contains deletepatron config (location should be ${INSTALLDIR}/var/web/deletepatron)
437b75c1
JD
258if [[ ! -d "${INSTALLDIR}/var/web/deletepatron" ]] ; then
259 NEW_DELETEPATRON_INSTALL="true"
260 cd ${INSTALLDIR}/var/web && git clone https://github.com/twirlip/deletepatron.git
261fi
262cd ${INSTALLDIR}/var/web/deletepatron && git checkout eg22
263if [[ -n "$NEW_DELETEPATRON_INSTALL" ]] ; then
264 find ${INSTALLDIR}/var/web/deletepatron -name "*.pm" | xargs sed -i -e 's|/openils|/srv/openils|g'
265fi
ae9cb412 266apt-get install -y libcgi-session-perl libhtml-template-perl
0155bbac 267
f3b555fc
JD
268# 7. support scripts
269cp ${BUILDDIR}/Open-ILS/src/support-scripts/generate_circ_notices.pl ${INSTALLDIR}/bin
22b9d1ac 270cp ${BUILDDIR}/Open-ILS/src/support-scripts/oils_header.pl ${INSTALLDIR}/bin
9c35266e 271cp ${BUILDDIR}/Open-ILS/src/support-scripts/badge_score_generator.pl ${INSTALLDIR}/bin
f3b555fc
JD
272
273# 7.5 EDI (optional)
274if [[ -n "$EDI" ]] ; then
275 cp -r ${BUILDDIR}/Open-ILS/src/edi_translator ${INSTALLDIR}/var/edi
276 cd ${INSTALLDIR}/var/edi && ./install.sh
277 cp ${BUILDDIR}/Open-ILS/src/support-scripts/edi_pusher.pl ${INSTALLDIR}/bin
278 cp ${BUILDDIR}/Open-ILS/src/support-scripts/edi_fetcher.pl ${INSTALLDIR}/bin
279 cp ${SYSADMIN}/files/${INSTALLDIR}/bin/edi_per_account_fetcher.sh ${INSTALLDIR}/bin/edi_per_account_fetcher.sh
280fi
0155bbac 281
c05e3516
JD
282# 8. setup start page
283if [ ! -d "${INSTALLDIR}/var/web/news" ]
284then
285 mkdir ${INSTALLDIR}/var/web/news
286fi
24057702
JD
287if [ ! -d "${INSTALLDIR}/var/web/news/media" ]
288then
289 mkdir ${INSTALLDIR}/var/web/news/media
290fi
291NEWSFILES="index.html style.css media/logo.png media/book.png media/policy.png media/dash.png media/delete.png"
c05e3516
JD
292for NEWSFILE in ${NEWSFILES}
293do
294 if [ -f "${SITKACONF}/files/${INSTALLDIR}/var/web/news/${NEWSFILE}/${HOSTNAME}" ]
295 then
296 cp ${SITKACONF}/files/${INSTALLDIR}/var/web/news/${NEWSFILE}/${HOSTNAME} ${INSTALLDIR}/var/web/news/${NEWSFILE}
297 fi
298done
24057702
JD
299if [[ -n "$PROD" ]] ; then
300 if [ ! -e "${INSTALLDIR}/var/web/news/wikipull.pl" ] ; then cp ${SITKACONF}/files/${INSTALLDIR}/var/web/news/wikipull.pl/${HOSTNAME} ${INSTALLDIR}/var/web/news/wikipull.pl ; fi
301 if [ ! -e "/etc/cron.d/news" ] ; then cp ${SITKACONF}/files/etc/cron.d/news/${HOSTNAME} /etc/cron.d/news ; fi
5edb204e
JD
302else
303 # nonprod server, auto-update splash page with install info
5edb204e 304 TODAY=`date +'%A %d %B %Y'`
605401cc
JD
305 sed -i "s|__THISHOST__|${THISHOST}|g" ${INSTALLDIR}/var/web/news/index.html
306 sed -i "s|__TODAY__|${TODAY}|g" ${INSTALLDIR}/var/web/news/index.html
307 sed -i "s|__VERSION__|${VERSION}|g" ${INSTALLDIR}/var/web/news/index.html
308 sed -i "s|__BRANCH__|${BRANCH}|g" ${INSTALLDIR}/var/web/news/index.html
24057702 309fi
c05e3516 310
341cf34e 311# 8.5 offline patron list
24057702
JD
312if [ ! -d "${INSTALLDIR}/var/data/offline/blocked" ] ; then
313 # TODO: handle prod - an NFS share should exist
314 if [[ ! -n "$PROD" ]] ; then
315 mkdir -p ${INSTALLDIR}/var/data/offline/blocked
316 fi
317fi
437b75c1 318if [ ! -e "${INSTALLDIR}/var/web/standalone/list.txt" ] ; then ln -sf ${INSTALLDIR}/var/data/offline/blocked/patron-block-list.txt ${INSTALLDIR}/var/web/standalone/list.txt ; fi
341cf34e
JD
319if [ ! -e "${INSTALLDIR}/bin/update-offline-blocked-list.sh" ] ; then cp ${SITKATOOLS}/maintenance/update-offline-blocked-list.sh ${INSTALLDIR}/bin/update-offline-blocked-list.sh ; fi
320
f37d71da 321cp ${SITKACONF}/files${INSTALLDIR}/var/data/zips.txt/${HOSTNAME} ${INSTALLDIR}/var/data/zips.txt
661d99f4 322
f5bb272b
JD
323# install legacy OverDrive API integration
324cp -r ${SITKATOOLS}/overdrive-eg-opac/build/* ${INSTALLDIR}/var/web/js/ui/default/opac
325ODAPI_LIBS="bc mb"
326for ODAPI_LIB in ${ODAPI_LIBS} ; do
327 cp ${SITKACONF}/files/${INSTALLDIR}/var/web/js/ui/default/opac/${ODAPI_LIB}/od_config.js ${INSTALLDIR}/var/web/js/ui/default/opac/${ODAPI_LIB}/od_config.js
328done
02bd66d5 329
ea5fbaea
JD
330# install mobile PAC
331cd ${INSTALLDIR}/var/web/opac/extras && git clone git://git.sitka.bclibraries.ca/sitka/mobile-evergreen-opac.git mobile
332
c05e3516 333# 9. make sure opensrf owns all the stuff we just did
b7afc39d 334echo 'managing file permissions...'
af205db8
JD
335if [[ ! -n "$PROD" ]] ; then
336 chown -R opensrf:opensrf ${INSTALLDIR} 2>/dev/null
337else
338 for file in `ls -1 ${INSTALLDIR} | grep -v var` ; do chown -R opensrf:opensrf ${INSTALLDIR}/$file ; done
339 chown opensrf:opensrf ${INSTALLDIR}/var
340 for file in `ls -1 ${INSTALLDIR}/var | egrep -v '(data|tmp|web)'` ; do chown -R opensrf:opensrf ${INSTALLDIR}/var/$file ; done
341 chown opensrf:opensrf ${INSTALLDIR}/var/data ${INSTALLDIR}/var/web
342 for file in `ls -1 ${INSTALLDIR}/var/data | grep -v offline` ; do chown -R opensrf:opensrf ${INSTALLDIR}/var/data/$file ; done
343 for file in `ls -1 ${INSTALLDIR}/var/web | grep -v reporter` ; do chown -R opensrf:opensrf ${INSTALLDIR}/var/web/$file ; done
344fi
d4e88b8a 345chown -R opensrf:opensrf /home/opensrf
7f126d3b
JD
346SKINDIRS="${INSTALLDIR}/var/skins ${INSTALLDIR}/var/web/css/skin"
347for SKINDIR in ${SKINDIRS} ; do
348 if [[ ! -d "${SKINDIR}" ]] ; then mkdir ${SKINDIR} ; fi
349 chmod 777 ${SKINDIR}
bd4a0e27 350 chown -R ${DEFAULT_USER}:${DEFAULT_USER} ${SKINDIR}
7f126d3b 351done
bd4a0e27 352chown -R ${DEFAULT_USER}:${DEFAULT_USER} ${INSTALLDIR}/conf/kpac ${INSTALLDIR}/var/web/images/kpac
0155bbac 353
d4e88b8a 354# 10. staff client stuff
ae9cb412 355apt-get install -y nsis unzip
089f11fb
JD
356
357# 11. integrity checker prereqs
ae9cb412 358apt-get install -y libconfig-simple-perl libgit-repository-perl libdate-manip-perl
ee1de43f
JD
359
360# 12. paper overdue prereqs
5e12a76f 361apt-get install -y python-reportlab python-reportlab-accel unifont
6298f1c5 362
a4d987d6 363echo 'Evergreen is installed!'
676b054f 364if [[ -n "$WEBCLIENT" ]] ; then
6298f1c5
JD
365 echo 'Remember to start the websockets service: /etc/init.d/apache2-websockets start'
366fi
367