[Bio] / ReleaseTools / mkworkdir Repository:
ViewVC logotype

Annotation of /ReleaseTools/mkworkdir

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download)

1 : efrank 1.1 #!/bin/sh
2 :    
3 :     ########################################################################
4 :     # mkworkdir
5 :     #
6 :     # Makes a work area in which to check out packages, build, test, etc.
7 :     # This simply makes a directory, copies a top-level makefile into it from
8 :     # the release, and installs a set of directories and a config file assumbed
9 :     # by the build tools
10 :     #
11 :     # Usage:
12 :     # mkworkdir -r <releaseName> <workDirName>
13 :     #
14 :     # Assumes:
15 :     # RTROOT is set to point to the root of the release area. Releases
16 :     # live in $RTROOT/dist/releases
17 :     #
18 :     # History:
19 :     # 01 Dec 03 efrank First version. With thanks to Terry Hung and
20 :     # Bob Jacobsen (newrel in SoftRelTools. SLAC/LBL)
21 :     #
22 :     ########################################################################
23 :    
24 :     #++ params
25 :     # name of the package with release tools
26 :     releasetoolsname=ReleaseTools
27 :    
28 :     #++ vars
29 :     baserelname=current
30 :    
31 :     #-----------------------------------------------------------------------
32 :     #++ process options
33 :    
34 :     set -- `getopt r: $*`
35 :     if [ $? = 0 ]; then
36 :     while [ $1 != -- ]
37 :     do
38 :     case $1 in
39 :     -r) baserelname=$2; shift;;
40 :     esac
41 :     shift
42 :     done
43 :     shift
44 :     fi
45 :    
46 :    
47 :     #-----------------------------------------------------------------------
48 :     #++ check for correct number of arguments
49 :     if [ "$#" -ne 1 ]; then
50 :     echo "One argument required"
51 :     echo "Usage: mkworkdir -r <releaseName> <workDirName>"
52 :     exit 2
53 :     fi
54 :     workdirname=$1
55 :    
56 :     #-----------------------------------------------------------------------
57 :     #++ Makesure the work directory does not already exist
58 :    
59 :     if [ -r $workdirname ]; then
60 :     echo $workdirname already exists
61 :     exit 2
62 :     fi
63 :    
64 :     #-----------------------------------------------------------------------
65 :     #++ Find Base release
66 :    
67 :     if [ -z "$RTROOT" ]; then
68 :     echo "No RTROOT set"
69 :     exit 2
70 :     fi
71 :    
72 :     baserel=$RTROOT/dist/releases/$baserelname
73 :    
74 :     if [ ! -r "$baserel" ]; then
75 :     echo "No such release: " $baserel
76 :     exit 2
77 :     fi
78 :    
79 :     #-----------------------------------------------------------------------
80 :     #++ Make sure the ReleaseTools package is there (to get top level
81 :     # makefiles, etc.).
82 :    
83 :     if [ ! -r "$baserel/$releasetoolsname" ]; then
84 :     echo "No $releasetoolsname" in the base release
85 :     exit 2
86 :     fi
87 :    
88 :     releasetools=$baserel/$releasetoolsname
89 :    
90 :    
91 :     #-----------------------------------------------------------------------
92 :     #++ Make sure the top level makefile is there
93 :    
94 : efrank 1.2 if [ ! -r $releasetools/Makefile.top ]; then
95 : efrank 1.1 echo "Invalid $releasetools: no top level makefile"
96 :     exit 2
97 :     fi
98 :    
99 :     #-----------------------------------------------------------------------
100 :     #++ Make the directory structure
101 :    
102 :     mkdir $workdirname
103 :     cd $workdirname
104 : efrank 1.4 #mkdir bin
105 :     #mkdir bin/$RTARCH
106 :     #mkdir lib
107 :     #mkdir lib/$RTARCH
108 :     #mkdir tmp
109 :     #mkdir tmp/$RTARCH
110 :     #mkdir CGI
111 : efrank 1.2 cp -p $releasetools/Makefile.top ./Makefile
112 : efrank 1.1 echo "baserelname=$baserelname" > rtConfig
113 : efrank 1.4 make installdirs
114 : efrank 1.1
115 :     #-----------------------------------------------------------------------
116 :     #++ debug...delete real soon
117 :    
118 :     echo "baserel : " $baserel
119 :     echo "baserelname : " $baserelname
120 :     echo "releasetools: " $releasetools
121 :     echo "workdirname : " $workdirname

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3