From 996b5fdc6f6aa459d079154b3025cc4c24e802b4 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Sat, 6 Dec 2025 16:11:40 +0100 Subject: [PATCH] eclipse-cpp added --- Configure | 53 +++++++++++++++++++++++-------------- debian/eclipse-cpp.control | 11 ++++++++ debian/eclipse-cpp.cp | 6 +++++ debian/eclipse-cpp.postinst | 23 ++++++++++++++++ debian/eclipse-cpp.prepare | 33 +++++++++++++++++++++++ 5 files changed, 106 insertions(+), 20 deletions(-) create mode 100644 debian/eclipse-cpp.control create mode 100755 debian/eclipse-cpp.cp create mode 100755 debian/eclipse-cpp.postinst create mode 100755 debian/eclipse-cpp.prepare diff --git a/Configure b/Configure index 325f710..9eddd7d 100755 --- a/Configure +++ b/Configure @@ -8,38 +8,50 @@ PROJECT = libcob-ocesql mconnect webssh USAGE } -if [ -z "$1" ] -then +function write_deb { + # $1: package name + # $2: compile_typ + cat <debian/$1.conf +# generated by configure +compile_type=$2 +target_type=DEB +ANY_DEB +} + +function write_changelog { + # $1: package name + cat <debian/$1.changelog +projects (%VERSION%-%BUILD%) unstable; urgency=medium + * generated by configure + -- Michael Wagner Fri, 05 Dec 2025 20:03:04 +0100 +CHANGELOG +} + +if [ -z "$1" ]; then usage exit 7 fi case $1 in -mconnect) - cat <debian/mconnect.conf -# generated by configure -compile_type=NONE -target_type=DEB -MCONNECT - mconfigure mconnect +eclipse-cpp) + write_deb eclipse-cpp NONE + write_changelog eclipse-cpp + mconfigure -V eclipse-cpp ;; - + libcob-ocesql) - cat <debian/libcob-ocesql.conf -# generated by configure -compile_type=ANY -target_type=DEB -OCESQL + write_deb libcob-ocesql ANY mconfigure -v 1.4 libcob-ocesql ;; +mconnect) + write_deb mconnect ANY + mconfigure mconnect + ;; + webssh) - cat <debian/webssh.conf -# generated by configure -compile_type=ANY -target_type=DEB -WEBSSH + write_deb webssh ANY mconfigure -V webssh ;; @@ -49,3 +61,4 @@ WEBSSH exit 25 ;; esac + diff --git a/debian/eclipse-cpp.control b/debian/eclipse-cpp.control new file mode 100644 index 0000000..7fa2a84 --- /dev/null +++ b/debian/eclipse-cpp.control @@ -0,0 +1,11 @@ +Source: projects +Section: main +Priority: optional +Maintainer: Michael Wagner +Build-Depends: git, mbuild + +Package: eclipse-cpp +Architecture: _DEB_HOST_ARCH +Depends: build-essential, gdb +Description: http://eclipse.org + diff --git a/debian/eclipse-cpp.cp b/debian/eclipse-cpp.cp new file mode 100755 index 0000000..f1c5305 --- /dev/null +++ b/debian/eclipse-cpp.cp @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +mkdir -p $1/opt/eclipse-cpp/ +cp -a Downloads/eclipse/* $1/opt/eclipse-cpp/ + diff --git a/debian/eclipse-cpp.postinst b/debian/eclipse-cpp.postinst new file mode 100755 index 0000000..83b1889 --- /dev/null +++ b/debian/eclipse-cpp.postinst @@ -0,0 +1,23 @@ +#!/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 + diff --git a/debian/eclipse-cpp.prepare b/debian/eclipse-cpp.prepare new file mode 100755 index 0000000..169b64f --- /dev/null +++ b/debian/eclipse-cpp.prepare @@ -0,0 +1,33 @@ +#!/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 + + -- 2.39.5