123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- #!/bin/ksh
- #
- ###########################################################################
- # set -x
- DEBUG=""
- X_TOP=/proj/x11/xc
- MOTIF_TOP=/proj/motif
- CDE_TOP=/proj/cde
- LOG_DATE="`date +%h.%d,%H:%M:%S`"
- LOG_ROOT=/project/dt/logs/install
- VIEW=`/usr/atria/bin/cleartool pwv -s`
- LOG_DIR=$LOG_ROOT/$VIEW/$LOG_DATE
- DO_X_INSTALL=False
- DO_MOTIF_INSTALL=False
- DO_CDE_INSTALL=False
- CLEAN_CDE=False
- CLEAN_DIRS="/var/dt /etc/dt"
- INSTALL_ALL_LOC_MSG=False
- INSTALL_ALL_LOC_HELP=False
- INSTALL_ALL_LOC_INFO=False
- ALL_LOC_MSG="CDE-DE CDE-MSG-DE CDE-ES CDE-MSG-ES CDE-FR CDE-MSG-FR CDE-IT CDE-MSG-IT CDE-JP CDE-MSG-JP"
- ALL_LOC_HELP="CDE-HELP-DE CDE-HELP-ES CDE-HELP-FR CDE-HELP-IT CDE-HELP-JP"
- ALL_LOC_INFO="CDE-INFOLIB-DE CDE-INFOLIB-ES CDE-INFOLIB-FR CDE-INFOLIB-IT CDE-INFOLIB-JP"
- MAKE=/usr/ccs/bin/make
- if [ "IRIX" = "`uname -s`" ]; then
- MAKE=/sbin/make
- fi
- ############################################################################
- usage ()
- {
- cat <<eof
- USAGE: $1
- [-x | -x11] # Install X11 only
- [-m | -motif] # Install Motif only
- [-c | -cde] # Install CDE (C locale) only
- [-lm | -lmsg] # Install non-C locale message filesets ($ALL_LOC_MSG)
- [-lh | -lhelp] # Install non-C locale help filesets ($ALL_LOC_HELP)
- [-li | -linfo] # Install non-C locale infolib filesets ($ALL_LOC_INFO)
- [-a | -all] # Install everything, i.e. -x, -m, -c, -lm, -lh, -li
- [-clean] # Remove '$CLEAN_DIRS' before installing CDE
- [-d | -debug] # Print the install commands but do NOT execute them
- [{-l | -log | -log_dir} <log_dir>] # The default is '$LOG_DIR'
- [{-mail | mail_list} <user_names>]
- [-h | -? | -help] # Print usage and exit
- eof
- }
- ##########################################################################
- while [ $# -gt 0 ]; do
- case $1 in
- -x | -x11) DO_X_INSTALL="True"
- shift 1 ;;
- -m | -motif) DO_MOTIF_INSTALL="True"
- shift 1 ;;
- -c | -cde) DO_CDE_INSTALL="True"
- shift 1 ;;
- -a | -all) DO_X_INSTALL="True"
- DO_MOTIF_INSTALL="True"
- DO_CDE_INSTALL="True"
- INSTALL_ALL_LOC_MSG="True"
- INSTALL_ALL_LOC_HELP="True"
- INSTALL_ALL_LOC_INFO="True"
- shift 1 ;;
- -lm | -lmsg) INSTALL_ALL_LOC_MSG="True"
- shift 1 ;;
- -lh | -lhelp) INSTALL_ALL_LOC_HELP="True"
- shift 1 ;;
- -li | -linfo) INSTALL_ALL_LOC_INFO="True"
- shift 1 ;;
- -clean) CLEAN_CDE="True"
- shift 1 ;;
- -d | -debug) DEBUG="echo"
- shift 1 ;;
- -l | -log | -log_dir) LOG_DIR=$2;
- shift 2 ;;
- -mail | -mail_list) MAIL_LIST=$2;
- shift 2 ;;
- -h | "-?" | -help | *) usage $PROG_NAME;
- exit 1;
- esac
- done
- #
- # Create the log directory
- #
- if [ -z "$CLEARCASE_ROOT" ]; then
- print -u1 "$0: you must have a view set to do an install. Exiting ... "
- exit 1
- fi
- #
- # Create the log directory
- #
- if [ ! -d "$LOG_DIR" ]; then
- $DEBUG mkdir -p $LOG_DIR
- fi
- #
- # User must be root to do an install
- #
- id | grep root > /dev/null 2>&1
- if [ "0" != "$?" ]; then
- print -u1 "$0: only user 'root' may do an install. Exiting ..."
- exit 1
- fi
- #
- # X
- #
- if [ "True" = "$DO_X_INSTALL" ]; then
- $DEBUG cd $X_TOP
- $DEBUG $MAKE -i install > $LOG_DIR/x11.install 2>&1
- fi
- #
- # Motif
- #
- if [ "True" = "$DO_MOTIF_INSTALL" ]; then
- $DEBUG cd $MOTIF_TOP
- $DEBUG $MAKE -i install.cde > $LOG_DIR/motif.install 2>&1
- fi
- #
- # CDE
- #
- if [ "True" = "$CLEAN_CDE" ]; then
- $DEBUG rm -rf $CLEAN_DIRS
- fi
- if [ "True" = "$DO_CDE_INSTALL" ]; then
- $DEBUG $CDE_TOP/admin/IntegTools/dbTools/installCDE \
- -s $CDE_TOP \
- > $LOG_DIR/cde.install 2>&1
- fi
- #
- # All localized msgs
- #
- if [ "True" = "$INSTALL_ALL_LOC_MSG" ]; then
- $DEBUG $CDE_TOP/admin/IntegTools/dbTools/installCDE \
- -s $CDE_TOP \
- -f "$ALL_LOC_MSG" > \
- $LOG_DIR/localized_msg.install 2>&1
- fi
- #
- # All localized help
- #
- if [ "True" = "$INSTALL_ALL_LOC_HELP" ]; then
- $DEBUG $CDE_TOP/admin/IntegTools/dbTools/installCDE \
- -s $CDE_TOP \
- -f "$ALL_LOC_HELP" > \
- $LOG_DIR/localized_help.install 2>&1
- fi
- #
- # All localized infolibs
- #
- if [ "True" = "$INSTALL_ALL_LOC_INFO" ]; then
- $DEBUG $CDE_TOP/admin/IntegTools/dbTools/installCDE \
- -s $CDE_TOP \
- -f "$ALL_LOC_INFO" > \
- $LOG_DIR/localized_infolibs.install 2>&1
- fi
- mv /tmp/CDE* $LOG_DIR
|