source: epd_deployment/deployment.sh @ 587

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

tweaks

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Rev URL
File size: 4.5 KB
Line 
1#!/bin/bash
2
3########### SVN repository information ###################
4# $Date: 2011-08-02 19:23:11 +0000 (Tue, 02 Aug 2011) $
5# $Author: jemian $
6# $Revision: 587 $
7# $URL: epd_deployment/deployment.sh $
8# $Id: deployment.sh 587 2011-08-02 19:23: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 "     ./images/epd-7.0-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.0.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
54TESTNAME=$(basename ${EPD_OS_SPECIFIC_DISTRIBUTION})
55EPD_DEPLOYMENT_SUBDIR=${TESTNAME%.*}
56EPD_DEPLOYMENT_DIR=${EPD_ROOT_DIR}/${EPD_DEPLOYMENT_SUBDIR}
57
58#OS_KERNEL_NAME=`uname -s`                # Linux
59#PROCESSOR_TYPE=`uname -p`                # x86_64
60#KERNEL_RELEASE_NAME=`uname -r`           # 2.6.32-131.2.1.el6.x86_64  (el6 is the important part here)
61#
62#case ${OS_KERNEL_NAME} in
63#    Linux)
64#        echo "This is Linux, release ${KERNEL_RELEASE_NAME}"
65#        ;;
66#    SunOS)
67#        echo "This is Solaris, release ${KERNEL_RELEASE_NAME}"
68#        ;;
69#esac
70
71
72###################################################################################
73#
74# post/update the README file
75#
76#  TODO: short-term need
77[ -f ${EPD_ROOT_DIR}/00_README.txt ] && /bin/rm ${EPD_ROOT_DIR}/00_README.txt
78#
79if [ ./README.txt -nt ${EPD_ROOT_DIR}/README.txt ]; then
80    echo "updating README file"
81    /bin/cp ./README.txt ${EPD_ROOT_DIR}/README.txt
82fi
83
84
85###################################################################################
86#
87# install EPD
88#
89
90/bin/sh ${EPD_OS_SPECIFIC_DISTRIBUTION} -b -p ${EPD_DEPLOYMENT_DIR}
91cd ${EPD_DEPLOYMENT_DIR}/bin
92
93###################################################################################
94#
95# copy the EPICS_LIB_FILE into the Python libraries
96# Is this a better way to provide libca.so and avoid setting LD_LIBRARY_PATH? 
97#   No, still need to set LD_LIBRARY_PATH or PATH.  But that is easier.
98#   Also, copying the library to Python associates this file directly.
99#   Could also modify search list in PyEPICS epics.ca.find_libca()
100#   to add <python>/lib at end of list.  Not done yet.  This would
101#   allow a python session to fallback to known library.
102#
103
104cd ${EPD_DEPLOYMENT_DIR}/lib
105echo "# Copying EPICS libca.so support library for PyEpics"
106/bin/cp ${EPICS_LIBCA}   ./
107EPICS_LIB_FILE=$(basename ${EPICS_LIBCA})
108if [ "${EPICS_LIB_FILE}" = "libca.so" ]; then
109    echo "No need to make libca soft link"
110else
111    echo "# making soft link to libca.so"
112    [ -f ./libca.so ] && /bin/rm ./libca.so
113    /bin/ln -s ./${EPICS_LIB_FILE}  ./libca.so
114fi
115PATH=${EPD_DEPLOYMENT_DIR}/lib:${PATH}
116
117
118###################################################################################
119# Since the release of EPD 7.0-2 a bug has been found in distribute,
120# which causes Cython extensions not to be compiled. We advise to
121# update to the latest distribute version (after the EPD installation) using:
122#       $ enpkg distribute
123#cd ${EPD_DEPLOYMENT_DIR}/bin
124#./easy_install distribute
125#./enpkg distribute
126
127###################################################################################
128# WhooshDoc is an Enthought utility to search for information in modules.
129# With more than 10^4 modules in EPD, the Python "help> modules" functionality runs
130# out of resources due to scale.  Downside of WhooshDoc is it only works on the
131# EPD index of modules (EPDIndex), not including those added locally by easy_install.
132#
133# wdoc ui &
134#
135cd ${EPD_DEPLOYMENT_DIR}/bin
136./enpkg whooshdoc
137
138###################################################################################
139#
140# install additional packages
141#
142
143cd ${START_DIR}
144./add-ons.sh ${EPD_DEPLOYMENT_DIR}
Note: See TracBrowser for help on using the repository browser.