]> wagnertech.de Git - projects.git/commitdiff
libcob-ocesql build master v_0.0-15
authorMichael Wagner <info@wagnertech.de>
Thu, 19 Feb 2026 18:50:29 +0000 (19:50 +0100)
committerMichael Wagner <info@wagnertech.de>
Thu, 19 Feb 2026 18:50:29 +0000 (19:50 +0100)
Configure
debian/eclipse-cpp.control [deleted file]
debian/eclipse-cpp.cp [deleted file]
debian/eclipse-cpp.postinst [deleted file]
debian/eclipse-cpp.prepare [deleted file]
debian/eclipse.prepare [new file with mode: 0755]
debian/libcob-ocesql.build
debian/libcob-ocesql.cp
debian/libcob-ocesql.prepare [new file with mode: 0755]
debian/mdjango.postinst
mdjango/etc/mysite.conf

index 9eddd7dbca49dc7f24f61334f6cc597976300344..ecc04ce758474d1d5e0d87f41ff2af25b9820567 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -27,6 +27,89 @@ projects (%VERSION%-%BUILD%) unstable; urgency=medium
 CHANGELOG
 }
 
+function write_eclipse_control {
+       # $1: package name
+       cat <<CONTROL >debian/$1.control
+Source: projects
+Section: main
+Priority: optional
+Maintainer: Michael Wagner <michael@wagnertech.de>
+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 <<CP >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 <<POSTINST >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 <<PREPARE >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)
diff --git a/debian/eclipse-cpp.control b/debian/eclipse-cpp.control
deleted file mode 100644 (file)
index 7fa2a84..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Source: projects
-Section: main
-Priority: optional
-Maintainer: Michael Wagner <michael@wagnertech.de>
-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
deleted file mode 100755 (executable)
index f1c5305..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/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
deleted file mode 100755 (executable)
index 83b1889..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/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
deleted file mode 100755 (executable)
index 169b64f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/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
-
-
diff --git a/debian/eclipse.prepare b/debian/eclipse.prepare
new file mode 100755 (executable)
index 0000000..6a39aa3
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -e
+
+if [ -z "$1" ]; then
+       echo "usage eclipse.prepare ECLIPSE_PATTERN"
+       exit 6
+fi
+ECLIPSE_PATTERN=$1
+
+# check, if there is exactly 1 eclipse-cpp*.tar.gz in Downloads
+pushd Downloads >/dev/null
+       if [ $(ls $ECLIPSE_PATTERN| wc -l) -ne 1 ]; then
+               echo "Es muss genau ein $ECLIPSE_PATTERN in Downloads sein."
+               exit 8
+       fi
+       eclipse_tgz=$(ls $ECLIPSE_PATTERN)
+       
+       # entpacke tar.gz
+       if [ -d eclipse ]; then
+               rm -r eclipse
+       fi
+       tar xf $eclipse_tgz
+popd >/dev/null
+
+# bestimme eclipse version
+eversion=${eclipse_tgz#eclipse-*-}
+eversion=${eversion%-linux*}
+echo "version=$eversion" >> debian/rules.pre
+echo "export version=$eversion" >> debian/setenv.sh
+
+# bestimme arch
+arch=${eclipse_tgz#*gtk-}
+arch=${arch%.tar.gz}
+echo "arch=$arch" >> debian/rules.pre
+echo "export arch=$arch" >> debian/setenv.sh
+
+
index 1a51ab1aa587319a908837ca65c961b9a5e756c5..9d1845f715242a4c2ba1636da3f3e90a1a8bc719 100755 (executable)
@@ -1,4 +1,21 @@
 #!/bin/bash
 set -e
 
-echo "NYI"
+# this stuff is necessary here: doing it in the prebuild
+# is useless: There is an sync step directly before the build
+# and recreated .ac files are overwtritten
+
+build_base=$(pwd)
+
+cd Downloads/Open-COBOL-ESQL
+autoreconf
+aclocal
+libtoolize
+
+#pushd dblib >/dev/null
+#      libtoolize
+#popd >/dev/null
+       
+./configure --prefix $build_base/debian/tmp/usr
+
+make
index 51a20e4efaa2f237de8ca9bcbd97d99e3128c429..27ede25348cb5ff4832acc0c771cc5bf795e09b7 100755 (executable)
@@ -1,15 +1,21 @@
 #!/bin/bash
 set -e
 
-mkdir -p $1/usr/local/lib
-cp ../Open-COBOL-ESQL-$version/dblib/.libs/libocesql.a $1/usr/local/lib
-cp ../Open-COBOL-ESQL-$version/dblib/libocesql.la $1/usr/local/lib
-cp ../Open-COBOL-ESQL-$version/dblib/.libs/libocesql.so.0.1.0 $1/usr/local/lib
-pushd $1/usr/local/lib >/dev/null
-       ln -s libocesql.so.0.1.0 libocesql.so
-       ln -s libocesql.so.0.1.0 libocesql.so.0
+#mkdir -p $1/usr/local/lib
+#cp ../Open-COBOL-ESQL-$version/dblib/.libs/libocesql.a $1/usr/local/lib
+#cp ../Open-COBOL-ESQL-$version/dblib/libocesql.la $1/usr/local/lib
+#cp ../Open-COBOL-ESQL-$version/dblib/.libs/libocesql.so.0.1.0 $1/usr/local/lib
+#pushd $1/usr/local/lib >/dev/null
+#      ln -s libocesql.so.0.1.0 libocesql.so
+#      ln -s libocesql.so.0.1.0 libocesql.so.0
+#popd >/dev/null
+
+pushd ~/build/Downloads/Open-COBOL-ESQL >/dev/null
+       make install
 popd >/dev/null
 
+rsync -a ~/build/debian/tmp/ ./debian/tmp/
+
 mkdir -p $1/usr/bin
 cat << 'OCERUN' > $1/usr/bin/ocerun
 #!/bin/bash
@@ -20,9 +26,44 @@ if [ -z "$1" ] ;then
        exit 1
 fi
 
-export LD_LIBRARY_PATH="/usr/local/lib"
+export LD_LIBRARY_PATH="/usr/lib"
 export OCDB_DB_CHAR=UTF-8
 
 $1
 OCERUN
 chmod 755 $1/usr/bin/ocerun
+
+cat << 'OCECOBC' > $1/usr/bin/ocecobc
+#!/bin/bash
+set -e
+
+usage="ocecobc [-x] DATEI"
+
+exec_flag=""
+
+if [ -z "$1" ]; then
+       echo "Usage: $usage"
+       exit 46
+fi
+file=$1
+
+if [ $1 == "-x" ]; then
+       exec_flag="-x"
+       if [ -z "$2 ]; then
+               echo "File missing."
+               echo "Usage: $usage"
+               exit 43
+       fi
+       file=$2
+fi
+
+export COB_LDFLAGS=-Wl,--no-as-needed
+export LD_LIBRARY_PATH="/usr/lib"
+export COBCPY=/usr/share/open-cobol-esql/copy
+
+base_name=${file%.*}
+
+ocesql $file $base_name.cob
+cobc $exec_flag -locesql $base_name.cob
+OCECOBC
+chmod 755 $1/usr/bin/ocecobc
diff --git a/debian/libcob-ocesql.prepare b/debian/libcob-ocesql.prepare
new file mode 100755 (executable)
index 0000000..ae217a4
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -e
+
+echo 'RSYNC_OPT = -av --exclude="build" --exclude="debian/tmp" --exclude="Packages" --exclude="*Aktuell" --exclude=".*" --exclude="Makefile"' >> debian/rules.pre
+
+dpkg -s bison flex pkg-config make build-essential g++ automake libtool >/dev/null
+
+if [ ! -d Downloads ]; then
+       mkdir Downloads
+fi
+
+cd Downloads
+if [ -d Open-COBOL-ESQL ]; then
+       cd Open-COBOL-ESQL
+else
+       git clone https://github.com/opensourcecobol/Open-COBOL-ESQL
+       cd Open-COBOL-ESQL
+fi
+git checkout v$version
index 28982ba0c59dd22f9c3c2494f4e8999a4a33fe68..d6b8a6fd7512580d62f7179a1b9340e4e230b303 100755 (executable)
@@ -8,6 +8,7 @@ systemctl reload apache2
 if ! grep "### MDJANGO ###" /opt/mysite/mysite/settings.py >/dev/null
 then
        echo "add mdjango settings to settings.py"
+       echo "*** Attention ALLOWED_HOSTS is set to '*' ***"
        cat << EOF >> /opt/mysite/mysite/settings.py
 ### MDJANGO ###
 DATABASES = {
@@ -21,11 +22,17 @@ DATABASES = {
     },
 }
 STATIC_ROOT = '/var/mysite/static'
+STATIC_URL = '/mdjangostat/'
 DEBUG = False
+ALLOWED_HOSTS = ["*"]
 ### MDJANGO-END ###
 EOF
 fi
 
+# change admin to mdjangoad
+sed -i "s/path('admin/path('mdjangoad/" /opt/mysite/mysite/settings.py
+
+
 # check existence of /var/mysite
 if [ ! -d /var/mysite ]
 then
@@ -89,7 +96,9 @@ fi
 
 # check existence of superuser
 #if [ $(sqlite3 /var/mysite/default.sqlite3 'SELECT id FROM auth_user WHERE is_staff=1;' |wc -l) -eq 0 ]
-if [ $(su postgres -c "psql mdjango -c 'SELECT id FROM auth_user WHERE is_staff=1;' " |wc -l) -eq 0 ]
+#if [ $(su postgres -c "psql mdjango -c 'SELECT id FROM auth_user WHERE is_staff=t;' " |wc -l) -eq 0 ]
+if [ $(su postgres -c "psql mdjango -c \"SELECT id FROM auth_user WHERE is_staff='t';\" " |wc -l) -eq 0 ]
+
 then
        echo "There is no django superuser in the system. Install one? (Y/n)"
        read a
index ee352ef4f13f521a13901c06183b920397d5881c..027e985074ebd249aed8fe79f3345135b6c3b273 100644 (file)
@@ -1,4 +1,4 @@
-Alias /static/ /var/mysite/static
+Alias /mdjangostat/ /var/mysite/static
 
 <Directory /var/mysite/static>
        Require all granted