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