source: tags/ms_r16q3/SH/arb_installubuntu4arb.sh

Last change on this file was 14798, checked in by westram, 8 years ago
  • fix Ubuntu 16.04 build
    • add gcc 5.3.1
      • fix isnan/isinf use (only in testcode)
    • fix libdepends in install-scripts and -READMEs
  • Property svn:executable set to *
File size: 4.5 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 16.04 (Xenial Xerus)
7#
8# Previous version of this script is available at
9# http://bugs.arb-home.de/export/14409/trunk/SH/arb_installubuntu4arb.sh
10#
11# [ May as well work with other ubuntu flavors or debian.
12#   Please report working tests and/or send needed changes to devel@arb-home.de
13# ]
14
15listwords() {
16    if [ ! -z "$1" ]; then
17        echo "    $1"
18        shift
19        listwords $*
20    fi
21}
22
23if [ -z "$1" ]; then
24    echo ""
25    echo "Usage: arb_installubuntu4arb.sh what"
26    echo ""
27    echo "what                installs"
28    echo ""
29    echo "arb_noOpenGL        things needed to run the Non-openGL-version of ARB"
30    echo "arb_OpenGL          things needed to run the openGL-version of ARB"
31    echo ""
32    echo "compile_noOpenGL    things needed to compile and run the Non-openGL-version of ARB"
33    echo "compile_OpenGL      things needed to compile and run the openGL-version of ARB"
34    echo ""
35    echo "develop             install 'compile_OpenGL' plus some optional development tools"
36    echo "devdox              install 'develop' plus things needed for doxygen (big)" 
37    echo ""
38else
39    ARB_PACKAGES=/tmp/$USER.arb_installubuntu4arb
40    if [ "$1" == "echo" ]; then
41        if [ "$2" == "arb_noOpenGL" ]; then
42            echo \
43                gnuplot \
44                gv \
45                libmotif-common \
46                libxerces-c3.1 \
47                transfig \
48                xfig \
49                xterm \
50
51#                treetool
52
53        elif [ "$2" == "arb_OpenGL" ]; then
54            $0 echo arb_noOpenGL
55            echo \
56                libpng12-0 \
57
58        elif [ "$2" == "compile_common" ]; then
59            echo \
60                g++ \
61                libglib2.0-dev \
62                libmotif-dev \
63                libreadline-dev \
64                libtiff5-dev \
65                libx11-dev \
66                libxaw7-dev \
67                libxext-dev \
68                libxerces-c-dev \
69                libxml2-utils \
70                libxpm-dev \
71                libxt-dev \
72                lynx \
73                x11proto-print-dev \
74                xsltproc \
75                xutils-dev \
76
77        elif [ "$2" == "compile_noOpenGL" ]; then
78            $0 echo arb_noOpenGL
79            $0 echo compile_common
80
81        elif [ "$2" == "compile_OpenGL" ]; then
82            $0 echo arb_OpenGL
83            $0 echo compile_common
84            echo \
85                freeglut3-dev \
86                libglew-dev \
87                libpng12-dev \
88
89            echo \
90                libglw-mesa-arb \
91                >> $ARB_PACKAGES
92
93        elif [ "$2" == "develop" ]; then
94            $0 echo compile_OpenGL
95            echo \
96                valgrind \
97                pixmap \
98                exuberant-ctags \
99
100        elif [ "$2" == "devdox" ]; then
101            $0 echo develop
102            echo \
103                doxygen \
104                texlive-latex-base \
105                texlive-base-bin \
106
107        else
108            echo error_unknown_target_$2
109        fi
110    else
111        echo "Ubuntu for ARB installer"
112        test -f $ARB_PACKAGES && rm $ARB_PACKAGES
113        PACKAGES=`$0 echo $1`
114        ALLPACKAGES=`echo $PACKAGES;test -f $ARB_PACKAGES && cat $ARB_PACKAGES`
115        echo "Packages needed for '$1': `echo $ALLPACKAGES | wc -w`"
116        # listwords $PACKAGES
117
118        echo '-------------------- [apt start]'
119        apt-get -y install $PACKAGES
120        echo '-------------------- [apt end]'
121
122        if [ -f $ARB_PACKAGES ]; then
123            echo "Packages provided by ARB developers: `cat $ARB_PACKAGES | wc -w`"
124            listwords `cat $ARB_PACKAGES`
125            DISTRIB=`cat /etc/lsb-release | grep DISTRIB_CODENAME | perl -npe 's/^.*=//'`
126            SOURCE="deb http://dev.arb-home.de/debian $DISTRIB non-free"
127            echo '-------------------- [apt start]'
128            apt-get install \
129                `cat $ARB_PACKAGES` \
130                || ( \
131                echo "-----------------------------------------" ;\
132                echo "Install of arb-specific libraries failed!" ;\
133                echo "Did you add the line" ;\
134                echo "$SOURCE" ;\
135                echo "to /etc/apt/sources.list, e.g. using" ;\
136                echo "" ;\
137                echo "sudo apt-add-repository '$SOURCE'" ;\
138                echo "sudo apt-get update" ;\
139                echo "???" ;\
140                )
141            echo '-------------------- [apt end]'
142        fi
143        test -f $ARB_PACKAGES && rm $ARB_PACKAGES
144    fi
145fi
Note: See TracBrowser for help on using the repository browser.