Warning, file /sdk/codevis/thirdparty/soci/scripts/ci/install_db2.sh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #!/usr/bin/env bash
0002 # Installs DB2 for SOCI build in CI builds
0003 #
0004 # Copyright (c) 2013 Brian R. Toonen <toonen@alcf.anl.gov>
0005 # Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
0006 #
0007 set -e
0008 sudo bash -c 'echo "deb http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list'
0009 run_apt update
0010 run_apt install db2exc
0011 
0012 echo "Running db2profile and db2rmln"
0013 sudo /bin/sh -c '. ~db2inst1/sqllib/db2profile ; $DB2DIR/cfg/db2rmln'
0014 
0015 echo "Setting up db2 users"
0016 echo -e "db2inst1\ndb2inst1" | sudo passwd db2inst1
0017 echo -e "db2fenc1\ndb2fenc1" | sudo passwd db2fenc1
0018 echo -e "dasusr1\ndasusr1" | sudo passwd dasusr1
0019 
0020 echo "Configuring DB2 ODBC driver"
0021 if test `getconf LONG_BIT` = "64" ; then
0022     if test -f /home/db2inst1/sqllib/lib64/libdb2o.so ; then
0023         DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib64/libdb2o.so
0024     else
0025         echo "ERROR: can't find the 64-bit DB2 ODBC library"
0026         exit 1
0027     fi
0028 else
0029     if test -f /home/db2inst1/sqllib/lib32/libdb2.so ; then
0030         DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib32/libdb2.so
0031     elif test -f /home/db2inst1/sqllib/lib/libdb2.so ; then
0032         DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib/libdb2.so
0033     else
0034         echo "ERROR: can't find the 32-bit DB2 ODBC library"
0035         exit 1
0036     fi
0037 fi
0038 echo "DB2 ODBC driver set to $DB2_ODBC_DRIVER"