add Angular (eg2) install steps
[sitka/sitka-tools.git] / deployment / install-eg.sh
index d1c2c66..d4ad0a6 100755 (executable)
@@ -2,18 +2,16 @@
 # IMPORTANT! This script assumes you have already installed OpenSRF.
 
 HOSTNAME="nonprod"
-DEFAULT_USER="sitkastaff"
-HOMEDIR="/home/${DEFAULT_USER}"
-#EGRELEASE="Evergreen-ILS-2.10.beta"
-#BUILDDIR="${HOMEDIR}/${EGRELEASE}"
-BUILDDIR="${HOMEDIR}/evergreen"
+DEFAULT_USER="opensrf"
+INSTALL_USER="opensrf"
+BUILDDIR="/home/${INSTALL_USER}/evergreen"
 INSTALLDIR="/srv/openils"
-BRANCH="production/sitka_2_10_tpac"
-STAMP_ID="rel_2_10_2"
-ALT_STAMP_IDS="rel_2_10_2_sitka_0 2_10_2_sitka_0 2_10_2 rel_2_10_1 2_10_1 rel_2_10_0 2_10_0 rel_2_10_beta 2_10_beta"
-VERSION="2.10.2.sitka.0"
-SITKACONF="${HOMEDIR}/sysadmin"
-SITKACONF_BRANCH="eg210"
+BRANCH="user/jeffdavis/eg317-tpac"
+STAMP_ID="rel_3_1_7"
+ALT_STAMP_IDS="3_1_7"
+VERSION="3.1.7.sitka.1"
+SITKACONF="/home/${DEFAULT_USER}/sysadmin"
+SITKACONF_BRANCH="master"
 SITKATOOLS="/root/sitka-tools"
 
 THISHOST=`hostname -s`
@@ -22,17 +20,22 @@ suwrap() {
   su -s /bin/bash -c "source ~/.bashrc ; $1" $2
 }
 
-while getopts ":p" opt ; do
+while getopts ":pecWbtu" opt ; do
   case $opt in
     p ) PROD="prod";;
     e ) EDI="edi";;
     c ) CRONTAB="crontab";;
+    W ) SKIPWEBCLIENT="skipwebclient";;
+    b ) USEBUNDLE="usebundle";;
+    t ) TARBALL="tarball";;
+    u ) UPDATEONLY="updateonly";;
   esac
 done
 shift $(($OPTIND - 1))
 
 if [[ -n "$PROD" ]] ; then
   echo 'this is a production install'
+  [ "$HOSTNAME" == "nonprod" ] && HOSTNAME="prod"
 else
   echo 'this is NOT a production install'
 fi
@@ -43,61 +46,160 @@ fi
 if [ ! -d "${SITKACONF}" ]
 then
   # this will fail unless DEFAULT_USER has read access to the repo
-  suwrap "cd ${HOMEDIR} && git clone git+ssh://git@git.sitka.bclibraries.ca/sitka-infra/sysadmin" ${DEFAULT_USER}
+  suwrap "cd /home/${DEFAULT_USER} && git clone git+ssh://git@git.sitka.bclibraries.ca/sitka-infra/sysadmin" ${DEFAULT_USER} || { echo "Could not get config files; exiting." ; exit 1; }
 fi
-suwrap "cd ${SITKACONF} && git fetch origin && git checkout ${SITKACONF_BRANCH} && git pull" ${DEFAULT_USER}
+suwrap "cd ${SITKACONF} && git fetch origin && git checkout ${SITKACONF_BRANCH} && git pull" ${DEFAULT_USER} || { echo "Could not checkout ${SITKACONF_BRANCH} config files; exiting." ; exit 1; }
 
