source: epd_deployment/deployment.sh @ 625

Last change on this file since 625 was 625, checked in by jemian, 12 years ago

epd install script fails when called with /bin/sh

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Rev URL
File size: 5.1 KB
Line 
1#!/bin/bash
2
3########### SVN repository information ###################
4# $Date: 2011-08-22 01:23:33 +0000 (Mon, 22 Aug 2011) $
5# $Author: jemian $
6# $Revision: 625 $
7# $URL: epd_deployment/deployment.sh $
8# $Id: deployment.sh 625 2011-08-22 01:23:33Z jemian $
9########### SVN repository information ###################
10
11# generic EPD installment/deployment procedure for /APSshare
12
13###################################################################################
14#
15# parse the command line
16#
17
18[ $# -lt 3 ] && _cmd_usage
19[ $# -gt 4 ] && _cmd_usage
20
21_cmd_usage() {
22    echo ""
23    echo "usage: $0 EPD_OS_SPECIFIC_DISTRIBUTION EPICS_LIBCA EPD_ROOT_DIR  [BITS]"
24    echo "  EPD_OS_SPECIFIC_DISTRIBUTION is the path and file of the EPD download file (a shell script)"
25    echo "  EPICS_LIBCA is the path and file of libca.so"
26    echo "  EPD_ROOT_DIR is the path in which this EPD will be deployed (installed)"
27    echo "  BITS is optional, if present, indicates that deployment is to be 32- or 64-bit (64-bit is default)"
28    echo ""
29    echo "for example:"
30    echo $0\\"
31    echo "     /APSshare/epd/downloads/epd-7.1-2-rh5-x86_64.sh \\"
32    echo "     /APSshare/epics/base-3.14.11/lib/linux-x86_64-el5/libca.so.3.14 \\"
33    echo "     /APSshare/epd \\"
34    echo "     64"
35    echo "This will deploy EPD 7.1-2 for a 64-bit RHEL6 system with EPICS 3.14.11"
36    echo "  /APSshare/epd/rh5-x86_64/bin/python"
37    echo ""
38    exit 1
39}
40
41
42###################################################################################
43#
44# establish basic definitions
45#
46
47TOOL=$0
48EPD_OS_SPECIFIC_DISTRIBUTION=$1
49EPICS_LIBCA=$2
50EPD_ROOT_DIR=$3
51BITS=$4
52
53START_DIR=`/bin/pwd`
54
55
56# Example:  EPD_OS_SPECIFIC_DISTRIBUTION=/APSshare/epd/downloads/epd-7.1-2-rh5-x86_64.sh
57#   INSTALLER_SCRIPT=epd-7.1-2-rh5-x86_64.sh
58INSTALLER_SCRIPT=$(basename ${EPD_OS_SPECIFIC_DISTRIBUTION})
59echo "INSTALLER_SCRIPT = ${INSTALLER_SCRIPT}"
60
61# cut off first 10 characters
62#  TODO: could do better but this works for now
63#   INSTALLER_SCRIPT__OS_PART=rh5-x86_64.sh
64INSTALLER_SCRIPT__OS_PART=`echo ${INSTALLER_SCRIPT} | colrm 1 10`
65echo "INSTALLER_SCRIPT__OS_PART = ${INSTALLER_SCRIPT__OS_PART}"
66
67#   EPD_DEPLOYMENT_SUBDIR=rh5-x86_64
68EPD_DEPLOYMENT_SUBDIR=${INSTALLER_SCRIPT__OS_PART%.*}
69echo "EPD_DEPLOYMENT_SUBDIR = ${EPD_DEPLOYMENT_SUBDIR}"
70
71EPD_DEPLOYMENT_DIR=${EPD_ROOT_DIR}/${EPD_DEPLOYMENT_SUBDIR}
72
73
74#OS_KERNEL_NAME=`uname -s`                # Linux
75#PROCESSOR_TYPE=`uname -p`                # x86_64
76#KERNEL_RELEASE_NAME=`uname -r`           # 2.6.32-131.2.1.el6.x86_64  (el6 is the important part here)
77#
78#case ${OS_KERNEL_NAME} in
79#    Linux)
80#        echo "This is Linux, release ${KERNEL_RELEASE_NAME}"
81#        ;;
82#    SunOS)
83#        echo "This is Solaris, release ${KERNEL_RELEASE_NAME}"
84#        ;;
85#esac
86
87
88###################################################################################
89#
90# post/update the README file
91#
92#  TODO: short-term need
93[ -f ${EPD_ROOT_DIR}/00_README.txt ] && /bin/rm ${EPD_ROOT_DIR}/00_README.txt
94#
95if [ ./README.txt -nt ${EPD_ROOT_DIR}/README.txt ]; then
96    echo "updating README file"
97    /bin/cp ./README.txt ${EPD_ROOT_DIR}/README.txt
98fi
99
100
101###################################################################################
102#
103# install EPD
104#
105
106${EPD_OS_SPECIFIC_DISTRIBUTION} -b -p ${EPD_DEPLOYMENT_DIR}
107cd ${EPD_DEPLOYMENT_DIR}/bin
108
109###################################################################################
110#
111# copy the EPICS_LIB_FILE into the Python libraries
112# Is this a better way to provide libca.so and avoid setting LD_LIBRARY_PATH? 
113#   No, still need to set LD_LIBRARY_PATH or PATH.  But that is easier.
114#   Also, copying the library to Python associates this file directly.
115#   Could also modify search list in PyEPICS epics.ca.find_libca()
116#   to add <python>/lib at end of list.  Not done yet.  This would
117#   allow a python session to fallback to known library.
118#
119
120cd ${EPD_DEPLOYMENT_DIR}/lib
121echo "# Copying EPICS libca.so support library for PyEpics"
122/bin/cp ${EPICS_LIBCA}   ./
123EPICS_LIB_FILE=$(basename ${EPICS_LIBCA})
124if [ "${EPICS_LIB_FILE}" = "libca.so" ]; then
125    echo "No need to make libca soft link"
126else
127    echo "# making soft link to libca.so"
128    [ -f ./libca.so ] && /bin/rm ./libca.so
129    /bin/ln -s ./${EPICS_LIB_FILE}  ./libca.so
130fi
131PATH=${EPD_DEPLOYMENT_DIR}/lib:${PATH}
132
133
134###################################################################################
135# Since the release of EPD 7.0-2 a bug has been found in distribute,
136# which causes Cython extensions not to be compiled. We advise to
137# update to the latest distribute version (after the EPD installation) using:
138#       $ enpkg distribute
139#cd ${EPD_DEPLOYMENT_DIR}/bin
140#./easy_install distribute
141#./enpkg distribute
142
143###################################################################################
144# WhooshDoc is an Enthought utility to search for information in modules.
145# With more than 10^4 modules in EPD, the Python "help> modules" functionality runs
146# out of resources due to scale.  Downside of WhooshDoc is it only works on the
147# EPD index of modules (EPDIndex), not including those added locally by easy_install.
148#
149# wdoc ui &
150#
151cd ${EPD_DEPLOYMENT_DIR}/bin
152./enpkg whooshdoc
153
154###################################################################################
155#
156# install additional packages
157#
158
159cd ${START_DIR}
160./add-ons.sh ${EPD_DEPLOYMENT_DIR}
Note: See TracBrowser for help on using the repository browser.