source: CMT/v1r18p20041201/mgr/INSTALL @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 3.5 KB
Line 
1#!/bin/sh
2
3#--------------------------------------------------
4# main ()
5#--------------------------------------------------
6
7#--------------------------------------------------
8#
9#  First try to figure out where we are now.
10#
11#--------------------------------------------------
12
13##set -v
14
15here=`pwd`                #should be .../CMT/vxxx/mgr
16here=`dirname ${here}`    #should be .../CMT/vxxx
17here=`dirname ${here}`    #should be .../CMT
18here=`basename ${here}`   #should be CMT
19
20if test ! "${here}" = "CMT" ; then  # Are we outside of CMT ?
21  echo " INSTALL should be run from within the mgr branch of the CMT package"
22  echo " Please go there first and restart this script"
23  echo "  > cd <...>/CMT/v.../mgr"
24  echo "  > ./INSTALL"
25  exit 1
26fi
27
28p=`pwd`
29CMTROOT=`dirname $p`
30
31version=`basename ${CMTROOT}`
32p=`dirname ${CMTROOT}`
33ppath=`dirname ${p}`
34
35#--------------------------------------------------
36#
37#   On some sites, it is convenient to reformat the
38# dir. name obtained by pwd (eg. for removing the /tmp_mnt prefixes)
39#   Some of these replacements are available in
40# the ${CMTROOT}/mgr/cmt_mount_filter file.
41#
42#   You may add new substitutions in this file, according to your
43# specific file system configuration.
44#
45#   Each entry takes the form :
46#
47#dir-name      replacement-name
48#
49#   (with space[s] as separator)
50#
51#--------------------------------------------------
52
53if test -r cmt_mount_filter ; then
54  e=`sed -e 's/[ ][ ]*/#/' -e 's/^[ ]*/s#/' -e 's/[ ]*$/#/' -e 's/^s##$//' cmt_mount_filter`
55  ppath=`echo ${ppath} | sed -e "$e"`
56fi
57
58#--------------------------------------------------
59#
60#   Building the setup.csh script
61#
62#--------------------------------------------------
63
64cat <<END >setup.csh
65# echo "Setting CMT ${version} in ${ppath}"
66   
67setenv CMTROOT ${ppath}/CMT/${version}
68
69END
70
71cat ../src/setup.csh >>setup.csh
72
73#--------------------------------------------------
74#
75#   Building the setup.sh script
76#
77#--------------------------------------------------
78
79cat <<END >setup.sh
80# echo "Setting CMT ${version} in ${ppath}"
81   
82CMTROOT=${ppath}/CMT/${version}; export CMTROOT
83
84END
85
86cat ../src/setup.sh >>setup.sh
87
88#--------------------------------------------------
89#
90#   Building the cleanup.csh script
91#
92#--------------------------------------------------
93
94cp ../src/cleanup.csh ./cleanup.csh
95
96#--------------------------------------------------
97#
98#   Building the cleanup.sh script
99#
100#--------------------------------------------------
101
102cp ../src/cleanup.sh ./cleanup.sh
103
104#--------------------------------------------------
105#
106#  In case one needs to re-build cmt from the sources
107#  it's likely that cmt.exe does not exist yet thus
108#  we cannot expect that dependencies are re-built.
109#
110#  rather, we expect they have been downloaded from
111#  the distribution kit and thus we just have to
112#  touch them.
113#
114#--------------------------------------------------
115
116touch ../src/*.make ../mgr/*.make ../mgr/cmt_path.make
117
118exes=`ls ../*/cmt.exe | sed -e 's#\.\./#    #g' -e 's#/cmt.exe##g'`
119
120echo "============================================"
121echo "       CMT installation terminated.         "
122echo "           --------------------             "
123if test "${exes}" = "" ; then
124  echo " cmt.exe is not built on this site"
125  echo " you might need to build it as follows:"
126  echo " > source setup.csh"
127  echo " > [g]make"
128else
129  echo " cmt.exe is available on this site for:"
130    echo "${exes}"
131fi
132echo "============================================"
Note: See TracBrowser for help on using the repository browser.