-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsetup.sh
executable file
·122 lines (101 loc) · 4.46 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/sh
#
# Pierrick Koch - for morse.openrobots.org
#
# Edited by Marc H
#
# This script installs MORSE, ROS, Blender and Python3.3 on Ubuntu 12.04. To use, create a local directory in home,
# cd into it and execute this script. It will ask for sudo password to install cmake, git and ros packages globally,
# all other is installed per user. Paths are set by sourcing the .bashrc inside your development directory (automatically
# sourced in ~/.bashrc by this script).
#
sudo apt-get install cmake git zlib1g-dev
workspace=$(pwd)
[ "$workspace" = "$HOME" ] && echo "Create a new directory and run this script in it." && exit 1
echo -n "Install in ${workspace} ? [y/N] "
read ok
[ "y" != "$ok" ] && exit 1
mkdir -p ${workspace}/opt ${workspace}/tmp ${workspace}/src
cd ${workspace}/tmp
echo "Install Python 3.3"
(wget -cq http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2 && \
tar jxf Python-3.3.0.tar.bz2 && cd Python-3.3.0 && \
LDFLAGS=-Wl,-rpath=${workspace}/lib ./configure --prefix=${workspace} --enable-shared && make install)
[ -z "$(uname -p | grep 64)" ] && arch="i686" || arch="x86_64"
BLENDER="blender-2.65a-linux-glibc211-$arch"
echo "Install ${BLENDER}"
(wget -cq http://download.blender.org/release/Blender2.65/${BLENDER}.tar.bz2 && \
tar jxf ${BLENDER}.tar.bz2 && mv ${BLENDER} ${workspace}/opt/blender && \
ln -s ../opt/blender/blender ${workspace}/bin/blender) #&
echo "Setting up Pyhton CLI completion and history"
cat > ${workspace}/.pyrc << EOF
import os
import readline
histfile = os.path.join(os.path.expanduser("~"), ".pyhistory")
try:
readline.read_history_file(histfile)
except IOError:
pass
import rlcompleter
readline.parse_and_bind("tab: complete")
readline.parse_and_bind("ctrl-space: complete")
import atexit
atexit.register(readline.write_history_file, histfile)
del os, histfile, readline, rlcompleter
EOF
cat > ${workspace}/.bashrc << EOF
# Python CLI completion and history
export PYTHONSTARTUP=${workspace}/.pyrc
# Blender
export MORSE_BLENDER=${workspace}/opt/blender/blender
alias blender=${workspace}/opt/blender/blender
# Python
export PATH=\$PATH:${workspace}/bin
export PYTHONPATH=\$PYTHONPATH:${workspace}/lib/python3.3/dist-packages
export PKG_CONFIG_PATH=${workspace}/lib/pkgconfig:\$PKG_CONFIG_PATH
# Colorize MORSE :-)
alias morse="env LD_LIBRARY_PATH=${workspace}/lib morse -c"
EOF
echo "[ -f ${workspace}/.bashrc ] && source ${workspace}/.bashrc" >> ~/.bashrc
source ${workspace}/.bashrc
#
# ROS specific
#
echo "Install Python YAML w/ python3.3"
(wget -cq http://pyyaml.org/download/pyyaml/PyYAML-3.10.tar.gz && \
tar zxf PyYAML-3.10.tar.gz && cd PyYAML-3.10 && \
wait $pypid && ${workspace}/bin/python3.3 setup.py install) &
echo "Install distribute w/ python3.3"
wget -cq https://gist.githubusercontent.com/anonymous/947191a4635cd7b7f79a/raw/36054b7f8d7b0c4c172628fd9bd16f46e53bb34b/distribute_setup.py
${workspace}/bin/python3.3 distribute_setup.py
ubuntu_codename=$(lsb_release -cs)
[ "0" != "$?" ] && echo "[ERROR] lsb_release: not running Ubuntu ?" && exit 1
echo "Install ROS on ${ubuntu_codename} in /opt needs to sudo"
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install ros-hydro-desktop-full python-rosinstall git-cvs
sudo rosdep init
rosdep update
echo "[ -f /opt/ros/hydro/setup.bash ] && source /opt/ros/hydro/setup.bash" >> ${workspace}/.bashrc
echo "Install rospkg w/ python3.3"
cd ${workspace}/tmp && git clone https://github.com/ros/rospkg.git
cd rospkg && git checkout 1.0.20
${workspace}/bin/python3.3 setup.py install
cd ${workspace}/tmp && git clone https://github.com/ros-infrastructure/catkin_pkg.git
cd catkin_pkg && git checkout 0.1.10
${workspace}/bin/python3.3 setup.py install
cd ${workspace}/tmp && git clone https://github.com/ros/catkin.git
cd catkin && git checkout 0.5.65
${workspace}/bin/python3.3 setup.py install
cd ${workspace}/tmp && git clone https://github.com/numpy/numpy.git
cd numpy && git checkout v1.7.1
${workspace}/bin/python3.3 setup.py install
echo "Install MORSE (latest from git master branch)"
(cd ${workspace}/src && git clone https://github.com/strands-project/morse.git && \
wait $pypid && cd ${workspace}/src/morse && mkdir -p build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=${workspace} -DPYMORSE_SUPPORT=ON \
-DPYTHON_EXECUTABLE=${workspace}/bin/python3.3 -DBUILD_ROS_SUPPORT=ON .. && \
make install) &
echo "done."
cd ${workspace}