Permalink
Browse files

case created

  • Loading branch information...
2 parents 9cbcd9f + f991baa commit 4cd5f95060b88551f479e5e3f08fd775ed082f49 @special-k special-k committed Mar 13, 2012
Showing with 202 additions and 87 deletions.
  1. +3 −5 README
  2. +5 −0 files/.zshrc
  3. +194 −82 install-all.sh
View
8 README
@@ -1,9 +1,7 @@
-first
+first in command line
sudo apt-get install zsh
-chsh
-/bin/zsh
then
download https://raw.github.com/Talleyran/install_script/master/install-all.sh
set vars in install-all.sh
-chmod +x
-run it
+chmod +x install-all.sh
+./install-all.sh
View
5 files/.zshrc
@@ -57,13 +57,18 @@ alias grsh='git reset --hard'
alias gcur='git rev-parse HEAD'
alias gcam='git commit --amend'
alias gar="git add .&&git ls-files --deleted | xargs git rm"
+<<<<<<< HEAD
alias gar="git add .&&git ls-files --deleted | xargs git rm"
alias gd="git diff"
alias gdh="git diff HEAD"
alias gsi="git submodule init"
alias gsu="git submodule update"
alias hids="history | grep"
+=======
+alias gd="git diff"
+alias gdh="git diff HEAD"
+>>>>>>> f991baa639ba28dc7fe9d6e1e318af37f283f763
alias xclip='xclip -selection c'
View
276 install-all.sh
@@ -6,119 +6,231 @@ name='Kirill Jakovlev'
email='special-k@li.ru'
githubuser=$USER
pguser=$USER
+if [[ `egrep -o '[0-9]+\.[0-9]+' /etc/issue` > "11.04" ]]
+then
+ version=new
+else
+ version=old
+fi
-cd ~
-#clean
-rm -rf .vim
-rm -f .vimrc
-rm -rf .oh-my-zsh
-rm -f .zshrc
-rm -rf source/$mapserver
-rm -f source/$mapserver.tar.gz
-rm -rf .rvm
+show_help() {
+ echo 'You can install:
+ rsa
+ system
+ git
+ vim
+ ruby
+ desktop
+ gis
+ mapscript
+
+ usage:
+ install-all [ prog1 prog2 ... [--except prog1 prog2 ... ] ]
+
+ examples of usage:
+ install-all vim ruby - this install vim and ruby
+ install-all --except vim ruby - this install all except vim and ruby
+ install-all - this install all'
+ }
+
+
+case $1 in
+ --except) b=false
+ ;;
+ -ex) b=false
+ ;;
+ --help)
+ show_help
+ exit 0
+ ;;
+ -h)
+ show_help
+ exit 0
+ ;;
+ ?)
+ b=true
+ ;;
+esac
+
+if $b
+then
+ not_b=false
+else
+ not_b=true
+fi
+rsa=$not_b
+system=$not_b
+git=$not_b
+vim=$not_b
+ruby=$not_b
+desktop=$not_b
+gis=$not_b
+mapscript=$not_b
+
+for i in $*
+do
+ case $i in
+ rsa) rsa=$b
+ ;;
+ system) system=$b
+ ;;
+ git) git=$b
+ ;;
+ vim) vim=$b
+ ;;
+ ruby) ruby=$b
+ ;;
+ desktop) desktop=$b
+ ;;
+ gis) gis=$b
+ ;;
+ mapscript) mapscript=$b
+ ;;
+ esac
+done
+
+cd ~
#sudo
-sudo echo Now sudo
+sudo echo We are sudo
#set shell
chsh -s /bin/zsh
#gen rsa
-ssh-keygen -t rsa
+if $rsa;then
+ ssh-keygen -t rsa
+fi
# update & upgrade
sudo apt-get update
sudo apt-get dist-upgrade -y
#system
-sudo apt-get install -y curl git-core mercurial
-git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
-curl https://raw.github.com/Talleyran/install_script/master/files/special_dallas.zsh-theme > .oh-my-zsh/themes/special_dallas.zsh-theme
-curl https://raw.github.com/Talleyran/install_script/master/files/.zshrc > .zshrc
+if $system;then
+ rm -rf .oh-my-zsh #clean
+ rm -f .zshrc #clean
+ sudo apt-get install -y curl git-core mercurial
+ git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
+ curl https://raw.github.com/Talleyran/install_script/master/files/special_dallas.zsh-theme > .oh-my-zsh/themes/special_dallas.zsh-theme
+ curl https://raw.github.com/Talleyran/install_script/master/files/.zshrc > .zshrc
+fi
#git
-git config --global --replace-all user.name "$name"
-git config --global --replace-all user.email "$email"
-git config --global --replace-all github.user "$githubuser"
+if $git;then
+ git config --global --replace-all user.name "$name"
+ git config --global --replace-all user.email "$email"
+ git config --global --replace-all github.user "$githubuser"
+fi
#vim
-git clone git@github.com:Talleyran/myvim.git ~/.vim
-cd ~/.vim
-git submodule init
-git submodule update
-cp ~/.vim/.vimrc ~/
-cp ~/.vim/.iabbrev ~/
-ln -s ~/.vim/vim-pathogen/autoload ~/.vim/autoload
-cd ~
+if $vim;then
+ rm -rf .vim #clean
+ rm -f .vimrc #clean
+ sudo apt-get install -y vim-gnome
+ git clone git@github.com:Talleyran/myvim.git ~/.vim
+ cd ~/.vim
+ git submodule init
+ git submodule update
+ cp ~/.vim/.vimrc ~/
+ cp ~/.vim/.iabbrev ~/
+ ln -s ~/.vim/vim-pathogen/autoload ~/.vim/autoload
+ cd ~
+fi
#ruby
-sudo apt-get install -y build-essential libssl-dev libreadline-dev zlib1g-dev libssl-dev libpq-dev libxml2 libxml2-dev libxslt-dev libmagickwand-dev
-bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
-source ~/.zshrc
-rvm install $ruby
-rvm use $ruby --default
-gem install bundler
+if $ruby;then
+ rm -rf .rvm #clean
+ sudo apt-get install -y build-essential libssl-dev libreadline-dev zlib1g-dev libssl-dev libpq-dev libxml2 libxml2-dev libxslt-dev libmagickwand-dev
+ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
+ source ~/.zshrc
+ rvm install $ruby
+ rvm use $ruby --default
+ gem install bundler
+fi
#desktop
-sudo apt-get install -y xclip vlc
-sudo apt-get purge -y totem banshee
-sudo add-apt-repository -y ppa:alexey-smirnov/deadbeef
-sudo apt-get update
-sudo apt-get install -y deadbeef
+if $desktop;then
+ sudo apt-get install -y xclip vlc
+ sudo apt-get purge -y totem banshee
+ if [[ $version = new ]]
+ then
+ sudo add-apt-repository -y ppa:alexey-smirnov/deadbeef
+ sudo add-apt-repository -y ppa:atareao/atareao
+ else
+ sudo add-apt-repository ppa:alexey-smirnov/deadbeef
+ sudo add-apt-repository ppa:atareao/atareao
+ fi
+ sudo apt-get update
+ sudo apt-get install -y deadbeef touchpad-indicator
+fi
#postgres
-sudo apt-get install -y postgresql pgadmin3
-sudo -u postgres createuser -s special-k
-sudo -u postgres psql -c "alter role \"$pguser\" password '$pgpass';"
+if $postgres;then
+ sudo apt-get install -y postgresql pgadmin3
+ sudo -u postgres createuser -s special-k
+ sudo -u postgres psql -c "alter role \"$pguser\" password '$pgpass';"
+fi
#gis
-sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
-sudo apt-get update
-sudo apt-get install -y qgis mapserver-bin postgres postgis postgres-8.4-postgis
+if $gis;then
+ if [[ $version = new ]]
+ then
+ sudo add-apt-repository -y ppa:alexey-smirnov/deadbeef
+ else
+ sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
+ fi
+ sudo apt-get update
+ sudo apt-get install -y qgis mapserver-bin postgis postgresql-8.4-postgis
+fi
#mapscript
-sudo apt-get install -y libfreetype6-dev libgif-dev libpng-dev libjpeg-dev libgdal-dev libgd2-xpm-dev libproj-dev libcurl4-openssl-dev libxslt-dev libghc6-cairo-dev swig
-if [ ! -d ~/source ]; then
- mkdir ~/source
-fi
-cd ~/source
-curl http://download.osgeo.org/mapserver/$mapserver.tar.gz > $mapserver.tar.gz
-tar xvzf $mapserver.tar.gz
-cd $mapserver
-./configure --with-gdal=/usr/bin/gdal-config \
---with-ogr=/usr/bin/gdal-config \
---with-wfsclient \
---with-wmsclient \
---with-curl-config=/usr/bin/curl-config \
---with-proj=/usr/ \
---with-tiff \
---with-jpeg \
---with-freetype=/usr/ \
---with-threads \
---with-wcs \
---with-postgis=yes \
---with-libiconv=/usr \
---with-geos=/usr/bin/geos-config \
---with-xml2-config=/usr/bin/xml2-config \
---with-sos \
---without-agg-svg-symbols \
---with-cairo=yes \
---with-kml=yes \
---with-exslt
-make
-cd mapscript/ruby
-ruby ./extconf.rb
-make
-for i in $(ruby -e 'puts $LOAD_PATH')
-do
- for j in $(find $i -maxdepth 1 -name '*.so')
+if $mapscript;then
+ rm -rf source/$mapserver
+ rm -f source/$mapserver.tar.gz
+ sudo apt-get install -y libfreetype6-dev libgif-dev libpng-dev libjpeg-dev libgdal-dev libgd2-xpm-dev libproj-dev libcurl4-openssl-dev libxslt-dev libghc6-cairo-dev swig
+ if [ ! -d ~/source ]; then
+ mkdir ~/source
+ fi
+ cd ~/source
+ curl http://download.osgeo.org/mapserver/$mapserver.tar.gz > $mapserver.tar.gz
+ tar xvzf $mapserver.tar.gz
+ cd $mapserver
+ ./configure --with-gdal=/usr/bin/gdal-config \
+ --with-ogr=/usr/bin/gdal-config \
+ --with-wfsclient \
+ --with-wmsclient \
+ --with-curl-config=/usr/bin/curl-config \
+ --with-proj=/usr/ \
+ --with-tiff \
+ --with-jpeg \
+ --with-freetype=/usr/ \
+ --with-threads \
+ --with-wcs \
+ --with-postgis=yes \
+ --with-libiconv=/usr \
+ --with-geos=/usr/bin/geos-config \
+ --with-xml2-config=/usr/bin/xml2-config \
+ --with-sos \
+ --without-agg-svg-symbols \
+ --with-cairo=yes \
+ --with-kml=yes \
+ --with-exslt
+ make
+ cd mapscript/ruby
+ ruby ./extconf.rb
+ make
+ for i in $(ruby -e 'puts $LOAD_PATH')
do
- cp *.so $i/
- break
+ for j in $(find $i -maxdepth 1 -name '*.so')
+ do
+ cp *.so $i/
+ break
+ done
done
-done
-cd ~
+ cd ~
+fi
#autoclean
sudo apt-get autoclean

0 comments on commit 4cd5f95

Please sign in to comment.