Created
July 25, 2014 15:31
-
-
Save taldcroft/75c86db594dc1ae2e091 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ciao-ccosmos$ cat ${ASCDS_INSTALL}/bin/ciao_setup.sh | |
| ############################################################################ | |
| # | |
| # Copyright (C) 2013 Smithsonian Astrophysical Observatory | |
| # | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # GNU General Public License for more details. | |
| # | |
| # You should have received a copy of the GNU General Public License along | |
| # with this program; if not, write to the Free Software Foundation, Inc., | |
| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| # | |
| # | |
| # FILE NAME: ciao_setup.sh | |
| # | |
| # DEVELOPMENT: CXCDS User Infrastructure Software | |
| # | |
| # DESCRIPTION: | |
| # | |
| # This script configures the user environment for CIAO, the Chandra | |
| # X-Ray Center data analysis system. | |
| # | |
| # When the script is sourced, it checks for the existence of an | |
| # ASCDS_INSTALL environment variable. If found, the script assumes | |
| # that the environment is already set up and exits with a warning | |
| # message. The user may override a previously set configuration by | |
| # setting the ASCDS_OVERRIDE environment variable (any value is | |
| # ok) and rerunning this script. | |
| # | |
| # User customizations should be added to the 'USER CUSTOMIZATIONS' | |
| # section which appears slightly beyond the middle of this script. | |
| # If the user desires to modify the value of the installation root | |
| # (ASCDS_INSTALL) they should do so by setting the _nextASCDS_INSTALL | |
| # value at the beginning of the script. | |
| # | |
| ############################################################################ | |
| RemovePath() # Remove $2 from the path variable named by $1 | |
| { | |
| if [ "eval '$'${1}x" != "x" ]; then | |
| _tmp=`eval echo '$'${1}` | |
| _tmp=`echo $_tmp | sed "s%$2%%g" | sed "s%::%:%g"` | |
| eval ${1}='$_tmp' | |
| fi | |
| } | |
| AddPathUnique() # Add $2 to path variable named by $1, uniquely | |
| { | |
| RemovePath "${1}" "${2}" | |
| eval _tmp="'$'${1}" | |
| if [ "x${_tmp}" != "x" ]; then | |
| eval "${1}"="${2}:${_tmp}" | |
| else | |
| eval "${1}"="${2}" | |
| fi | |
| export ${1} | |
| } | |
| ################################################################ | |
| # Handle command line options # | |
| ################################################################ | |
| # should we setup the ciao environment? | |
| if [ "x${ASCDS_RUN_CONFIG}" != "xdone" ]; then | |
| ASCDS_RUN_CONFIG="done" | |
| export ASCDS_RUN_CONFIG | |
| ################################################################ | |
| # set CIAO environment variables # | |
| ################################################################ | |
| # DYLD_BIND_AT_LAUNCH=1 | |
| HEADAS="${CIAO_HEADAS}" | |
| export HEADAS | |
| ################################################################ | |
| # IPython Setup # | |
| ################################################################ | |
| if [ "x${IPYTHONDIR}" != "x" ] ; then | |
| export IPYTHONDIR | |
| else | |
| IPYTHONDIR="${HOME}/.ipython-ciao4.5" | |
| export IPYTHONDIR | |
| fi | |
| ################################################################ | |
| # Export variables to environment # | |
| ################################################################ | |
| # export DYLD_BIND_AT_LAUNCH | |
| ################################################################ | |
| # GTK Setup # | |
| ################################################################ | |
| if [ -d $ASCDS_INSTALL/ots/lib${CIAO_64}/gtk-2.0 ] ; then | |
| AddPathUnique GTK_PATH "$ASCDS_INSTALL/ots/lib${CIAO_64}/gtk-2.0:/usr/lib64/gtk-2.0" | |
| PANGO_RC_FILE="$ASCDS_INSTALL/ots/etc/pango/pangorc" | |
| FC_CONFIG_DIR="$ASCDS_INSTALL/ots/etc/fonts/conf.d" | |
| FC_CONFIG_FILE="$ASCDS_INSTALL/ots/etc/fonts/fonts.conf" | |
| FONTCONFIG_PATH="$ASCDS_INSTALL/ots/etc/fonts" | |
| if [ "x${GDK_PIXBUF_MODULE_DIR}" = "x" ] ; then | |
| if [ -d "$ASCDS_INSTALL/ots/lib/gdk-pixbuf-2.0/2.10.0/loaders" ] ; then | |
| GDK_PIXBUF_MODULE_DIR="$ASCDS_INSTALL/ots/lib${CIAO_64}/gdk-pixbuf-2.0/2.10.0/loaders" | |
| else [ -d "$ASCDS_INSTALL/ots/lib${CIAO_64}/gtk-2.0/2.4.0/loaders" ] | |
| GDK_PIXBUF_MODULE_DIR="$ASCDS_INSTALL/ots/lib${CIAO_64}/gtk-2.0/2.4.0/loaders" | |
| fi | |
| fi | |
| if [ "x${GDK_PIXBUF_MODULE_FILE}" = "x" ] ; then | |
| GDK_PIXBUF_MODULE_FILE="$ASCDS_INSTALL/ots/etc/gtk-2.0/gdk-pixbuf.loaders" | |
| fi | |
| export GTK_PATH PANGO_RC_FILE FC_CONFIG_DIR FC_CONFIG_FILE | |
| export FONTCONFIG_PATH GDK_PIXBUF_MODULE_DIR GDK_PIXBUF_MODULE_FILE | |
| fi | |
| ################################################################ | |
| # setup AHELP_DEFCONTEXT if needed # | |
| ################################################################ | |
| if [ "x${AHELP_DEFCONTEXT}" = "x" ] ; then | |
| AHELP_DEFCONTEXT="/py[.]*/" | |
| fi | |
| export AHELP_DEFCONTEXT | |
| ################################################################ | |
| # Adjust paths # | |
| ################################################################ | |
| if [ "`uname`" != "Linux" ] ; then | |
| if [ -d "$ASCDS_CONTRIB/lib${CIAO_64}" ] ; then | |
| LD_LIBRARY_PATH=$ASCDS_CONTRIB/lib${CIAO_64}:$LD_LIBRARY_PATH | |
| fi | |
| LD_LIBRARY_PATH=$ASCDS_LIB:$ASCDS_INSTALL/ots/lib${CIAO_64}:$LD_LIBRARY_PATH | |
| fi | |
| if [ "x$CIAO_LD_LIBRARY_PATH" != "x" ] ; then | |
| LD_LIBRARY_PATH=$CIAO_LD_LIBRARY_PATH:$LD_LIBRARY_PATH | |
| fi | |
| if [ "x$CIAO_DYLD_LIBRARY_PATH" != "x" ] ; then | |
| LD_LIBRARY_PATH=$CIAO_DYLD_LIBRARY_PATH:$LD_LIBRARY_PATH | |
| fi | |
| export LD_LIBRARY_PATH | |
| PYTHONPATH=$ASCDS_INSTALL/lib${CIAO_64}/python2.7/site-packages:$ASCDS_INSTALL/ots/lib${CIAO_64}/python2.7/site-packages:$ASCDS_INSTALL/contrib/lib${CIAO_64}/python2.7/site-packages:$PYTHONPATH | |
| export PYTHONPATH | |
| # BWIDGET_LIBRARY=${ASCDS_LIB} | |
| # if [ "x${DYLD_FRAMEWORK_PATH}" != "x" ] ; then | |
| # DYLD_FRAMEWORK_PATH=${ASCDS_INSTALL}/ots/gs/Library/Frameworks:${DYLD_FRAMEWORK_PATH} | |
| # else | |
| # DYLD_FRAMEWORK_PATH=${ASCDS_INSTALL}/ots/gs/Library/Frameworks | |
| # fi | |
| # if [ "${CIAO_PYTHON}" == "CIAO" ] || [ "${CIAO_PYTHON}" == "${ASCDS_INSTALL}/ots/bin" ] ; then | |
| # DYLD_FRAMEWORK_PATH=$ASCDS_INSTALL/ots/Library/Frameworks:$DYLD_FRAMEWORK_PATH | |
| # fi | |
| # export BWIDGET_LIBRARY DYLD_FRAMEWORK_PATH | |
| ################################################################ | |
| # Finished configuration # | |
| ################################################################ | |
| fi # end of if [ "x${ASCDS_RUN_CONFIG}" != "xdone" ] - DO NOT DELETE THIS LINE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment