+#!/bin/bash
+set -e
+
+ECPP_PATTERN="eclipse-cpp*.tar.gz"
+
+# check, if there is exactly 1 eclipse-cpp*.tar.gz in Downloads
+pushd Downloads >/dev/null
+ if [ $(ls $ECPP_PATTERN| wc -l) -ne 1 ]; then
+ echo "Es muss genau ein $ECPP_PATTERN in Downloads sein."
+ exit 8
+ fi
+ eclipse_cpp_tgz=$(ls $ECPP_PATTERN)
+
+ # entpacke tar.gz
+ if [ -d eclipse ]; then
+ rm -r eclipse
+ fi
+ tar xf $eclipse_cpp_tgz
+popd >/dev/null
+
+# bestimme eclipse version
+eversion=${eclipse_cpp_tgz#eclipse-cpp-}
+eversion=${eversion%-linux*}
+echo "version=$eversion" >> debian/rules.pre
+echo "export version=$eversion" >> debian/setenv.sh
+
+# bestimme arch
+arch=${eclipse_cpp_tgz#*gtk-}
+arch=${arch%.tar.gz}
+echo "arch=$arch" >> debian/rules.pre
+echo "export arch=$arch" >> debian/setenv.sh
+
+