LP#1743220: Update script to accommodate Ubuntu 16.04.
[Evergreen.git] / Open-ILS / src / edi_translator / install-ubuntu.sh
1 #!/bin/bash
2 # hopefully this is all temporary
3
4 UBUNTU_RELEASE=$(lsb_release -sc)
5 if [ "$UBUNTU_RELEASE" == "xenial" ]; then
6     RUBY_VERSION="2.3.0"
7 elif [ "$UBUNTU_RELEASE" == "trusty" ]; then
8     RUBY_VERSION="1.9.1"
9 else 
10     echo "Could not determine your Ubuntu release."
11     echo "Please consult $0 and install manually."
12     exit 1
13 fi
14
15 # install ruby via APT
16 sudo apt-get install rubygems-integration ruby-dev
17
18 # install gem dependencies
19 sudo gem install parseconfig rspec edi4r edi4r-tdid json openils-mapper
20
21 # clone berick's openils-mapper repo
22 git clone https://github.com/berick/openils-mapper
23 cd openils-mapper
24 # move openils-mapper files into place
25 git checkout -b GIR-segments-for-copy-data origin/GIR-segments-for-copy-data
26 sudo cp lib/openils/mapper.rb /var/lib/gems/$RUBY_VERSION/gems/openils-mapper-0.9.9/lib/openils/mapper.rb
27 sudo cp lib/edi/mapper.rb /var/lib/gems/$RUBY_VERSION/gems/openils-mapper-0.9.9/lib/edi/mapper.rb