mirror of
https://github.com/gryf/vmstrap.git
synced 2025-12-18 20:10:28 +01:00
Merge fedora and centos installation, since they are very similar
This commit is contained in:
100
bootstrap.sh
100
bootstrap.sh
@@ -57,12 +57,20 @@ COMMON_DEB=(exuberant-ctags
|
||||
python3-jedi
|
||||
silversearcher-ag)
|
||||
|
||||
centos7() {
|
||||
# 1. update
|
||||
sudo yum -y install epel-release
|
||||
sudo yum -y update
|
||||
|
||||
# rxvt-unicode-256color to have proper terminfo
|
||||
rpm_based() {
|
||||
if [[ $DISTRO_ID == 'fedora' ]]; then
|
||||
PGS=(ptpython3
|
||||
python2
|
||||
python2-devel
|
||||
python2-pip
|
||||
python3-apsw
|
||||
python3-flake8
|
||||
python3-ipython
|
||||
python3-jedi
|
||||
python3-mccabe
|
||||
python3-pylint)
|
||||
elif [[ $DISTRO_ID == 'centos' ]]; then
|
||||
PGS=(ptpython2
|
||||
python-devel
|
||||
python-flake8
|
||||
@@ -75,6 +83,14 @@ centos7() {
|
||||
python34-apsw
|
||||
python36-jedi
|
||||
python36-mccabe)
|
||||
fi
|
||||
|
||||
# 1. update
|
||||
if [[ $DISTRO_ID == 'centos' ]]; then
|
||||
# install epel repository for centos
|
||||
sudo yum -y install epel-release
|
||||
fi
|
||||
sudo yum -y update
|
||||
|
||||
# 2. install tools
|
||||
sudo yum install -y "${COMMON_PGS[@]}" "${COMMON_RPM[@]}" "${PGS[@]}"
|
||||
@@ -83,10 +99,24 @@ centos7() {
|
||||
sudo yum -y clean all
|
||||
|
||||
# 4. set default editor
|
||||
echo 'export visual="vim"' | sudo tee /etc/profile.d/vim.sh
|
||||
echo 'export editor="vim"' | sudo tee -a /etc/profile.d/vim.sh
|
||||
echo 'export VISUAL="vim"' | sudo tee /etc/profile.d/vim.sh
|
||||
echo 'export EDITOR="vim"' | sudo tee -a /etc/profile.d/vim.sh
|
||||
|
||||
# 5. install tools from pypi (only py3, no more latest setuptools for py2)
|
||||
# 5. install tools from pypi
|
||||
if [[ $DISTRO_ID == 'fedora' ]]; then
|
||||
sudo pip install -U pip setuptools
|
||||
installed_pkgs=$(pip list)
|
||||
pkgs_to_install=
|
||||
for pkg in remote_pdb pdbpp rainbow; do
|
||||
if echo "${installed_pkgs}" | grep -qv "${pkg}"; then
|
||||
pkgs_to_install="${pkgs_to_install} ${pkg}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "${pkgs_to_install}" ]; then
|
||||
sudo pip install ${pkgs_to_install}
|
||||
fi
|
||||
elif [[ $DISTRO_ID == 'centos' ]]; then
|
||||
sudo pip3 install -u pip setuptools
|
||||
installed_pkgs=$(pip list)
|
||||
if echo "${installed_pkgs}" | grep -qv "rainbow"; then
|
||||
@@ -100,52 +130,6 @@ centos7() {
|
||||
sudo pip3 install ${pkg}
|
||||
fi
|
||||
done
|
||||
|
||||
# 6. copy configuration for bash, git, tmux
|
||||
common_conf
|
||||
}
|
||||
|
||||
fedora() {
|
||||
# fedora 31
|
||||
# 1. update
|
||||
sudo yum -y update
|
||||
|
||||
# rxvt-unicode-256color to have proper terminfo
|
||||
|
||||
PGS=(ptpython3
|
||||
python2
|
||||
python2-devel
|
||||
python2-pip
|
||||
python3-apsw
|
||||
python3-flake8
|
||||
python3-ipython
|
||||
python3-jedi
|
||||
python3-mccabe
|
||||
python3-pylint)
|
||||
|
||||
# 2. install tools
|
||||
sudo yum install -y "${COMMON_PGS[@]}" "${COMMON_RPM[@]}" "${PGS[@]}"
|
||||
|
||||
# 3. cleanup
|
||||
sudo yum -y clean all
|
||||
|
||||
# 4. set default editor
|
||||
echo 'export VISUAL="vim"' | sudo tee /etc/profile.d/vim.sh
|
||||
echo 'export EDITOR="vim"' | sudo tee -a /etc/profile.d/vim.sh
|
||||
|
||||
|
||||
# 5. install tools from pypi
|
||||
sudo pip install -U pip setuptools
|
||||
installed_pkgs=$(pip list)
|
||||
pkgs_to_install=
|
||||
for pkg in remote_pdb pdbpp rainbow; do
|
||||
if echo "${installed_pkgs}" | grep -qv "${pkg}"; then
|
||||
pkgs_to_install="${pkgs_to_install} ${pkg}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "${pkgs_to_install}" ]; then
|
||||
sudo pip install ${pkgs_to_install}
|
||||
fi
|
||||
|
||||
# 6. copy configuration for bash, git, tmux
|
||||
@@ -239,12 +223,12 @@ case $DISTRO_ID in
|
||||
ubuntu
|
||||
;;
|
||||
"centos")
|
||||
centos7
|
||||
rpm_based
|
||||
;;
|
||||
"fedora")
|
||||
fedora
|
||||
"fedora") # Fedora 31
|
||||
rpm_based
|
||||
;;
|
||||
*)
|
||||
echo Distribution ${DISTRO_ID} not supported
|
||||
echo "Distribution ${DISTRO_ID} not supported"
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user