source: epd_deployment/deployment.sh @ 629

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

added vertical delimiters to output

  • 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.2 KB
Line 
1#!/bin/bash
2
3########### SVN repository information ###################
4# $Date: 2011-09-07 19:57:44 +0000 (Wed, 07 Sep 2011) $
5# $Author: jemian $
6# $Revision: 629 $
7# $URL: epd_deployment/deployment.sh $
8# $Id: deployment.sh 629 2011-09-07 19:57:44Z 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
55echo "EPD_OS_SPECIFIC_DISTRIBUTION = ${EPD_OS_SPECIFIC_DISTRIBUTION}"
56
57
58# Example:  EPD_OS_SPECIFIC_DISTRIBUTION=/APSshare/epd/downloads/epd-7.1-2-rh5-x86_64.sh
59#   INSTALLER_SCRIPT=epd-7.1-2-rh5-x86_64.sh
60INSTALLER_SCRIPT=$(basename ${EPD_OS_SPECIFIC_DISTRIBUTION})
61echo "INSTALLER_SCRIPT = ${INSTALLER_SCRIPT}"
62
63# cut off first 10 characters
64#  TODO: could do better but this works for now
65#   INSTALLER_SCRIPT__OS_PART=rh5-x86_64.sh
66case `uname -s` in
67    Linux)
68        INSTALLER_SCRIPT__OS_PART=`echo ${INSTALLER_SCRIPT} | colrm 1 10`
69        ;;
70    SunOS)
71        INSTALLER_SCRIPT__OS_PART=`echo ${INSTALLER_SCRIPT} | cut -c11-80`
72        ;;
73esac
74echo "INSTALLER_SCRIPT__OS_PART = ${INSTALLER_SCRIPT__OS_PART}"
75
76#   EPD_DEPLOYMENT_SUBDIR=rh5-x86_64
77EPD_DEPLOYMENT_SUBDIR=${INSTALLER_SCRIPT__OS_PART%.*}
78echo "EPD_DEPLOYMENT_SUBDIR = ${EPD_DEPLOYMENT_SUBDIR}"
79
80EPD_DEPLOYMENT_DIR=${EPD_ROOT_DIR}/${EPD_DEPLOYMENT_SUBDIR}
81
82
83#OS_KERNEL_NAME=`uname -s`                # Linux
84#PROCESSOR_TYPE=`uname -p`                # x86_64
85#KERNEL_RELEASE_NAME=`uname -r`           # 2.6.32-131.2.1.el6.x86_64  (el6 is the important part here)
86
87
88###################################################################################
89#
90# post/update the README file
91#
92if [ ./README.txt -nt ${EPD_ROOT_DIR}/README.txt ]; then
93    echo "updating README file"
94    /bin/rm -f ${EPD_ROOT_DIR}/README.txt
95    /bin/cp ./README.txt ${EPD_ROOT_DIR}/README.txt
96fi
97
98
99###################################################################################
100#
101# install EPD
102#
103echo "EPD_DEPLOYMENT_DIR = ${EPD_DEPLOYMENT_DIR}"
104${EPD_OS_SPECIFIC_DISTRIBUTION} -b -p ${EPD_DEPLOYMENT_DIR}
105cd ${EPD_DEPLOYMENT_DIR}/bin
106
107
108###################################################################################
109#
110# copy the EPICS_LIB_FILE into the Python libraries
111# Is this a better way to provide libca.so and avoid setting LD_LIBRARY_PATH? 
112#   No, still need to set LD_LIBRARY_PATH or PATH.  But that is easier.
113#   Also, copying the library to Python associates this file directly.
114#   Could also modify search list in PyEPICS epics.ca.find_libca()
115#   to add <python>/lib at end of list.  Not done yet.  This would
116#   allow a python session to fallback to known library.
117#
118
119echo "#---------------------------------------------------"
120echo "# Copying EPICS libca.so support library for PyEpics"
121cd ${EPD_DEPLOYMENT_DIR}/lib
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}
132echo "#---------------------------------------------------"
133
134
135###################################################################################
136# Since the release of EPD 7.0-2 a bug has been found in distribute,
137# which causes Cython extensions not to be compiled. We advise to
138# update to the latest distribute version (after the EPD installation) using:
139#       $ enpkg distribute
140#cd ${EPD_DEPLOYMENT_DIR}/bin
141#./easy_install distribute
142#./enpkg distribute
143
144###################################################################################
145# WhooshDoc is an Enthought utility to search for information in modules.
146# With more than 10^4 modules in EPD, the Python "help> modules" functionality runs
147# out of resources due to scale.  Downside of WhooshDoc is it only works on the
148# EPD index of modules (EPDIndex), not including those added locally by easy_install.
149#
150# wdoc ui &
151#
152#cd ${EPD_DEPLOYMENT_DIR}/bin
153#./enpkg whooshdoc
154
155###################################################################################
156#
157# install additional packages
158#
159
160cd ${START_DIR}
161./add-ons.sh ${EPD_DEPLOYMENT_DIR}
Note: See TracBrowser for help on using the repository browser.