From 7713ca5861407f78330380bb73a9848ea19a1f9d Mon Sep 17 00:00:00 2001 From: cauachagas Date: Fri, 21 Jun 2019 07:51:48 -0300 Subject: [PATCH] Ajustando instalador #161 --- bin/instalador.sh | 91 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 18 deletions(-) diff --git a/bin/instalador.sh b/bin/instalador.sh index c28e21d..6783c38 100755 --- a/bin/instalador.sh +++ b/bin/instalador.sh @@ -1,4 +1,7 @@ #!/usr/bin/env sh +# rodar script usando: +# ". instalador.sh" ou "bash -i instalador.sh" +# ver https://askubuntu.com/a/1102119 #quiet #dependencias=dev,user @@ -12,6 +15,7 @@ quiet=0 dependencias=dev pandoc=0 tex=tiny +distro=$(lsb_release -i -s) codename=$(lsb_release -c -s) grupo=basico pacotes= @@ -62,26 +66,56 @@ while getopts "DPCd:t:c:g:p:" opt; do done # ler distribuição: lsb_release -c -s -if [ "$codename" = "xenial" ]; then - +if [ "$distro" = "Ubuntu" -o "$distro" = "ManjaroLinux" ]; then if [ "$dependencias" = "dev" ]; then echo Instalando dependências de desenvolvimento... - $dry sudo apt-get install -y -qq \ + if [ "$distro" = "Ubuntu" ]; then + $dry sudo apt-get install -y -qq \ language-pack-pt \ libreoffice \ locales \ pdfgrep \ - pdftk \ poppler-utils \ ruby-full \ unzip \ xclip + if [ "$codename" = "Bionic" ]; then + $dry add-apt-repository ppa:malteworld/ppa -y + $dry sudo apt-get update + $dry sudo apt-get install pdftk -y + else + # Ubuntu >= 18.10 + $dry sudo apt-get install pdftk-java -y + fi + elif [ "$distro" = "ManjaroLinux" ]; then + $dry sudo pacman -S --noconfirm \ + ruby \ + poppler \ + xclip \ + pacaur + $dry yes J | pacaur -S pdftk-bin + fi elif [ "$dependencias" = "user" ]; then $dry echo Opção ainda não implementada: user fi if [ "$tex" = "none" ]; then echo Ignorando instalação do Latex + elif [ "$tex" = "system" ]; then + if [ "$distro" = "ManjaroLinux" ]; then + $dry sudo pacman -S texlive-core \ + texlive-bin \ + texlive-latexextra + $dry yes J | pacaur -S abntex2 + elif [ "$distro" = "Ubuntu" ]; then + $dry sudo apt-get install -y \ + texlive \ + texlive-publishers \ + texlive-lang-portuguese \ + texlive-latex-extra \ + texlive-fonts-recommended \ + texlive-xetex + fi elif [ "$tex" = "tiny" ]; then tex_em_cache=0 @@ -92,12 +126,17 @@ if [ "$codename" = "xenial" ]; then fi fi - if [ $tex_em_cache -eq 1 ]; then - : #echo TinyTeX não será instalado. + if [ $tex_em_cache -eq 1 ]; + then + echo TinyTeX não será instalado. else echo Instalando o tinytex... $dry wget -qO- "https://yihui.name/gh/tinytex/tools/install-unx.sh" | $dry sh - + # Deve ser colocado no Path, se não tlmgr dá comando não encontrado + $dry echo -e "\n\n# TinyTeX BIN" >> ~/.bashrc + $dry echo -e "export "PATH"=$"PATH":~/.TinyTeX/bin/x86_64-linux" >> ~/.bashrc + $dry source ~/.bashrc + if [ "$grupo" = "basico" ]; then $dry tlmgr install abntex2 \ babel-portuges \ @@ -114,22 +153,38 @@ if [ "$codename" = "xenial" ]; then elif [ "$grupo" = "extras" ]; then $dry Opção ainda não implementada: extras fi - + if [ -n "$pacotes" ] ; then $dry tlmgr install $pacotes fi - + $dry tlmgr option -- autobackup 0 - fi - - - fi #tex - -fi # xenial + + fi #tex + fi +fi # UbuntuLinux | ManjaroLinux if [ "$pandoc" -eq 1 ] then - #echo Instalando o pandoc... - $dry wget -nv https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-1-amd64.deb \ - && $dry sudo dpkg -i pandoc-*.deb + echo Ignorando instalação dos Binários do Pandoc + if [ "$distro" = "ManjaroLinux" ]; then + $dry yes J | pacaur -S pandoc-bin + else + #echo Instalando o pandoc... + $dry wget -nv https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-1-amd64.deb \ + && $dry sudo dpkg -i pandoc-*.deb + fi +fi + +if ! $dry gem install limarka +then + $dry "Não foi possível instalar o limarka" + $dry exit 1 fi + +# Especifico pro Manjaro +if [ "$distro" = "ManjaroLinux" ]; then + $dry echo -e "\n\n# RUBY GEMS BIN" >> ~/.bashrc + $dry echo -e "export "PATH"=$"PATH":~/.gem/ruby/2.6.0/bin" >> ~/.bashrc + $dry source ~/.bashrc +fi \ No newline at end of file