source: branches/alilink/SH/arb_installubuntu4arb.sh

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