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
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)
+++ /dev/null
-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
-
+++ /dev/null
-#!/bin/bash
-set -e
-
-mkdir -p $1/opt/eclipse-cpp/
-cp -a Downloads/eclipse/* $1/opt/eclipse-cpp/
-
+++ /dev/null
-#!/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
-
+++ /dev/null
-#!/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
-
-
--- /dev/null
+#!/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
+
+
#!/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
#!/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
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
--- /dev/null
+#!/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
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 = {
},
}
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
# 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
-Alias /static/ /var/mysite/static
+Alias /mdjangostat/ /var/mysite/static
<Directory /var/mysite/static>
Require all granted