]> wagnertech.de Git - projects.git/blob - debian/eclipse.prepare
libcob-ocesql build
[projects.git] / debian / eclipse.prepare
1 #!/bin/bash
2 set -e
3
4 if [ -z "$1" ]; then
5         echo "usage eclipse.prepare ECLIPSE_PATTERN"
6         exit 6
7 fi
8 ECLIPSE_PATTERN=$1
9
10 # check, if there is exactly 1 eclipse-cpp*.tar.gz in Downloads
11 pushd Downloads >/dev/null
12         if [ $(ls $ECLIPSE_PATTERN| wc -l) -ne 1 ]; then
13                 echo "Es muss genau ein $ECLIPSE_PATTERN in Downloads sein."
14                 exit 8
15         fi
16         eclipse_tgz=$(ls $ECLIPSE_PATTERN)
17         
18         # entpacke tar.gz
19         if [ -d eclipse ]; then
20                 rm -r eclipse
21         fi
22         tar xf $eclipse_tgz
23 popd >/dev/null
24
25 # bestimme eclipse version
26 eversion=${eclipse_tgz#eclipse-*-}
27 eversion=${eversion%-linux*}
28 echo "version=$eversion" >> debian/rules.pre
29 echo "export version=$eversion" >> debian/setenv.sh
30
31 # bestimme arch
32 arch=${eclipse_tgz#*gtk-}
33 arch=${arch%.tar.gz}
34 echo "arch=$arch" >> debian/rules.pre
35 echo "export arch=$arch" >> debian/setenv.sh
36
37