1 | #!/bin/bash |
---|
2 | # |
---|
3 | # Installs tools and libraries needed to run, compile or develop ARB on Ubuntu. |
---|
4 | # |
---|
5 | # Tested with: |
---|
6 | # * Ubuntu 10.04 (Lucid Lynx) |
---|
7 | # |
---|
8 | # [ May as well work with other ubuntu flavors or debian. |
---|
9 | # Please report working tests and/or send needed changes to devel@arb-home.de |
---|
10 | # ] |
---|
11 | |
---|
12 | listwords() { |
---|
13 | if [ ! -z "$1" ]; then |
---|
14 | echo " $1" |
---|
15 | shift |
---|
16 | listwords $* |
---|
17 | fi |
---|
18 | } |
---|
19 | |
---|
20 | if [ -z "$1" ]; then |
---|
21 | echo "" |
---|
22 | echo "Usage: arb_installubuntu4arb.sh what" |
---|
23 | echo "" |
---|
24 | echo "what installs" |
---|
25 | echo "" |
---|
26 | echo "arb_noOpenGL things needed to run the Non-openGL-version of ARB" |
---|
27 | echo "arb_OpenGL things needed to run the openGL-version of ARB" |
---|
28 | echo "" |
---|
29 | echo "compile_noOpenGL things needed to compile and run the Non-openGL-version of ARB" |
---|
30 | echo "compile_OpenGL things needed to compile and run the openGL-version of ARB" |
---|
31 | echo "" |
---|
32 | echo "develop install 'compile_OpenGL' plus some optional development tools" |
---|
33 | echo "devdox install 'develop' plus things needed for doxygen (big)" |
---|
34 | echo "" |
---|
35 | else |
---|
36 | ARB_PACKAGES=/tmp/$USER.arb_installubuntu4arb |
---|
37 | if [ "$1" == "echo" ]; then |
---|
38 | if [ "$2" == "arb_noOpenGL" ]; then |
---|
39 | echo \ |
---|
40 | gnuplot \ |
---|
41 | gv \ |
---|
42 | libmotif3 \ |
---|
43 | xfig \ |
---|
44 | transfig \ |
---|
45 | xterm \ |
---|
46 | |
---|
47 | # treetool |
---|
48 | |
---|
49 | elif [ "$2" == "arb_OpenGL" ]; then |
---|
50 | $0 echo arb_noOpenGL |
---|
51 | echo \ |
---|
52 | libpng12-0 \ |
---|
53 | |
---|
54 | elif [ "$2" == "compile_common" ]; then |
---|
55 | echo \ |
---|
56 | g++ \ |
---|
57 | libmotif-dev \ |
---|
58 | libtiff4-dev \ |
---|
59 | libx11-dev \ |
---|
60 | libxaw7-dev \ |
---|
61 | libxext-dev \ |
---|
62 | libxml2-utils \ |
---|
63 | libxpm-dev \ |
---|
64 | libxt-dev \ |
---|
65 | lynx \ |
---|
66 | x11proto-print-dev \ |
---|
67 | xsltproc \ |
---|
68 | xutils-dev \ |
---|
69 | |
---|
70 | elif [ "$2" == "compile_noOpenGL" ]; then |
---|
71 | $0 echo arb_noOpenGL |
---|
72 | $0 echo compile_common |
---|
73 | |
---|
74 | elif [ "$2" == "compile_OpenGL" ]; then |
---|
75 | $0 echo arb_OpenGL |
---|
76 | $0 echo compile_common |
---|
77 | echo \ |
---|
78 | freeglut3-dev \ |
---|
79 | libglew1.5-dev \ |
---|
80 | libpng12-dev \ |
---|
81 | |
---|
82 | echo \ |
---|
83 | libglw-mesa-arb \ |
---|
84 | >> $ARB_PACKAGES |
---|
85 | |
---|
86 | elif [ "$2" == "develop" ]; then |
---|
87 | $0 echo compile_OpenGL |
---|
88 | echo \ |
---|
89 | valgrind \ |
---|
90 | ctags \ |
---|
91 | |
---|
92 | elif [ "$2" == "devdox" ]; then |
---|
93 | $0 echo develop |
---|
94 | echo \ |
---|
95 | doxygen \ |
---|
96 | texlive-latex-base \ |
---|
97 | texlive-base-bin \ |
---|
98 | |
---|
99 | else |
---|
100 | echo error_unknown_target_$2 |
---|
101 | fi |
---|
102 | else |
---|
103 | echo "Ubuntu for ARB installer" |
---|
104 | test -f $ARB_PACKAGES && rm $ARB_PACKAGES |
---|
105 | PACKAGES=`$0 echo $1` |
---|
106 | ALLPACKAGES=`echo $PACKAGES;test -f $ARB_PACKAGES && cat $ARB_PACKAGES` |
---|
107 | echo "Packages needed for '$1': `echo $ALLPACKAGES | wc -w`" |
---|
108 | # listwords $PACKAGES |
---|
109 | |
---|
110 | echo '-------------------- [apt start]' |
---|
111 | apt-get -y install $PACKAGES |
---|
112 | echo '-------------------- [apt end]' |
---|
113 | |
---|
114 | if [ -f $ARB_PACKAGES ]; then |
---|
115 | echo "Packages provided by ARB developers: `cat $ARB_PACKAGES | wc -w`" |
---|
116 | listwords `cat $ARB_PACKAGES` |
---|
117 | DISTRIB=`cat /etc/lsb-release | grep DISTRIB_CODENAME | perl -npe 's/^.*=//'` |
---|
118 | SOURCE="deb http://dev.mikro.biologie.tu-muenchen.de/debian $DISTRIB non-free" |
---|
119 | echo '-------------------- [apt start]' |
---|
120 | apt-get install \ |
---|
121 | `cat $ARB_PACKAGES` \ |
---|
122 | || ( \ |
---|
123 | echo "-----------------------------------------" ;\ |
---|
124 | echo "Install of arb-specific libraries failed!" ;\ |
---|
125 | echo "Did you add the line" ;\ |
---|
126 | echo "$SOURCE" ;\ |
---|
127 | echo "to /etc/apt/sources.list, e.g. using" ;\ |
---|
128 | echo "" ;\ |
---|
129 | echo "sudo bash -c 'echo $SOURCE >> /etc/apt/sources.list'" ;\ |
---|
130 | echo "sudo aptitude update" ;\ |
---|
131 | echo "???" ;\ |
---|
132 | ) |
---|
133 | echo '-------------------- [apt end]' |
---|
134 | fi |
---|
135 | test -f $ARB_PACKAGES && rm $ARB_PACKAGES |
---|
136 | fi |
---|
137 | fi |
---|