source: epd_deployment/deployment.sh @ 611

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

revised for initial -licensed- EPD deployment

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