-# checkout EG source
-if [ ! -d "${BUILDDIR}" ]
-then
-  suwrap "cd ${HOMEDIR} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${DEFAULT_USER}
+if [[ -n "$TARBALL" ]] ; then
+  EGRELEASE="Evergreen-ILS-${VERSION}"
+  EGRELEASETGZ="${EGRELEASE}.tar.gz"
+  [ ${VERSION} == "3.1.0" ] && EGRELEASETGZ="Evergreen-ILS-3.1.0a.tar.gz"
+  BUILDDIR="/home/${INSTALL_USER}/${EGRELEASE}"
+  BRANCH="$VERSION"
+  echo "installing packaged upstream release ${EGRELEASE}"
+  # download and unpack EG release
+  rm -rf ${BUILDDIR}
+  if [ ! -f "/home/${INSTALL_USER}/${EGRELEASETGZ}" ] ; then
+    suwrap "cd /home/${INSTALL_USER} && wget http://open-ils.org/downloads/${EGRELEASETGZ}" ${INSTALL_USER} || { echo "Could not download EG release tarball ${EGRELEASETGZ}" ; exit 1; }
+  fi
+  suwrap "cd /home/${INSTALL_USER} && tar xzf ${EGRELEASETGZ}" ${INSTALL_USER}
+else
+  # checkout EG source
+  if [ ! -d "${BUILDDIR}" ]
+  then
+    suwrap "cd /home/${INSTALL_USER} && git clone git+ssh://git@git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${INSTALL_USER}
+  fi
+  suwrap "cd ${BUILDDIR} && git fetch origin && git checkout ${BRANCH} && git pull" ${INSTALL_USER}
 fi
-suwrap "cd ${BUILDDIR} && git fetch origin && git checkout ${BRANCH} && git pull" ${DEFAULT_USER}
 
-# download and unpack EG release
-#rm -rf ${BUILDDIR}
-#suwrap "cd ${HOMEDIR} && wget http://open-ils.org/downloads/${EGRELEASE}.tar.gz && tar xzf ${EGRELEASE}.tar.gz" ${DEFAULT_USER}
 # as root
-cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-trusty
-#cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-trusty-developer # required for web client
+cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-xenial
+if [[ ! -n "$TARBALL" ]] ; then
+  cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-xenial-developer # required for web client
+fi
 # by default, CPAN needs some manual input at this point; you can just accept all defaults
  
