install_world 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #!/bin/ksh
  2. #
  3. ###########################################################################
  4. # set -x
  5. DEBUG=""
  6. X_TOP=/proj/x11/xc
  7. MOTIF_TOP=/proj/motif
  8. CDE_TOP=/proj/cde
  9. LOG_DATE="`date +%h.%d,%H:%M:%S`"
  10. LOG_ROOT=/project/dt/logs/install
  11. VIEW=`/usr/atria/bin/cleartool pwv -s`
  12. LOG_DIR=$LOG_ROOT/$VIEW/$LOG_DATE
  13. DO_X_INSTALL=False
  14. DO_MOTIF_INSTALL=False
  15. DO_CDE_INSTALL=False
  16. CLEAN_CDE=False
  17. CLEAN_DIRS="/var/dt /etc/dt"
  18. INSTALL_ALL_LOC_MSG=False
  19. INSTALL_ALL_LOC_HELP=False
  20. INSTALL_ALL_LOC_INFO=False
  21. 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"
  22. ALL_LOC_HELP="CDE-HELP-DE CDE-HELP-ES CDE-HELP-FR CDE-HELP-IT CDE-HELP-JP"
  23. ALL_LOC_INFO="CDE-INFOLIB-DE CDE-INFOLIB-ES CDE-INFOLIB-FR CDE-INFOLIB-IT CDE-INFOLIB-JP"
  24. MAKE=/usr/ccs/bin/make
  25. if [ "IRIX" = "`uname -s`" ]; then
  26. MAKE=/sbin/make
  27. fi
  28. ############################################################################
  29. usage ()
  30. {
  31. cat <<eof
  32. USAGE: $1
  33. [-x | -x11] # Install X11 only
  34. [-m | -motif] # Install Motif only
  35. [-c | -cde] # Install CDE (C locale) only
  36. [-lm | -lmsg] # Install non-C locale message filesets ($ALL_LOC_MSG)
  37. [-lh | -lhelp] # Install non-C locale help filesets ($ALL_LOC_HELP)
  38. [-li | -linfo] # Install non-C locale infolib filesets ($ALL_LOC_INFO)
  39. [-a | -all] # Install everything, i.e. -x, -m, -c, -lm, -lh, -li
  40. [-clean] # Remove '$CLEAN_DIRS' before installing CDE
  41. [-d | -debug] # Print the install commands but do NOT execute them
  42. [{-l | -log | -log_dir} <log_dir>] # The default is '$LOG_DIR'
  43. [{-mail | mail_list} <user_names>]
  44. [-h | -? | -help] # Print usage and exit
  45. eof
  46. }
  47. ##########################################################################
  48. while [ $# -gt 0 ]; do
  49. case $1 in
  50. -x | -x11) DO_X_INSTALL="True"
  51. shift 1 ;;
  52. -m | -motif) DO_MOTIF_INSTALL="True"
  53. shift 1 ;;
  54. -c | -cde) DO_CDE_INSTALL="True"
  55. shift 1 ;;
  56. -a | -all) DO_X_INSTALL="True"
  57. DO_MOTIF_INSTALL="True"
  58. DO_CDE_INSTALL="True"
  59. INSTALL_ALL_LOC_MSG="True"
  60. INSTALL_ALL_LOC_HELP="True"
  61. INSTALL_ALL_LOC_INFO="True"
  62. shift 1 ;;
  63. -lm | -lmsg) INSTALL_ALL_LOC_MSG="True"
  64. shift 1 ;;
  65. -lh | -lhelp) INSTALL_ALL_LOC_HELP="True"
  66. shift 1 ;;
  67. -li | -linfo) INSTALL_ALL_LOC_INFO="True"
  68. shift 1 ;;
  69. -clean) CLEAN_CDE="True"
  70. shift 1 ;;
  71. -d | -debug) DEBUG="echo"
  72. shift 1 ;;
  73. -l | -log | -log_dir) LOG_DIR=$2;
  74. shift 2 ;;
  75. -mail | -mail_list) MAIL_LIST=$2;
  76. shift 2 ;;
  77. -h | "-?" | -help | *) usage $PROG_NAME;
  78. exit 1;
  79. esac
  80. done
  81. #
  82. # Create the log directory
  83. #
  84. if [ -z "$CLEARCASE_ROOT" ]; then
  85. print -u1 "$0: you must have a view set to do an install. Exiting ... "
  86. exit 1
  87. fi
  88. #
  89. # Create the log directory
  90. #
  91. if [ ! -d "$LOG_DIR" ]; then
  92. $DEBUG mkdir -p $LOG_DIR
  93. fi
  94. #
  95. # User must be root to do an install
  96. #
  97. id | grep root > /dev/null 2>&1
  98. if [ "0" != "$?" ]; then
  99. print -u1 "$0: only user 'root' may do an install. Exiting ..."
  100. exit 1
  101. fi
  102. #
  103. # X
  104. #
  105. if [ "True" = "$DO_X_INSTALL" ]; then
  106. $DEBUG cd $X_TOP
  107. $DEBUG $MAKE -i install > $LOG_DIR/x11.install 2>&1
  108. fi
  109. #
  110. # Motif
  111. #
  112. if [ "True" = "$DO_MOTIF_INSTALL" ]; then
  113. $DEBUG cd $MOTIF_TOP
  114. $DEBUG $MAKE -i install.cde > $LOG_DIR/motif.install 2>&1
  115. fi
  116. #
  117. # CDE
  118. #
  119. if [ "True" = "$CLEAN_CDE" ]; then
  120. $DEBUG rm -rf $CLEAN_DIRS
  121. fi
  122. if [ "True" = "$DO_CDE_INSTALL" ]; then
  123. $DEBUG $CDE_TOP/admin/IntegTools/dbTools/installCDE \
  124. -s $CDE_TOP \
  125. > $LOG_DIR/cde.install 2>&1
  126. fi
  127. #
  128. # All localized msgs
  129. #
  130. if [ "True" = "$INSTALL_ALL_LOC_MSG" ]; then
  131. $DEBUG $CDE_TOP/admin/IntegTools/dbTools/installCDE \
  132. -s $CDE_TOP \
  133. -f "$ALL_LOC_MSG" > \
  134. $LOG_DIR/localized_msg.install 2>&1
  135. fi
  136. #
  137. # All localized help
  138. #
  139. if [ "True" = "$INSTALL_ALL_LOC_HELP" ]; then
  140. $DEBUG $CDE_TOP/admin/IntegTools/dbTools/installCDE \
  141. -s $CDE_TOP \
  142. -f "$ALL_LOC_HELP" > \
  143. $LOG_DIR/localized_help.install 2>&1
  144. fi
  145. #
  146. # All localized infolibs
  147. #
  148. if [ "True" = "$INSTALL_ALL_LOC_INFO" ]; then
  149. $DEBUG $CDE_TOP/admin/IntegTools/dbTools/installCDE \
  150. -s $CDE_TOP \
  151. -f "$ALL_LOC_INFO" > \
  152. $LOG_DIR/localized_infolibs.install 2>&1
  153. fi
  154. mv /tmp/CDE* $LOG_DIR