Commit 525fe3e7e31f9ff165ea0caf66cc52a941f3063f

Authored by Erickson Silva
1 parent 571e562c
Exists in master and in 1 other branch devel

Corrige instalador da versão Linux

Showing 1 changed file with 43 additions and 31 deletions   Show diff stats
install/linux/aelius_install.sh 100644 → 100755
1 #!/bin/bash 1 #!/bin/bash
2 2
3 -#Instalador do Tradutor Aelius 3 +read -r -p "Deseja fazer o download das dependências? [Y/n] " response
  4 + response=${response,,} # tolower
  5 + if [[ $response =~ ^(yes|y| ) ]]; then
  6 + mkdir ~/vlibras-libs
  7 + cd ~/vlibras-libs
4 8
5 -mkdir ~/vlibras-libs  
6 -cd ~/vlibras-libs 9 + mkdir aelius
  10 + cd aelius
7 11
8 -mkdir aelius  
9 -cd aelius 12 + wget 150.165.204.30:8080/translate/linux/aelius-install.tar.gz
10 13
11 -wget 150.165.204.30:8080/translate/linux/aelius-install.tar.gz 14 + read -r -p "Deseja instalar as dependências? [Y/n] " response
  15 + response=${response,,} # tolower
  16 + if [[ $response =~ ^(yes|y| ) ]]; then
  17 + echo -e "\n# Extraindo...\n"
  18 + tar -xf aelius-install.tar.gz -C .
12 19
13 -echo -e "\n# Extraindo...\n"  
14 -tar -xf aelius-install.tar.gz -C . 20 + echo -e "# Instalando dependências...\n"
  21 + sudo apt-get install -y python-dev python-setuptools python-yaml python-numpy python-matplotlib
15 22
16 -echo -e "# Instalando dependências...\n"  
17 -sudo apt-get install -y python-dev python-setuptools python-yaml python-numpy python-matplotlib 23 + cd nltk-3.0.0/
18 24
19 -cd nltk-3.0.0/ 25 + sudo python setup.py install
  26 + fi
20 27
21 -sudo python setup.py install 28 + read -r -p "Deseja limpar os arquivos temporários? [Y/n] " response
  29 + response=${response,,} # tolower
  30 + if [[ $response =~ ^(yes|y| ) ]]; then
  31 + cd ..
  32 + rm ~/vlibras-libs/aelius/aelius-install.tar.gz
  33 + fi
22 34
23 -echo -e "\n# Finalizando...\n" 35 + fi
24 36
25 -# path to Aelius Data  
26 -echo -e "\nAELIUS_DATA=\"$HOME/vlibras-libs/aelius/aelius_data\"" >> ~/.bashrc  
27 -echo -e "export AELIUS_DATA" >> ~/.bashrc  
28 37
29 -# path to NLTK Data  
30 -echo -e "\nNLTK_DATA=\"$HOME/vlibras-libs/aelius/nltk_data\"" >> ~/.bashrc  
31 -echo -e "export NLTK_DATA" >> ~/.bashrc 38 +read -r -p "Deseja criar as variáveis de ambiente? [Y/n] " response
  39 + response=${response,,} # tolower
  40 + if [[ $response =~ ^(yes|y| ) ]]; then
  41 + # path to Hunpos Tag
  42 + echo -e "\nHUNPOS_TAGGER=\"$HOME/vlibras-libs/aelius/bin/hunpos-tag\"" >> ~/.bashrc
  43 + echo -e "export HUNPOS_TAGGER" >> ~/.bashrc
32 44
33 -# path to Aelius and Translate package (new version)  
34 -echo -e "\nPYTHONPATH=\"${PYTHONPATH}:$HOME/vlibras-libs/aelius:$HOME/vlibras-translate/src\"" >> ~/.bashrc  
35 -echo -e "export PYTHONPATH\n" >> ~/.bashrc 45 + # path to Aelius Data
  46 + echo -e "\nAELIUS_DATA=\"$HOME/vlibras-libs/aelius/aelius_data\"" >> ~/.bashrc
  47 + echo -e "export AELIUS_DATA" >> ~/.bashrc
36 48
37 -cd .. 49 + # path to NLTK Data
  50 + echo -e "\nNLTK_DATA=\"$HOME/vlibras-libs/aelius/nltk_data\"" >> ~/.bashrc
  51 + echo -e "export NLTK_DATA" >> ~/.bashrc
38 52
39 -sudo mv usr-local-bin.tar.gz /usr/local/bin/ 53 + # path to Aelius and Translate package (new version)
  54 + echo -e "\nPYTHONPATH=\"${PYTHONPATH}:$HOME/vlibras-libs/aelius:$HOME/vlibras-translate/src\"" >> ~/.bashrc
  55 + echo -e "export PYTHONPATH\n" >> ~/.bashrc
40 56
41 -cd /usr/local/bin/ 57 + echo -e "\n## Execute o seguinte comando para concluir:\n\n$ source ~/.bashrc\n"
  58 + fi
42 59
43 -sudo tar -xf usr-local-bin.tar.gz  
44 -sudo rm usr-local-bin.tar.gz  
45 -  
46 -rm ~/vlibras-libs/aelius/aelius-install.tar.gz  
47 -  
48 -echo -e "### Instalação finalizada! \n## Execute o seguinte comando para concluir:\n\n$ source ~/.bashrc\n" 60 +echo -e "### Instalação finalizada!"
49 \ No newline at end of file 61 \ No newline at end of file