-# as DEFAULT_USER
-suwrap "cd ${BUILDDIR} && autoreconf -i" ${DEFAULT_USER} # not required for release versions
-suwrap "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/" ${DEFAULT_USER}
-suwrap "cd ${BUILDDIR} && make" ${DEFAULT_USER}
-suwrap "cd ${BUILDDIR}/build/i18n && make LOCALE=fr-CA install && make LOCALE=en-CA install" ${DEFAULT_USER}
+# web client
+if [[ ! -n "$TARBALL" && ! -n "$SKIPWEBCLIENT" ]] ; then
+  if [[ -n "$USEBUNDLE" ]] ; then
+    # use bundled web client dependencies from upstream
+    if [ ! -d "/home/${INSTALL_USER}/web-client-deps" ] ; then
+      suwrap "cd /home/${INSTALL_USER} && git clone git://git.sitka.bclibraries.ca/sitka/web-client-deps web-client-deps" ${INSTALL_USER}
+    fi
+    suwrap "cd /home/${INSTALL_USER}/web-client-deps && git checkout ${STAMP_ID}" ${INSTALL_USER}
+    if [ -d "${BUILDDIR}/Open-ILS/web/js/ui/default/staff/build" ] ; then rm -rf ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/build ; fi
+    suwrap "cp -r /home/${INSTALL_USER}/web-client-deps/build ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/build" ${INSTALL_USER}
+  else
+    # install dependencies
+    cd ${BUILDDIR}/Open-ILS/web/js/ui/default/staff/
+    suwrap "npm install" ${INSTALL_USER}
+    suwrap "npm run build-prod && npm run test" ${INSTALL_USER} || { echo 'Could not install files for AngularJS staff client' ; exit 1; }
+    cd ${BUILDDIR}/Open-ILS/src/eg2/
+    suwrap "npm install" ${INSTALL_USER}
+    suwrap "ng build --prod && npm run test" ${INSTALL_USER} || { echo 'Could not install files for Angular staff client' ; exit 1; }
+  fi
+fi
+
+# as INSTALL_USER
+[ ! -n "$TARBALL" ] && suwrap "cd ${BUILDDIR} && autoreconf -i" ${INSTALL_USER} # not required for release versions
+suwrap "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}
+suwrap "cd ${BUILDDIR} && make" ${INSTALL_USER}
+suwrap "cd ${BUILDDIR}/build/i18n && make LOCALE=fr-CA install && make LOCALE=en-CA install" ${INSTALL_USER}
  
 # as root
 cd ${BUILDDIR} && make STAFF_CLIENT_VERSION=${VERSION} STAFF_CLIENT_STAMP_ID=${STAMP_ID} install
 mv ${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/
  
+# setup start page
+if [ ! -d "${INSTALLDIR}/var/web/news" ]
+then
+  mkdir ${INSTALLDIR}/var/web/news
+fi
+if [ ! -d "${INSTALLDIR}/var/web/news/media" ]
+then
+  mkdir ${INSTALLDIR}/var/web/news/media
+fi
+NEWSFILES="index.html style.css media/logo.png media/book.png media/policy.png media/dash.png media/delete.png"
+for NEWSFILE in ${NEWSFILES}
+do
+  if [ -f "${SITKACONF}/files/${INSTALLDIR}/var/web/news/${NEWSFILE}/${HOSTNAME}" ]
+  then
+    cp ${SITKACONF}/files/${INSTALLDIR}/var/web/news/${NEWSFILE}/${HOSTNAME} ${INSTALLDIR}/var/web/news/${NEWSFILE}
+  fi
+done
+if [[ -n "$PROD" ]] ; then
+  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
+  if [ ! -e "/etc/cron.d/news" ] ; then cp ${SITKACONF}/files/etc/cron.d/news/${HOSTNAME} /etc/cron.d/news ; fi
+else
+  # nonprod server, auto-update splash page with install info
+  TODAY=`date +'%A %d %B %Y'`
+  sed -i "s|__THISHOST__|${THISHOST}|g" ${INSTALLDIR}/var/web/news/index.html
+  sed -i "s|__TODAY__|${TODAY}|g" ${INSTALLDIR}/var/web/news/index.html
+  sed -i "s|__VERSION__|${VERSION}|g" ${INSTALLDIR}/var/web/news/index.html
+  sed -i "s|__BRANCH__|${BRANCH}|g" ${INSTALLDIR}/var/web/news/index.html
+fi
+
+# setup/update test server banner
+if [[ ! -n "$PROD" ]] ; then
+  SITECONFIGS="/etc/apache2/sites-available/test-server.conf"
+  for SITECONFIG in ${SITECONFIGS} ; do
+    cp ${SITKACONF}/files/${SITECONFIG}/${HOSTNAME} ${SITECONFIG}
+    sed -i "s|__NONPROD__|${THISHOST}|g" ${SITECONFIG}
+    sed -i "s|__VERSION__|${VERSION}|g" ${SITECONFIG}
+  done
+  a2ensite test-server.conf
+fi
+
+# if we are just updating an existing EG install, we're all done!
+if [[ -n "$UPDATEONLY" ]] ; then
+    exit 0
+fi
+
+if [[ ! -n "$SKIPWEBCLIENT" ]] ; then
+    apt-get install -y nginx
+fi
+
 # Apache stuff (as root):
-APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/envvars"
+APACHEFILES="/etc/apache2/mods-available/mpm_prefork.conf"
 for APACHEFILE in ${APACHEFILES}
 do
-  mv ${APACHEFILE} ${APACHEFILE}.`date +%Y-%m-%d-%H%M%S`
+  [[ -e "${APACHEFILE}" ]] && mv ${APACHEFILE} ${APACHEFILE}.`date +%Y-%m-%d-%H%M%S`
   cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
 done
-#if [ ! -d "/etc/apache2/ssl" ]
-#then
-#  mkdir /etc/apache2/ssl
-#  cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
-#fi
+cp ${BUILDDIR}/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup
+sed -i 's/export APACHE_RUN_USER=www-data/export APACHE_RUN_USER=opensrf/' /etc/apache2/envvars
+if [ ! -d "/etc/apache2/includes" ] ; then
+  mkdir /etc/apache2/includes
+fi
+a2dismod mpm_event
+a2enmod mpm_prefork
+a2enmod headers
 # ensure opensrf can run Apache
 chown -R opensrf:opensrf /var/lock/apache2
 
-# More Apache stuff for non-production sites (we manage this with Puppet on prod)
+# More Apache stuff for non-production sites
 if [[ ! -n "$PROD" ]] ; then
-  SITECONFIGS="/etc/apache2/includes/498-ssl-star.catalogue.libraries.coop-include /etc/apache2/includes/499-rewrites.conf-include /etc/apache2/sites-available/eg.conf /etc/apache2/sites-available/499-star.catalogue.libraries.coop.conf"
-  for SITECONFIG in ${SITECONFIGS} ; do
-    mv ${SITECONFIG} ${SITECONFIG}.bak
-    cp ${SITKACONF}/files/${SITECONFIG}/${HOSTNAME} ${SITECONFIG}
-    sed -i "s|__NONPROD__|${THISHOST}|g" ${SITECONFIG}
-  done
-  a2ensite eg.conf
-  a2ensite 499-star.catalogue.libraries.coop.conf
+  a2dissite 000-default
+  if [ ! -d "/etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop" ]
+  then
+    mkdir -p /etc/apache2/ssl/libraries.coop/star.catalogue.libraries.coop
+    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
+    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
+    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
+  fi
+fi
+
+# websockets config
+if [[ ! -n "$SKIPWEBCLIENT" ]] ; then
+    cp -b ${SITKACONF}/files/etc/nginx/sites-available/osrf-ws-http-proxy/${HOSTNAME} /etc/nginx/sites-available/osrf-ws-http-proxy
+    ln -s /etc/nginx/sites-available/osrf-ws-http-proxy /etc/nginx/sites-enabled/osrf-ws-http-proxy
+    rm /etc/nginx/sites-enabled/default
+    cp -b ${SITKACONF}/files/etc/apache2/ports.conf/${HOSTNAME} /etc/apache2/ports.conf
+    WSJSFILES="opensrf_ws.js opensrf_ws_shared.js"
+    for WSJSFILE in ${WSJSFILES} ; do
+        # NOTE: this should be unnecessary if we installed OpenSRF with ./configure --with-websockets-port=443
+        sed -i 's/var WEBSOCKET_PORT_SSL = 7682;/var WEBSOCKET_PORT_SSL = 443;/g' ${INSTALLDIR}/lib/javascript/$WSJSFILE
+    done
 fi
 
 # install default crontab, if specified
@@ -107,6 +209,11 @@ if [[ -c "$CRONTAB" ]]; then
   fi
 fi
 
+# LDAP config
+if ! `diff ${SITKACONF}/files/etc/ldap/ldap.conf/${HOSTNAME} /etc/ldap/ldap.conf >/dev/null` ; then
+    cp -b --suffix=.`date +%Y-%m-%d-%H%M%S` ${SITKACONF}/files/etc/ldap/ldap.conf/${HOSTNAME} /etc/ldap/ldap.conf
+fi
+
 # set up log rotation
 if [[ ! -n "$PROD" ]] ; then
   if [ ! -f "/etc/logrotate.d/evergreen" ]
@@ -114,6 +221,25 @@ if [[ ! -n "$PROD" ]] ; then
     cp ${SITKACONF}/files/etc/logrotate.d/evergreen/${HOSTNAME} /etc/logrotate.d/evergreen
   fi
 fi
+
+# remote logging (prod only)
+if [[ -n "$PROD" ]] ; then
+  apt-get install syslog-ng
+  cp ${SITKACONF}/files/etc/syslog-ng/syslog-ng.conf/${HOSTNAME} /etc/syslog-ng/syslog-ng.conf
+  cp ${SITKACONF}/files/etc/syslog-ng/conf.d/sitka.conf/${HOSTNAME} /etc/syslog-ng/conf.d/sitka.conf
+  systemctl restart syslog-ng.service
+  cp ${SITKACONF}/files/usr/local/bin/eg-stats-collector-remote-log.pl /usr/local/bin/eg-stats-collector-remote-log.pl
+  cp ${SITKACONF}/files/usr/local/bin/eg-stats-keepalive.sh /usr/local/bin/eg-stats-keepalive.sh
+  cp ${SITKACONF}/files/etc/cron.d/eg-stats-keepalive/${HOSTNAME} /etc/cron.d/eg-stats-keepalive
+fi
+
+# action trigger filters (prod only)
+if [[ -n "$PROD" ]] ; then
+  if [ -f "${INSTALLDIR}/conf/action_trigger_filters.json" ] ; then
+    mv ${INSTALLDIR}/conf/action_trigger_filters.json ${INSTALLDIR}/conf/action_trigger_filters.json.`date +%Y-%m-%d-%H%M%S`
+  fi
+  cp ${SITKACONF}/files/${INSTALLDIR}/conf/action_trigger_filters.json/${HOSTNAME} ${INSTALLDIR}/conf/action_trigger_filters.json
+fi
  
 # 0. osrf conf stuff 
 # FIXME: ensure osrf conf files point at a real, distinct db!
@@ -121,12 +247,17 @@ OSRFCONFFILES="${INSTALLDIR}/conf/opensrf.xml ${INSTALLDIR}/conf/opensrf_core.xm
 for OSRFCONFFILE in ${OSRFCONFFILES}
 do
   mv ${OSRFCONFFILE} ${OSRFCONFFILE}.`date +%Y-%m-%d-%H%M%S`
-  cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
+  if [[ -n "$PROD" && -f "${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME}-314" ]] ; then
+    cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME}-314 ${OSRFCONFFILE}
+  else
+    cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
+  fi
   sed -i "s|__HOSTNAME__|${THISHOST}|g" ${OSRFCONFFILE}
 done
 if [ ! -f "/home/opensrf/.srfsh.xml" ]
 then
   cp ${SITKACONF}/files/home/opensrf/.srfsh.xml/${HOSTNAME} /home/opensrf/.srfsh.xml
