Personal tools

Cygwin version of setup-lps.sh

From OpenLaszlo

# setup-lps.sh 
# Purpose: sets all the environment variables needed to build, install, and run
# OpenLaszlo. This version modified from a copy at an svn repository at 
# http://svn.openlaszlo.org/openlaszlo 
# 
# This version uses cygpath to make it work properly with cygwin.
# It's set up for legals rather than trunk, and the version and location of 
# some of the libraries may have slightly different names from the default 
# installation instructions.
# In cases where a library does not appear in /home/<user>/lib (Java and Python), a symbolic link 
# (ln -s target-file link) has been placed in /home/<user>/lib, so check the name and
# location of each referenced directory. My lib directory looks like this:

# /home/<user>/lib
# $ ls -l
# total 2
# lrwxrwxrwx   1 papley None 34 Oct 19 08:04 Java -> /cygdrive/c/J2SE5/Java/jdk1.5.0_04
# lrwxrwxrwx   1 papley None 20 Oct 19 08:09 Python -> /cygdrive/c/Python22
# drwxr-xr-x+  6 papley None  0 Jun  2  2005 apache-ant-1.6.5
# drwxr-xr-x+ 11 papley None  0 Nov 24  2004 jakarta-tomcat-5.0.30
# drwxr-xr-x+  6 papley None  0 Oct 19 04:43 javacc2.1
# drwxr-xr-x+ 10 papley None  0 Oct 19 08:15 jython-2.1
# drwxr-xr-x+  6 papley None  0 Jan 27  2002 rhino1_5R3

# Before running this script, probably in your .bashrc, you can set up environment 
# variables which you do not want this script to modify: 
# these variables will not be modified if they are already set:
# JAVA_HOME, ANT_HOME, JAVACC_HOME, JYTHON_HOME, TOMCAT_HOME, CATALINA_HOME,
# EDITOR
#
# usage: 
# . setup-lps.sh [source-root [tools-root [installs-root vendor-root]]]
# 
# Simple usage:
# . setup-lps.sh
# will set everything up properly if your Open Laszlo source lives in 
# "${HOME}/src/svn"
#
# 
# If you want to configure things at a more detailed level, do
# specify parameters on the command line. Note that these are *positional*. In 
# order to specify a tools_home, you must have also specified a dev_home, a 
# branch, and a vendor_home. 
# For example, 
# . /Users/ben/Source/svn1/tools1/trunk/env/setup-lps.sh /Users/ben/Source/svn1/trunk2 /Users/ben/Source/svn1/tools1 /Users/ben/Source/svn/openlaszlo/installs /Users/ben/Source/svn/openlaszlo/vendor
# sets me up to code using the seaswirl branch of OpenLaszlo. 
# 
export HOME=`cygpath -w ${HOME}`
export LZ_LPS_ROOT=`cygpath -w ${1:-"${HOME}/src/svn/openlaszlo/branches/legals"}`
export LZ_TOOLS_ROOT=`cygpath -w ${2:-"${HOME}/src/svn/tools/trunk"}`
export LZ_INSTALLS_ROOT=`cygpath -w ${3:-"${HOME}/lib"}`
export LZ_VENDOR_ROOT=`cygpath -w ${4:-"${HOME}/src/svn/vendor"}`

# If these are defined, don't redefine them. They must have these well-known
# names in order for the tools which use them to know where their config files
# etc live. 
export JAVA_HOME=`cygpath -w ${JAVA_HOME:-"${LZ_INSTALLS_ROOT}/Java"}`
export ANT_HOME=`cygpath -w ${ANT_HOME:-"${LZ_INSTALLS_ROOT}/apache-ant-1.6.5"}`
export JAVACC_HOME=`cygpath -w ${JAVACC_HOME:-"${LZ_INSTALLS_ROOT}/javacc2.1"}`
export PYTHON_HOME=`cygpath -w ${PYTHON_HOME:-"${LZ_INSTALLS_ROOT}/Python"}`
export JYTHON_HOME=`cygpath -w ${JYTHON_HOME:-"${LZ_INSTALLS_ROOT}/jython-2.1"}`
export TOMCAT_HOME=`cygpath -w ${TOMCAT_HOME:-"${LZ_INSTALLS_ROOT}/jakarta-tomcat-5.0.30"}`
export CATALINA_HOME=`cygpath -w ${TOMCAT_HOME}`

export EDITOR=`cygpath -w ${EDITOR:-"emacs"}`

# Redefine these variables based on the LPS branch. 
export LPS_HOME=`cygpath -w ${LZ_LPS_ROOT}`
export LPS_BIN=`cygpath -w "${LPS_HOME}/WEB-INF/lps/server/bin"}`

export LPS_PATHS=${PYTHON_HOME}:${JAVA_HOME}\\bin:${ANT_HOME}\\bin:${JAVACC_HOME}\\bin:${JYTHON_HOME}:${TOMCAT_HOME}\\bin:$LPS_BIN
export PATH=${LPS_PATHS}:$PATH