X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/projects.git/blobdiff_plain/996b5fdc6f6aa459d079154b3025cc4c24e802b4..7514c7ba24f06f8caa395ff545860f5532815d92:/Configure diff --git a/Configure b/Configure index 9eddd7d..ecc04ce 100755 --- a/Configure +++ b/Configure @@ -27,6 +27,89 @@ projects (%VERSION%-%BUILD%) unstable; urgency=medium CHANGELOG } +function write_eclipse_control { + # $1: package name + cat <debian/$1.control +Source: projects +Section: main +Priority: optional +Maintainer: Michael Wagner +Build-Depends: git, mbuild + +Package: $1 +Architecture: _DEB_HOST_ARCH +Depends: $2 +Description: http://eclipse.org +CONTROL +} + +function write_eclipse_cp { + # $1: package name + cat <debian/$1.cp +#!/bin/bash +set -e + +mkdir -p \$1/opt/$1/ +cp -a Downloads/eclipse/* \$1/opt/$1/ +CP +} + +function write_eclipse_postinst { + # $1: package name + cat <debian/$1.postinst +#!/bin/bash +set -e + +for user in user nutzer kurs; do + if [ -d /home/\$user ]; then + echo "Install eclipse for user \$user" + pushd /home/\$user >/dev/null + + if [ -d Schreibtisch ]; then + pushd Schreibtisch >/dev/null + su \$user -c "ln -sf /opt/eclipse-cpp/eclipse ." + popd >/dev/null + fi + + if [ -d Desktop ]; then + pushd Desktop >/dev/null + su \$user -c "ln -sf /opt/eclipse-cpp/eclipse ." + popd >/dev/null + fi + popd >/dev/null + fi +done +POSTINST +} + +function write_eclipse_prepare { + # $1: package name + # $2: ECLIPSE_PATTERN + cat <debian/$1.prepare +#!/bin/bash +set -e + +debian/eclipse.prepare $2 +PREPARE +} + +function configure_eclipse { + # $1: package name + # $2: ECLIPSE_PATTERN + # $3: additional dependencies + + write_deb $1 NONE + write_changelog $1 + write_eclipse_control $1 "$3" + write_eclipse_cp $1 + chmod 755 debian/$1.cp + write_eclipse_postinst $1 + chmod 755 debian/$1.postinst + write_eclipse_prepare $1 $2 + chmod 755 debian/$1.prepare + mconfigure -V $1 +} + if [ -z "$1" ]; then usage exit 7 @@ -35,14 +118,20 @@ fi case $1 in eclipse-cpp) - write_deb eclipse-cpp NONE - write_changelog eclipse-cpp - mconfigure -V eclipse-cpp + configure_eclipse eclipse-cpp "eclipse-cpp*.tar.gz" "build-essential,gdb" + ;; + +eclipse-php) + configure_eclipse eclipse-php "eclipse-php*.tar.gz" php ;; libcob-ocesql) + if [ -z "$2" ]; then + echo "supply version as 2nd parameter" + exit 131 + fi write_deb libcob-ocesql ANY - mconfigure -v 1.4 libcob-ocesql + mconfigure -v $2 libcob-ocesql ;; mconnect)