+  sed -i "s|__HOSTNAME__|${THISHOST}|g" /home/opensrf/.srfsh.xml
 fi 
 
 # 1. install dojo
@@ -189,6 +320,7 @@ apt-get install -y libcgi-session-perl libhtml-template-perl
 # 7. support scripts
 cp ${BUILDDIR}/Open-ILS/src/support-scripts/generate_circ_notices.pl ${INSTALLDIR}/bin
 cp ${BUILDDIR}/Open-ILS/src/support-scripts/oils_header.pl ${INSTALLDIR}/bin
+cp ${BUILDDIR}/Open-ILS/src/support-scripts/badge_score_generator.pl ${INSTALLDIR}/bin
 
 # 7.5 EDI (optional)
 if [[ -n "$EDI" ]] ; then
@@ -197,35 +329,9 @@ if [[ -n "$EDI" ]] ; then
   cp ${BUILDDIR}/Open-ILS/src/support-scripts/edi_pusher.pl ${INSTALLDIR}/bin
   cp ${BUILDDIR}/Open-ILS/src/support-scripts/edi_fetcher.pl ${INSTALLDIR}/bin
   cp ${SYSADMIN}/files/${INSTALLDIR}/bin/edi_per_account_fetcher.sh ${INSTALLDIR}/bin/edi_per_account_fetcher.sh
