source: CMT/v1r12p20020606/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
13here=`pwd`                #should be .../CMT/vxxx/mgr
14here=`dirname ${here}`    #should be .../CMT/vxxx
15here=`dirname ${here}`    #should be .../CMT
16here=`basename ${here}`   #should be CMT
17
18if test ! "${here}" = "CMT" ; then  # Are we outside of CMT ?
19  echo " INSTALL should be run from within the mgr branch of the CMT package"
20  echo " Please go there first and restart this script"
21  echo "  > cd <...>/CMT/v.../mgr"
22  echo "  > ./INSTALL"
23  exit 1
24fi
25
26p=`pwd`
27CMTROOT=`dirname $p`
28
29version=`basename ${CMTROOT}`
30p=`dirname ${CMTROOT}`
31ppath=`dirname ${p}`
32
33#--------------------------------------------------
34#
35#   On some sites, it is convenient to reformat the
36# dir. name obtained by pwd (eg. for removing the /tmp_mnt prefixes)
37#   Some of these replacements are available in
38# the ${CMTROOT}/mgr/cmt_mount_filter file.
39#
40#   You may add new substitutions in this file, according to your
41# specific file system configuration.
42#
43#   Each entry takes the form :
44#
45#dir-name      replacement-name
46#
47#   (with space[s] as separator)
48#
49#--------------------------------------------------
50
51if test -r cmt_mount_filter ; then
52  e=`sed -e 's/[ ][ ]*/#/' \
53   -e 's/^[ ]*/s#/' \
54   -e '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.