-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·63 lines (54 loc) · 1.59 KB
/
bootstrap.sh
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
C='\033[0;32m'
NC='\033[0m'
if [ -z "$MYDEFLIB" ]; then
printf "\n${C}#---- New install ----${NC}\n"
NEWINSTALL=1
else
printf "\n${C}#---- Install Path ----${NC}\n"
echo PATH: $PATH
echo PERL5LIB: $PERL5LIB
echo MYDEFLIB: $MYDEFLIB
save_PATH=$PATH
save_PERL5LIB=$PERL5LIB
save_MYDEFLIB=$MYDEFLIB
fi
# make sure we have mydef_boot
git submodule update --init
BOOT=mydef_boot
export PATH=$BOOT/bin:$PATH
export PERL5LIB=$BOOT/lib/perl5
export MYDEFLIB=$BOOT/lib/MyDef:deflib
printf "\n${C}#---- Compile from fresh MyDef source ----${NC}\n"
perl $BOOT/bin/mydef_make
touch *.def
make
printf "\n${C}#---- Install updated MyDef ----${NC}\n"
if [ "$NEWINSTALL" = 1 ]; then
bin_dir=$HOME/bin
lib_dir=$HOME/lib
install -d $bin_dir
install -d $lib_dir
install -d $lib_dir/perl5
install -d $lib_dir/MyDef
export PATH=$bin_dir:$PATH
export PERL5LIB=$lib_dir/perl5
export MYDEFLIB=$lib_dir/MyDef
else
export PATH=$save_PATH
export PERL5LIB=$save_PERL5LIB
export MYDEFLIB=$save_MYDEFLIB
fi
MY_INSTALL="perl out/script/mydef_install"
$MY_INSTALL deflib . def
$MY_INSTALL out/lib . pm
$MY_INSTALL out/script . -
if [ "$NEWINSTALL" = 1 ]; then
printf "\n${C}#---- MyDef INSTALLED ----${NC}\n"
echo "By Default, MyDef is intalled in $bin_dir and $lib_dir"
echo " to use MyDef, you need:"
echo " * add $bin_dir to your PATH"
echo " * set PERL5LIB=$lib_dir/perl5"
echo " * set MYDEFLIB=$lib_dir/MyDef"
echo " * set MYDEFSRC=`pwd`"
echo " It is recommended to set them in your ~/.bashrc"
fi