-fi
-
-# 8. setup start page
-if [ ! -d "${INSTALLDIR}/var/web/news" ]
-then
-  mkdir ${INSTALLDIR}/var/web/news
-fi
-if [ ! -d "${INSTALLDIR}/var/web/news/media" ]
-then
-  mkdir ${INSTALLDIR}/var/web/news/media
-fi
-NEWSFILES="index.html style.css media/logo.png media/book.png media/policy.png media/dash.png media/delete.png"
-for NEWSFILE in ${NEWSFILES}
-do
-  if [ -f "${SITKACONF}/files/${INSTALLDIR}/var/web/news/${NEWSFILE}/${HOSTNAME}" ]
-  then
-    cp ${SITKACONF}/files/${INSTALLDIR}/var/web/news/${NEWSFILE}/${HOSTNAME} ${INSTALLDIR}/var/web/news/${NEWSFILE}
-  fi
-done
-if [[ -n "$PROD" ]] ; then
-  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
-  if [ ! -e "/etc/cron.d/news" ] ; then cp ${SITKACONF}/files/etc/cron.d/news/${HOSTNAME} /etc/cron.d/news ; fi
-else
-  # nonprod server, auto-update splash page with install info
-  TODAY=`date +'%A %d %B %Y'`
-  sed -i "s|__THISHOST__|${THISHOST}|g" ${INSTALLDIR}/var/web/news/index.html
-  sed -i "s|__TODAY__|${TODAY}|g" ${INSTALLDIR}/var/web/news/index.html
-  sed -i "s|__VERSION__|${VERSION}|g" ${INSTALLDIR}/var/web/news/index.html
-  sed -i "s|__BRANCH__|${BRANCH}|g" ${INSTALLDIR}/var/web/news/index.html
+  # add local modifications to openils-mapper rubygem (eww, yuck, barf)
+  cp -b ${SYSADMIN}/files/var/lib/gems/2.3.0/gems/openils-mapper-0.9.9/lib/openils/mapper.rb /var/lib/gems/2.3.0/gems/openils-mapper-0.9.9/lib/openils/mapper.rb
+  cp -b ${SYSADMIN}/files/var/lib/gems/2.3.0/gems/openils-mapper-0.9.9/lib/edi/mapper.rb /var/lib/gems/2.3.0/gems/openils-mapper-0.9.9/lib/edi/mapper.rb
 fi
 
 # 8.5 offline patron list
