diff --git a/scripts/package-superbol.sh b/scripts/package-superbol.sh index 69aa23f..6c26e78 100755 --- a/scripts/package-superbol.sh +++ b/scripts/package-superbol.sh @@ -21,15 +21,17 @@ fi export SUPERBOL_PACKAGING=1 -INSTALLDIR=$(readlink -f "${TARGETDIR:-/home/bas/superbol}") +INSTALLDIR="/home/bas/superbol" BUILDDIR=$(readlink -f "${BUILDDIR:-$(pwd)/tmp-builddir}") SWITCHNAME="${SWITCHNAME:-for-padbol}" TARGETDIR=$(readlink -f "${TARGETDIR:-INSTALL_DIR}") echo "Packaging SuperBOL into ${TARGETDIR}" -export LD_LIBRARY_PATH="${TARGETDIR}/lib:${TARGETDIR}/lib64" -export LIBRARY_PATH="${TARGETDIR}/lib:${TARGETDIR}/lib64" +export LD_LIBRARY_PATH="${TARGETDIR}/${INSTALLDIR}/lib:${TARGETDIR}/${INSTALLDIR}/lib64" +export LIBRARY_PATH="${TARGETDIR}/${INSTALLDIR}/lib:${TARGETDIR}/${INSTALLDIR}/lib64" +export CFLAGS="-static-libgcc" +export CXXFLAGS="-static-libgcc -static-libstdc++" DATE=$(date +%Y%m%d%H%M) @@ -76,7 +78,7 @@ if [ -e padbol ]; then cd .. fi else - git clone -b packaging-build git@github.com:emilienlemaire/padbol --depth 1 + git clone -b edit-port git@github.com:emilienlemaire/padbol --depth 1 cd padbol if [ ! -e _opam ]; then opam switch link $SWITCHNAME @@ -109,34 +111,34 @@ fi if [ ! -e ${TARGETDIR}/commits/gixsql-${GIXSQL_COMMIT} ]; then - export CMAKE_PREFIX_PATH=$TARGETDIR - export CMAKE_MODULE_PATH=$TARGETDIR/lib - export PKG_CONFIG_PATH=${TARGETDIR}/lib64/pkgconfig:${TARGETDIR}/lib/pkgconfig + export CMAKE_PREFIX_PATH=$TARGETDIR/$INSTALLDIR + export CMAKE_MODULE_PATH=${TARGETDIR}/${INSTALLDIR}/lib + export PKG_CONFIG_PATH=${TARGETDIR}/${INSTALLDIR}/lib64/pkgconfig:${TARGETDIR}/${INSTALLDIR}/lib/pkgconfig export CMAKE_FIND_USE_CMAKE_SYSTEM_PATH=FALSE cd fmt if [ ! -e "_build/commits/${FMT_COMMIT}" ]; then mkdir -p _build cd _build - cmake -DCMAKE_INSTALL_PREFIX:PATH=${TARGETDIR} -DBUILD_SHARED_LIBS=TRUE -DFMT_TEST=OFF .. + cmake -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR} -DBUILD_SHARED_LIBS=TRUE -DFMT_TEST=OFF .. make -j cd .. fi cd _build - make install + make DESTDIR=${TARGETDIR} install rm -rf commits mkdir commits touch commits/${FMT_COMMIT} cd ../.. - export CXXFLAGS="$(pkg-config --cflags fmt)" + export CXXFLAGS="$(pkg-config --cflags fmt) $CXXFLAGS" export LIBS="$(pkg-config --libs fmt) $LIBS" cd spdlog if [ ! -e "_build/commits/${SPDLOG_COMMIT}" ]; then mkdir -p _build cd _build - cmake -DCMAKE_INSTALL_PREFIX:PATH=${TARGETDIR} \ + cmake -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR} \ -DBUILD_SHARED_LIBS=TRUE \ -DSPDLOG_BUILD_EXAMPLE=NO \ -DSPDLOG_BUILD_TESTS=NO \ @@ -147,7 +149,7 @@ if [ ! -e ${TARGETDIR}/commits/gixsql-${GIXSQL_COMMIT} ]; then cd .. fi cd _build - make install + make DESTDIR=${TARGETDIR} install rm -rf commits mkdir commits touch commits/${SPDLOG_COMMIT} @@ -160,10 +162,10 @@ if [ ! -e ${TARGETDIR}/commits/gixsql-${GIXSQL_COMMIT} ]; then if [ ! -e "commits/${GIXSQL_COMMIT}" ]; then touch extra_files.mk autoreconf -i - ./configure --prefix=${TARGETDIR} + ./configure --prefix=${INSTALLDIR} make -j fi - make install + make DESTDIR=${TARGETDIR} install mkdir -p commits touch commits/${GIXSQL_COMMIT} mkdir -p ${TARGETDIR}/commits/ @@ -176,34 +178,33 @@ if [ ! -e ${TARGETDIR}/commits/gnucobol-${GNUCOBOL_COMMIT} ]; then cd visam-2.2 if [ ! -e _build/version/2.2 ]; then echo "Not installed: building" + if [ -e Makefile ]; then + make distclean + fi rm -rf _build mkdir -p _build cd _build - ../configure --prefix=${TARGETDIR} --enable-vbisamdefault + ../configure --prefix=${INSTALLDIR} --enable-vbisamdefault make -j cd .. else echo "Installed" fi cd _build - make install - ln -s ${TARGETDIR}/lib/libvisam.so ${TARGETDIR}/lib/libvbisam.so - ln -s ${TARGETDIR}/include/visam.h ${TARGETDIR}/include/vbisam.h + make DESTDIR=${TARGETDIR} install + ln -s ${TARGETDIR}/${INSTALLDIR}/lib/libvisam.so ${TARGETDIR}/${INSTALLDIR}/lib/libvbisam.so + ln -s ${TARGETDIR}/${INSTALLDIR}/include/visam.h ${TARGETDIR}/${INSTALLDIR}/include/vbisam.h mkdir -p version touch version/2.2 cd ../.. - LD_LIBRARY_PATH=${TARGETDIR}/lib:${LD_LIBRARY_PATH} - export LD_LIBRARY_PATH - LIBRARY_PATH=${LD_LIBRARY_PATH} - export LIBRARY_PATH - C_INCLUDE_PATH=${TARGETDIR}/include + C_INCLUDE_PATH=${TARGETDIR}/${INSTALLDIR}/include export C_INCLUDE_PATH cd gnucobol if [ ! -e _build/commits/${GNUCOBOL_COMMIT} ]; then mkdir -p _build cd _build ../autogen.sh install - ../configure --prefix=${TARGETDIR} --with-vbisam + ../configure --prefix=${INSTALLDIR} --with-vbisam make -j rm -rf commits mkdir commits @@ -211,18 +212,12 @@ if [ ! -e ${TARGETDIR}/commits/gnucobol-${GNUCOBOL_COMMIT} ]; then cd .. fi cd _build - make install + make DESTDIR=${TARGETDIR} install mkdir -p ${TARGETDIR}/commits/ touch ${TARGETDIR}/commits/gnucobol-${GNUCOBOL_COMMIT} cd ../.. fi -LD_LIBRARY_PATH=${TARGETDIR}/lib:${LD_LIBRARY_PATH} -export LD_LIBRARY_PATH - -LIBRARY_PATH=${LD_LIBRARY_PATH} -export LIBRARY_PATH - C_INCLUDE_PATH=${TARGETDIR}/include export C_INCLUDE_PATH @@ -240,11 +235,12 @@ if [ ! -e ${TARGETDIR}/commits/superbol-${SUPERBOL_COMMIT} ]; then mkdir -p ${TARGETDIR}/bin/ mkdir -p ${TARGETDIR}/lib/ - cp -f padbol ${TARGETDIR}/bin/superbol - find superkix/third-parties -name '*.so' -exec cp -f {} ${TARGETDIR}/lib \; - cp -f superkix/target/release/server ${TARGETDIR}/bin/superkix - cp -f superkix/target/release/libsuperkix.so ${TARGETDIR}/lib/ - cp -f $(ldd ${TARGETDIR}/bin/superkix | awk '{ print $3 }' | grep -v ${TARGETDIR}) ${TARGETDIR}/lib/ + cp -fv padbol ${TARGETDIR}/${INSTALLDIR}/bin/superbol + find superkix/third-parties -name '*.so' -exec cp -fv {} ${TARGETDIR}/${INSTALLDIR}/lib \; + cp -fv superkix/target/release/libsuperkix.so ${TARGETDIR}/${INSTALLDIR}/lib + cp -fv superkix/target/release/server ${TARGETDIR}/${INSTALLDIR}/bin/superkix + cp -fv $(ldd ${TARGETDIR}/${INSTALLDIR}/bin/superkix | awk '{ print $3 }' | grep -v ${TARGETDIR}) ${TARGETDIR}/${INSTALLDIR}/lib/ + rm -f ${TARGETDIR}/${INSTALLDIR}/lib/libc.so.* cd .. touch ${TARGETDIR}/commits/superbol-${SUPERBOL_COMMIT} diff --git a/scripts/vm-build.sh b/scripts/vm-build.sh index 5207977..337eaa4 100755 --- a/scripts/vm-build.sh +++ b/scripts/vm-build.sh @@ -1,5 +1,14 @@ #!/usr/bin/bash +pwd + +export LD_LIBRARY_PATH=/home/bas/superbol/lib:/usr/host/lib +export PATH=/home/bas/superbol/bin:${PATH} + +if [ ! -e Makefile ]; then + cd ${APP_HOME}/cobol_repo +fi + ./configure make make install diff --git a/scripts/vm-git-check.sh b/scripts/vm-git-check.sh index f8a0fe8..c8b24af 100755 --- a/scripts/vm-git-check.sh +++ b/scripts/vm-git-check.sh @@ -7,6 +7,7 @@ mkdir -p $(dirname $LOG_FILE) ${APP_HOME}/scripts/vm-build.sh >> $LOG_FILE 2>&1 +pkill -HUP superkix # Fonction principale while true; do @@ -26,10 +27,11 @@ while true; do # Recompiler et installer echo "Running ./configure && make && make install" >> $LOG_FILE 2>&1 - ${APP_HOME}/scripts/vm-build.sh + ${APP_HOME}/scripts/vm-build.sh >> $LOG_FILE 2>&1 if [ $? -eq 0 ]; then echo "Build and installation successful." >> $LOG_FILE 2>&1 + pkill -HUP superkix else echo "Build or installation failed." >> $LOG_FILE 2>&1 fi diff --git a/scripts/vm-install.sh b/scripts/vm-install.sh new file mode 100755 index 0000000..3b3eb09 --- /dev/null +++ b/scripts/vm-install.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +# Install the latest release on the VM + +INSTALLDIR=$(readlink -f "${INSTALLDIR:-${HOME}/superbol}") + +mkdir -p tmp-install + +mkdir -p ${INSTALLDIR}/bin +mkdir -p ${INSTALLDIR}/lib +mkdir -p ${INSTALLDIR}/include +mkdir -p ${INSTALLDIR}/share + + +tar -xvzf superbol-install.tar.gz -C tmp-install + +cp -Rf tmp-install/target/home/* /home/ + +export PATH=${INSTALLDIR}/bin:${PATH} +export LD_LIBRARY_PATH=${INSTALLDIR}/lib:${LD_LIBRARY_PATH} +export C_INCLUDE_PATH=${INSTALLDIR}/include:${C_INCLUDE_PATH} diff --git a/scripts/vm-start.sh b/scripts/vm-start.sh index a9a6ff0..595070e 100755 --- a/scripts/vm-start.sh +++ b/scripts/vm-start.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + cat << EOM .,,,,,,* ,,,,,,***** @@ -18,7 +20,10 @@ cat << EOM EOM -git clone $COB_GIT_REPO cobol_repo +./scripts/vm-install.sh +git clone $COB_GIT_REPO ${APP_HOME}/cobol_repo +export LD_LIBRARY_PATH=/home/bas/superbol/lib:/usr/host/lib +export PATH=/home/bas/superbol/bin:$PATH ${APP_HOME}/scripts/vm-git-check.sh & env | sort -/home/bas/superbol/bin/server -v run -c $APP_HOME/cobol_repo/config.toml \ No newline at end of file +/home/bas/superbol/bin/superkix -v run $APP_HOME/cobol_repo diff --git a/superbol-install.tar.gz b/superbol-install.tar.gz new file mode 100644 index 0000000..ceb0dd9 Binary files /dev/null and b/superbol-install.tar.gz differ diff --git a/superkix-server/static/resources/DepartureMono-Regular.woff2 b/superkix-server/static/resources/DepartureMono-Regular.woff2 new file mode 100644 index 0000000..20353c7 Binary files /dev/null and b/superkix-server/static/resources/DepartureMono-Regular.woff2 differ diff --git a/superkix-server/static/resources/style.css b/superkix-server/static/resources/style.css new file mode 100644 index 0000000..aad0e15 --- /dev/null +++ b/superkix-server/static/resources/style.css @@ -0,0 +1,95 @@ +@font-face { + font-family: Departure; + src: url(/resources/DepartureMono-Regular.woff2); +} + +:root { + background: rgb(9,9,121); + background: radial-gradient(circle, rgba(9,9,121,1) 0%, rgb(0, 70, 140) 100%); + /* color: hsl(214, 100%, 60%); */ + color: hsl(214, 100%, 65%); + font-family: sans-serif; + font-size: 110%; + min-height: 100vh; +} + +body { + display: grid; + justify-content: center; + gap: 0.3em; + + grid-template-columns: fit-content(60em) fit-content(35em); + grid-template-rows: auto; + grid-template-areas: + "header header" + "sub-header sub-header" + "logs connections" + ; +} + +.widget { + background-color: #222222; + border-radius: 0.3rem; + + box-shadow: 0pt 0pt 0.5rem 0.1rem rgba(47, 47, 47, 0.627); + + h2 { + background-color: #333333; + color: hsl(214, 100%, 65%); + margin: 0pt; + border-top-left-radius: 0.3rem; + border-top-right-radius: 0.3rem; + } + + h2, + .widget-content { + padding: 0.5rem; + } + + .widget-content { + font-family: Departure, monospace; + } +} + +header { + grid-area: header; + justify-self: center; + color: #ffffff; +} + +#logs { + grid-area: logs; +} + +#last_config { + grid-area: sub-header; +} + +.console { + white-space: pre-wrap; + word-wrap: break-word; + max-height: 30em; + overflow: scroll; +} + +#connections { + grid-area: connections; +} + +table { + width: 100%; + border-collapse: collapse; +} + +table, +th, +td { + border: 1px solid hsla(214, 100%, 65%, 0.566); + ; +} + +th, +td { + padding: 8px; + text-align: left; +} \ No newline at end of file diff --git a/superkix-server/static/templates/index.html b/superkix-server/static/templates/index.html new file mode 100644 index 0000000..3f7544a --- /dev/null +++ b/superkix-server/static/templates/index.html @@ -0,0 +1,58 @@ + + + +
+ + + +