forked from JeffersonLab/ceInstall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
go_tar
executable file
·219 lines (186 loc) · 5.5 KB
/
go_tar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/bin/tcsh -f
# First argument is package name
# Second argument is version
if($1 == "g4data") then
goto $1
endif
if($#argv != 2 && $#argv != 3) then
echo " "
echo "Usage: "
echo " >> go_tar package version [option]"
echo " "
exit 0
endif
set pname = $1
set pver = $2
set option = $3
set remoted = "ftp.jlab.org:/u/group/12gev_phys/www/packages/sources"
set locald = /opt/projects
# delete, make dir and cd to it
# defined in myenv but we do not source it here (-f option to this script)
alias mcd 'rm -rf \!*; mkdir -p \!* ; cd \!*'
echo
echo " Package: " $pname ", version: " $pver
echo
set exT1 = '--exclude=.git'
set exT2 = '--exclude=releaseScheme.key'
set exT3 = '--exclude=.sconsign.dblite'
set exT4 = '--exclude=.DS_Store'
set exT5 = '--exclude=doc'
set exT6 = '--exclude=.gitignore'
set exT7 = '--exclude=go_tar'
set exT8 = '--exclude=.entitlements'
set exT9 = '--exclude=lib'
set exT10 = '--exclude=bin'
set exT11 = '--exclude=external'
set exT12 = '--exclude=template\_install.html'
set excludeFromTar = $exT1" "$exT2" "$exT3" "$exT4" "$exT5" "$exT6" "$exT7" "$exT8" "$exT9" "$exT10" "$exT11" "$exT12
# common environment
if($pname == "ceInstall") then
# to use local disk version for a release
if($option == "local") then
cd $locald
rm -f ceInstall_$pver.*
tar cvf ceInstall_$pver.tar -L $excludeFromTar ceInstall
gzip ceInstall_$pver.tar
scp ceInstall_$pver.tar.gz $remoted/ceInstall
rm -f ceInstall_$pver.*
else
mcd $locald/ceInstall/tmp
wget -qc --show-progress https://github.com/JeffersonLab/ceInstall/archive/v$pver".tar.gz" -O ceInstall_$pver.tar.gz
scp ceInstall_$pver.tar.gz $remoted/ceInstall
cd ..
rm -rf tmp
endif
cd $locald/ceInstall
# html instructions: these are the ones in the local dir, not coming from the git release
rm -f sbsInstall/$pver"_install.html"
sed "s/vvversiontoreplaceee/$pver/g" sbsInstall/template_install.html > sbsInstall/$pver"_install.html"
scp sbsInstall/* $remoted/ceInstall/
scp sbsInstall/.jlab_software $remoted/ceInstall/
# main scripts: these are the ones in the local dir, not coming from the git release
scp softenv.* ftp.jlab.org:/site/12gev_phys
exit
endif
# scons scripts
if($pname == "bm") then
# to use local disk version for a release
if($option == "local") then
cd $locald
rm -f scons_bm_$pver.tar.gz
tar cvf scons_bm_$pver.tar -L $excludeFromTar scons_bm
gzip scons_bm_$pver.tar
scp scons_bm_$pver.tar.gz $remoted/scons_bm
rm -f scons_bm_$pver.tar.gz
else
mcd $locald/scons_bm/tmp
wget -qc --show-progress https://github.com/maureeungaro/scons_bm/archive/v$pver".tar.gz" -O scons_bm_$pver.tar.gz
scp scons_bm_$pver.tar.gz $remoted/scons_bm
cd ..
rm -rf tmp
endif
exit
endif
# Additional settings at the top of get_coptions
# Get evio from here:
# https://coda.jlab.org/drupal/content/event-io-evio
# then replace the SConstruct there with the old $EVIO/SConstruct and re-pack with (one dir up)
if($pname == "evio") then
cd $JLAB_SOFTWARE/evio/$pver
scons -c ; rm -rf lib bin
cd ..
rm -rf evio-$pver.*
tar cvf evio-$pver.tar --exclude="java" $excludeFromTar $pver/*
gzip evio-$pver.tar
scp evio-$pver.tar.gz $remoted/evio
exit
endif
# gemc
# copying API in gemc
# notice the github tag has _ but we turned it into -
if($pname == "gemc") then
if($pver == "devel") then
cd $GEMC
scons -c
cd $locald/gemc/releases/
rm -rf devel ; cp -r ../source devel
endif
mcd $locald/gemc/tmp
wget -qc --show-progress https://github.com/gemc/source/archive/v$pver.tar.gz -O gemc_$pver.tar.gz
tar -zxpvf gemc_$pver.tar.gz
rm gemc_$pver.tar.gz
cd source-$pver
cp -r $locald/gemc/api .
cd ..
tar cvf gemc-$pver.tar source-$pver
gzip gemc-$pver.tar
scp gemc-$pver.tar.gz $remoted/gemc
cd ..
rm -rf tmp
exit
endif
# banks
if($pname == "banks") then
if($option == "local") then
cd $BANKS
scons -c
cd $locald
rm -f banks_$pver.tar.gz
tar cvf banks_$pver.tar -L $excludeFromTar banks
gzip banks_$pver.tar
scp banks_$pver.tar.gz $remoted/banks
rm -f banks_$pver.tar.gz
else
mcd $locald/banks/tmp
wget -qc --show-progress https://github.com/maureeungaro/banks/archive/v$pver".tar.gz" -O banks_$pver.tar.gz
scp banks_$pver.tar.gz $remoted/banks
cd ..
rm -rf tmp
endif
exit
endif
# mlibrary
# notice: cadmesh from github "master" is not compiling properly. Use version 1.1
if($pname == "mlibrary") then
# to use development for next release
# extra check that we're using the latest release
if($option == "local") then
cd $locald/mlibrary
scons -c
rm -rf cadmeshBuild bin lib
cd $locald
rm -f mlibrary_$pver.*
tar cvf mlibrary_$pver.tar -L $excludeFromTar mlibrary
gzip mlibrary_$pver.tar
scp mlibrary_$pver.tar.gz $remoted/mlibrary
rm -f mlibrary_$pver.*
else
mcd $locald/mlibrary/tmp
wget -qc --show-progress https://github.com/gemc/mlibrary/archive/v$pver".tar.gz" -O mlibrary_$pver.tar.gz
scp mlibrary_$pver.tar.gz $remoted/mlibrary
cd ..
rm -rf tmp
endif
exit
endif
echo
echo
exit
g4data:
# data is downloaded to Downloads from the geant4 downloads.
# make sure to move it to the a tmp dir inside download
# make sure it is not unzipped
cd /Users/ungaro/Downloads/tmp
# checking number of files
set nFiles = `\ls | wc | awk '{print $1}'`
if($nFiles != "10") then
echo
echo Error: we should have 10 files but we have $nFiles
echo
endif
set G4DATAVERSION = 4.10.04.p01
set REMOTEDIR = /u/group/12gev_phys/www/packages/sources/geant4_data/
cd /Users/ungaro/Downloads
mv tmp $G4DATAVERSION
scp -r $G4DATAVERSION ftp:$REMOTEDIR
if($1 == "g4data") exit