Changeset 331
- Timestamp:
- 02/17/2011 06:14:08 PM (12 years ago)
- Location:
- SH_SHM/trunk/setup
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
SH_SHM/trunk/setup/SHM-install.csh
r329 r331 4 4 # =========== 5 5 # 6 # version 4, 18-Jun-20066 # version 5, 17-Feb-2011 7 7 # 8 8 # Installation script for SH/SHM package 9 # K. Stammler, 13-Nov-200310 9 11 10 set ext="undefined" … … 17 16 18 17 if ("$1" == "") then 19 echo "Usage: $0 <installpath> [<sourcepath>]" 20 echo "" 21 echo " Steps to install are:" 22 echo " (i) create installation directory (e.g. 'mkdir $PWD/shprog')" 23 echo " (ii) create tar file directory (e.g. 'mkdir $PWD/shtar')" 24 echo " (iii) cd to tar file directory and get files:" 25 echo " ftp://ftp.szgrf.bgr.de/pub/software/SH-SHM.tar.gz" 26 echo " ftp://ftp.szgrf.bgr.de/pub/software/fk-$ext.tar.gz" 27 echo " ftp://ftp.szgrf.bgr.de/pub/software/locsat-$ext.tar.gz" 28 echo " ftp://ftp.szgrf.bgr.de/pub/software/SHM-install.csh" 29 echo " (iv) make SHM-install.csh executable 'chmod a+x ./SHM-install.csh'" 30 echo " (v) call e.g. './SHM-install.csh $PWD/shprog'" 31 echo " Note that the parameter must be the absolute path to the" 32 echo " installation directory" 33 echo "" 34 echo -n "Do you want run run the installation now ? [y/n] " 35 set reply="$<" 36 if ("$reply" == "y" || "$reply" == "Y") then 37 set res=`which wget` 38 if (! -e $res) then 39 echo "need 'wget' to continue. Please install" 40 exit 41 endif 42 echo -n "Where should SH/SHM be installed? Enter full pathname: " 43 set dstpath="$<" 44 if (! -d $dstpath) mkdir $dstpath 45 if (! -w $dstpath) then 46 echo "Cannot write to $dstpath. Abort." 47 exit 48 endif 49 set srcpath=$HOME/shpackage 50 if (-d $srcpath) then 51 echo "SH package directory $srcpath already exists." 52 echo "Please rename or delete it and restart the installation program." 53 exit 54 endif 55 echo -n "Create SH package directory $srcpath ? [y/n] " 56 set reply="$<" 57 if ("$reply" == "y" || "$reply" == "Y") then 58 mkdir $srcpath 59 else 60 exit 61 endif 62 echo "download SH/SHM package" 63 (cd $srcpath; wget ftp://ftp.szgrf.bgr.de/pub/software/SH-SHM.tar.gz) 64 echo "download FK package" 65 (cd $srcpath; wget ftp://ftp.szgrf.bgr.de/pub/software/fk-$ext.tar.gz) 66 echo "download LocSAT package" 67 (cd $srcpath; wget ftp://ftp.szgrf.bgr.de/pub/software/locsat-$ext.tar.gz) 68 else 69 exit 70 endif 71 72 else 73 18 echo "To be only used from self-extracting setup process!" 19 else 74 20 # get parameters 75 21 set dstpath=$1 76 set srcpath=$277 if ("$srcpath" == "") set srcpath=$PWD78 79 22 endif 80 23 81 24 # check parameters 82 if (! -d $srcpath) then83 echo "$0 : source path $srcpath not found. Abort."84 exit85 endif86 25 if (! -w $dstpath) then 87 26 echo "$0 : cannot write to installation path $dstpath. Abort." 88 27 exit 89 28 endif 90 if ("$srcpath" == "$dstpath") then91 echo "$0 : source path and installation path must not be equal. Sorry."92 exit93 endif94 29 95 30 # find input files 96 set pack_shm=""97 31 set pack_fk="" 98 32 set pack_locsat="" 99 33 100 if (-e $srcpath/SH-SHM.tar.gz) then101 set pack_shm=$srcpath/SH-SHM.tar.gz102 else103 set pack_shm=`ls $srcpath/SH-* | tail -1`104 endif105 34 if ("`uname`" == "Linux") then 106 if (-e $ srcpath/fk-linux.tar.gz) set pack_fk=$srcpath/fk-linux.tar.gz107 if (-e $ srcpath/locsat-linux.tar.gz) set pack_locsat=$srcpath/locsat-linux.tar.gz35 if (-e $dstpath/fk-linux.tar.gz) set pack_fk=$dstpath/fk-linux.tar.gz 36 if (-e $dstpath/locsat-linux.tar.gz) set pack_locsat=$dstpath/locsat-linux.tar.gz 108 37 else if ("`uname`" == "SunOS") then 109 if (-e $ srcpath/fk-sol2.5.1.tar.gz) set pack_fk=$srcpath/fk-sol2.5.1.tar.gz110 if (-e $ srcpath/locsat-sol2.5.1.tar.gz) set pack_locsat=$srcpath/locsat-sol2.5.1.tar.gz111 else 112 endif 113 114 if (-e $ srcpath/libahio.a.$ext) then38 if (-e $dstpath/fk-sol2.5.1.tar.gz) set pack_fk=$dstpath/fk-sol2.5.1.tar.gz 39 if (-e $dstpath/locsat-sol2.5.1.tar.gz) set pack_locsat=$dstpath/locsat-sol2.5.1.tar.gz 40 else 41 endif 42 43 if (-e $dstpath/libahio.a.$ext) then 115 44 set use_ah=1 116 45 else … … 120 49 121 50 # default values 122 set compile_shm="yes"123 set compile_fk="no"124 set compile_locsat="no"125 51 set displ_res="undef" 126 52 set userroot='$HOME/shfiles' … … 157 83 158 84 echo "" 159 echo "(p) SHM-package: $pack_shm"160 echo "(f) FK-package: $pack_fk"161 echo "(l) LocSAT-package: $pack_locsat"162 85 echo "(u) user root path: $userroot" 163 86 echo "(e) window based texteditor: $editor" 164 echo "(cp) compile SHM: $compile_shm"165 echo "(cf) compile FK: $compile_fk"166 echo "(cl) compile LocSAT: $compile_locsat"167 # echo "(r) resolution: $displ_res"168 87 echo "(c) linux colors: $linux_colors" 169 88 echo "(i) Start Installation" … … 176 95 177 96 if ("$cmd" == "q") exit 178 if ("$cmd" == "p") then179 echo -n "SHM-package: "180 set pack_shm="$<"181 endif182 if ("$cmd" == "f") then183 echo -n "FK-package: "184 set pack_fk="$<"185 endif186 if ("$cmd" == "l") then187 echo -n "LocSAT-package: "188 set pack_locsat="$<"189 endif190 if ("$cmd" == "cp") then191 if ("$compile_shm" == "yes") then192 set compile_shm="no"193 else194 set compile_shm="yes"195 endif196 endif197 if ("$cmd" == "cf") then198 if ("$compile_fk" == "yes") then199 set compile_fk="no"200 else201 set compile_fk="yes"202 endif203 endif204 if ("$cmd" == "cl") then205 if ("$compile_locsat" == "yes") then206 set compile_locsat="no"207 else208 set compile_locsat="yes"209 endif210 endif211 97 if ("$cmd" == "r") then 212 98 if ("$displ_res" == "xga") then … … 256 142 endif 257 143 endif 258 259 144 end 260 261 262 # check paths again263 if (! -e $pack_shm) then264 echo "$0 : echo SHM-package $pack_shm not found. Abort."265 exit266 endif267 if (! -e $pack_fk) then268 echo "$0 : FK-package not found. Abort."269 exit270 endif271 if (! -e $pack_locsat) then272 echo "$0 : LocSAT-package not found. Abort."273 exit274 endif275 145 276 146 cd $dstpath … … 303 173 sed "s@##LOCSATPATH##@$locsatpath@" | sed "s@##EDITOR##@$editor@" | \ 304 174 sed 's/-DSH_SETUP_SZGRF//' | sed "s@##USERROOT##@$userroot@" >shsetup 175 sed "s/$remstr//" shsetup.sh.template | sed "s@##ROOTPATH##@$dstpath/sh@" | \ 176 sed "s@##LOCSATPATH##@$locsatpath@" | sed "s@##EDITOR##@$editor@" | \ 177 sed 's/-DSH_SETUP_SZGRF//' | sed "s@##USERROOT##@$userroot@" >shsetup.sh 178 305 179 if ($use_ah == 0) then 306 if (-e shsetup.x) \rm shsetup.x 307 sed 's/-DSH_SETUP_AH//' shsetup | sed 's/-lahio//' >shsetup.x 308 \rm shsetup 309 mv shsetup.x shsetup 180 sed --in-place 's/-DSH_SETUP_AH//' shsetup 181 sed --in-place 's/-lahio//' shsetup 310 182 endif 311 183 if ($?MACHTYPE == 1) then 312 184 if ("`echo $MACHTYPE | grep 64`" != "") then 313 185 if (-d /usr/X11R6/lib64) then 314 if (-e shsetup.x) \rm shsetup.x 315 sed 's/\/usr\/X11R6\/lib/\/usr\/X11R6\/lib64/' shsetup >shsetup.x 316 \rm shsetup 317 mv shsetup.x shsetup 186 sed --in-place 's/\/usr\/X11R6\/lib/\/usr\/X11R6\/lib64/' shsetup 187 sed --in-place 's/\/usr\/X11R6\/lib/\/usr\/X11R6\/lib64/' shsetup.sh 318 188 endif 319 189 endif … … 322 192 323 193 # create directories for evt files 324 mkdir $SH_USERROOT/evt 325 mkdir $SH_USERROOT/evt/evid 326 mkdir $SH_USERROOT/evt/evtout 194 if (! -e $SH_USERROOT/evt/evid ) mkdir -p $SH_USERROOT/evt/evid 195 if (! -e $SH_USERROOT/evt/evtout ) mkdir -p $SH_USERROOT/evt/evtout 327 196 328 197 # find screen resolution … … 342 211 endif 343 212 set thissetup=$dstpath/sh/inputs/shm-config.txt 344 if (-e $thissetup) \ rm $thissetup213 if (-e $thissetup) \mv $thissetup $dstpath/sh/inputs/shm-config.txt.yours 345 214 cp $origsetup $thissetup 346 215 347 216 # settings for small displays (laptops) 348 217 if ("$displ_res" != "" && "$displ_res" != "sxga") then 349 if (-e $thissetup.x) \rm $thissetup.x 350 sed "s/shm-cof-sxga-geometry/shm-conf-$displ_res-geometry/" $thissetup >$thissetup.x 351 mv $thissetup.x $thissetup 218 sed --in-place "s/shm-cof-sxga-geometry/shm-conf-$displ_res-geometry/" $thissetup 352 219 endif 353 220 … … 356 223 # do nothing, this is default 357 224 else 358 if (-e $thissetup.x) \rm $thissetup.x 359 sed 's/reverse_xors true/reverse_xors false/' $thissetup>$thisetup.x 360 mv $thissetup.x $thissetup 361 endif 362 363 # compile SHM 364 if ("$compile_shm" == "yes") then 365 echo "compiling SHM" 366 cd $SH_ROOT 367 # remove all o's and a's 368 set olist=`find . -name \*.o -print` 369 \rm $olist 370 cd $SH_LIB 371 if (-e libahio.a) mv libahio.a libahio.ax 372 \rm *.a 373 if (-e libahio.ax) mv libahio.ax libahio.a 374 cd $SH_ROOT 375 make depend_shm 376 make shm 377 make world 378 endif 225 sed --in-place 's/reverse_xors true/reverse_xors false/' $thissetup 226 endif 227 228 echo "compiling SHM" 229 cd $SH_ROOT 230 # remove all o's and a's 231 find . -name '*.o' -print0 | xargs -0 rm 232 cd $SH_LIB 233 if (-e libahio.a) mv libahio.a libahio.ax 234 \rm *.a 235 if (-e libahio.ax) mv libahio.ax libahio.a 236 cd $SH_ROOT 237 make depend_shm 238 make shm 239 make world 379 240 380 241 # install FK … … 391 252 if (-e fk) \rm fk 392 253 ln -s fk_src/fk fk 393 394 # compile FK395 if ("$compile_fk" == "yes") then396 echo "compile FK package"397 cd fk_src398 \rm *.o399 make400 endif401 254 402 255 # install LocSAT … … 415 268 ln -s locsat/bin/LocSAT LocSAT 416 269 417 # compile LocSAT418 if ("$compile_locsat" == "yes") then419 echo "compile LocSAT package"420 cd locsat421 set olist=`find . -name \*.o -print`422 \rm $olist423 set olist=`find . -name \*.a -print`424 \rm $olist425 cd $SH_UTIL/locsat/libsrc426 make427 cd $SH_UTIL/locsat/bin/LocSAT428 make429 endif430 431 270 # add SHM resources to .Xdefaults 432 271 set resrc="" … … 456 295 xrdb $resrc 457 296 458 459 297 echo "" 460 298 echo "" -
SH_SHM/trunk/setup/setup.py
r329 r331 38 38 print "\n This piece of software will try to setup the included source code.\n" 39 39 40 def download( pkg):41 os.system(" wget")40 def download(target, pkg): 41 os.system("echo wget -P %s %s" % (target, downloads[pkg])) 42 42 43 43 def setup(**kwargs): … … 78 78 break 79 79 80 copy(os.path.join(data["pwd"], ".."), target, dbg) 80 copy(os.path.join(data["pwd"], ".."), os.path.join(target, "sh"), dbg) 81 download(target, "locsat") 82 download(target, "fk") 83 84 install(target) 85 86 def install(target): 87 os.system(os.path.join(target, "setup/SHM-install.csh %s" % target)) 81 88 82 89 def copy(src, trt, dbg=False): … … 98 105 return raw_input(text) 99 106 100 101 107 if __name__ == "__main__": 102 108 from optparse import OptionParser -
SH_SHM/trunk/setup/shsetup.sh.template
r327 r331 88 88 export SH_LIB=$shcroot/lib/ 89 89 [ -d $SH_USERROOT ] || mkdir $SH_USERROOT 90 if [ ! -d $SH_USERROOT/shscratch ] ; then90 if [ ! -d $SH_USERROOT/shscratch ] ; then 91 91 echo 'creating directory $SH_USERROOT/shscratch' 92 92 mkdir $SH_USERROOT/shscratch 93 93 fi 94 if [ ! -d $SH_USERROOT/private ] ; then94 if [ ! -d $SH_USERROOT/private ] ; then 95 95 echo 'creating directory $SH_USERROOT/private' 96 96 mkdir $SH_USERROOT/private
Note: See TracChangeset
for help on using the changeset viewer.