source: tags/arb-6.0/SH/arb_installubuntu4arb.sh

Last change on this file was 11820, checked in by westram, 10 years ago
  • added libglib2.0-dev
  • Property svn:executable set to *
File size: 4.4 KB
Line 
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
12listwords() {
13    if [ ! -z "$1" ]; then
14        echo "    $1"
15        shift
16        listwords $*
17    fi
18}
19
20if [ -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 ""
35else
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                libmotif4 \
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                libglib2.0-dev \
58                libmotif-dev \
59                libreadline-dev \
60                libtiff4-dev \
61                libx11-dev \
62                libxaw7-dev \
63                libxext-dev \
64                libxml2-utils \
65                libxpm-dev \
66                libxt-dev \
67                lynx \
68                x11proto-print-dev \
69                xsltproc \
70                xutils-dev \
71
72        elif [ "$2" == "compile_noOpenGL" ]; then
73            $0 echo arb_noOpenGL
74            $0 echo compile_common
75           
76        elif [ "$2" == "compile_OpenGL" ]; then
77            $0 echo arb_OpenGL
78            $0 echo compile_common
79            echo \
80                freeglut3-dev \
81                libglew1.5-dev \
82                libpng12-dev \
83               
84            echo \
85                libglw-mesa-arb \
86                >> $ARB_PACKAGES
87
88        elif [ "$2" == "develop" ]; then
89            $0 echo compile_OpenGL
90            echo \
91                valgrind \
92                pixmap \
93                ctags \
94
95        elif [ "$2" == "devdox" ]; then
96            $0 echo develop
97            echo \
98                doxygen \
99                texlive-latex-base \
100                texlive-base-bin \
101
102        else
103            echo error_unknown_target_$2
104        fi
105    else
106        echo "Ubuntu for ARB installer"
107        test -f $ARB_PACKAGES && rm $ARB_PACKAGES
108        PACKAGES=`$0 echo $1`
109        ALLPACKAGES=`echo $PACKAGES;test -f $ARB_PACKAGES && cat $ARB_PACKAGES`
110        echo "Packages needed for '$1': `echo $ALLPACKAGES | wc -w`"
111        # listwords $PACKAGES
112
113        echo '-------------------- [apt start]'
114        apt-get -y install $PACKAGES
115        echo '-------------------- [apt end]'
116
117        if [ -f $ARB_PACKAGES ]; then
118            echo "Packages provided by ARB developers: `cat $ARB_PACKAGES | wc -w`"
119            listwords `cat $ARB_PACKAGES`
120            DISTRIB=`cat /etc/lsb-release | grep DISTRIB_CODENAME | perl -npe 's/^.*=//'`
121            SOURCE="deb http://dev.mikro.biologie.tu-muenchen.de/debian $DISTRIB non-free"
122            echo '-------------------- [apt start]'
123            apt-get install \
124                `cat $ARB_PACKAGES` \
125                || ( \
126                echo "-----------------------------------------" ;\
127                echo "Install of arb-specific libraries failed!" ;\
128                echo "Did you add the line" ;\
129                echo "$SOURCE" ;\
130                echo "to /etc/apt/sources.list, e.g. using" ;\
131                echo "" ;\
132                echo "sudo apt-add-repository '$SOURCE'" ;\
133                echo "sudo apt-get update" ;\
134                echo "???" ;\
135                )
136            echo '-------------------- [apt end]'
137        fi
138        test -f $ARB_PACKAGES && rm $ARB_PACKAGES
139    fi
140fi
Note: See TracBrowser for help on using the repository browser.