OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/eos/base
[eos/base.git] / env / install-eos.sh
1 #!/bin/bash
2 #### 
3 EOS_HOME0=$HOME/Eos
4 echo "Set the directroy to be installed [$EOS_HOME0]: "; read ANS
5 if [ ! -z $ANS ] ; then 
6         EOS_HOME0=$ANS;
7 else 
8         EOS_HOME0=$HOME/Eos; 
9 fi
10 unset ANS
11 echo "Directory: $EOS_HOME0";
12
13 #### No Change
14 ROOT_EOS_SOURCEFORGE=https://sourceforge.jp/projects/eos/scm/git/base/blobs/master/
15 if [ ! -d $EOS_HOME0 ] ; then
16         mkdir $EOS_HOME0
17 fi
18
19 #curl -L $ROOT_EOS_SOURCEFORGE/env/Eos_env?export=raw | sh - ; 
20
21 git clone --depth 1 git://git.sourceforge.jp/gitroot/eos/base.git $EOS_HOME0 || echo "Already installed on $EOS_HOME0 or there are something wrong."
22
23 if [ -z $EOS_HOME0 ] ; then
24         export EOS_HOME0=$HOME/Eos
25 fi
26 cat >> $HOME/.bashrc << EOF
27
28 ##
29 ## Eos_env
30 ##
31
32 if [ ! -z $EOS_HOME0 ] ; then 
33 if [ -f $EOS_HOME0/env/Eos_env -a ! -f $HOME/.Eos_env ] ; then
34         ln -s $EOS_HOME0/env/Eos_env $HOME/.Eos_env
35 fi
36 fi
37
38 test -r $HOME/.Eos_env  && . $HOME/.Eos_env
39
40 EOF
41
42 if [ ! -f $HOME/.Eos_env ] ; then
43         echo "No .Eos_env"
44         ln -sf $EOS_HOME0/env/Eos_env $HOME/.Eos_env 
45 fi
46
47 source ~/.Eos_env || echo "Prepare environment"
48 echo "hostdepend for ${EOS_HOSTDIR}"
49
50 if [ ! -d $EOS_HOME0/hostdepend ] ; then
51         mkdir $EOS_HOME0/hostdepend     
52 fi      
53
54 if [ -d $EOS_HOME0/hostdepend ] ; then
55         cd $EOS_HOME0/hostdepend/;  
56         git clone --depth 1 git://git.sourceforge.jp/gitroot/eos/hostdepend${EOS_HOSTDIR}.git ${EOS_HOSTDIR} || echo "Already installed hostdepend/${EOS_HOSTDIR} or there are something wrong."; 
57 else
58         echo "Cannot make hostdepend"
59 fi