Skip to content

Commit

Permalink
Ajustando instalador #161
Browse files Browse the repository at this point in the history
  • Loading branch information
cauachagas committed Jun 21, 2019
1 parent 21459ef commit 7713ca5
Showing 1 changed file with 73 additions and 18 deletions.
91 changes: 73 additions & 18 deletions bin/instalador.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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=
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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

0 comments on commit 7713ca5

Please sign in to comment.