@@ -240,14 +346,7 @@ if [ ! -e "${INSTALLDIR}/bin/update-offline-blocked-list.sh" ] ; then cp ${SITKA
 
 cp ${SITKACONF}/files${INSTALLDIR}/var/data/zips.txt/${HOSTNAME} ${INSTALLDIR}/var/data/zips.txt
 
-cp -r ${SITKATOOLS}/overdrive-eg-opac/build/* ${INSTALLDIR}/var/web/js/ui/default/opac
-ODAPI_LIBS="bc mb"
-for ODAPI_LIB in ${ODAPI_LIBS} ; do
-  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
-done
-
-# install mobile PAC
-cd ${INSTALLDIR}/var/web/opac/extras && git clone git://git.sitka.bclibraries.ca/sitka/mobile-evergreen-opac.git mobile
+cp -b --suffix=.`date +%Y-%m-%d-%H%M%S` ${SITKACONF}/files${INSTALLDIR}/var/web/robots.txt/${HOSTNAME} ${INSTALLDIR}/var/web/robots.txt
 
 # 9. make sure opensrf owns all the stuff we just did
 echo 'managing file permissions...'
@@ -266,9 +365,9 @@ SKINDIRS="${INSTALLDIR}/var/skins ${INSTALLDIR}/var/web/css/skin"
 for SKINDIR in ${SKINDIRS} ; do
   if [[ ! -d "${SKINDIR}" ]] ; then mkdir ${SKINDIR} ; fi
   chmod 777 ${SKINDIR}
-  chown -R sitkastaff:sitkastaff ${SKINDIR}
+  chown -R ${DEFAULT_USER}:${DEFAULT_USER} ${SKINDIR}
 done
-chown -R sitkastaff:sitkastaff ${INSTALLDIR}/conf/kpac ${INSTALLDIR}/var/web/images/kpac
+chown -R ${DEFAULT_USER}:${DEFAULT_USER} ${INSTALLDIR}/conf/kpac ${INSTALLDIR}/var/web/images/kpac
 
 # 10. staff client stuff
 apt-get install -y nsis unzip
@@ -278,3 +377,6 @@ apt-get install -y libconfig-simple-perl libgit-repository-perl libdate-manip-pe
 
 # 12. paper overdue prereqs
 apt-get install -y python-reportlab python-reportlab-accel unifont
+
+echo 'Evergreen is installed!'
+