Skip to content

Commit 0456c26

Browse files
Merge pull request #8 from emilienlemaire/install-script
Update for demo
2 parents bd2e62c + e1ce2c6 commit 0456c26

File tree

10 files changed

+261
-39
lines changed

10 files changed

+261
-39
lines changed

scripts/package-superbol.sh

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ fi
2121

2222

2323
export SUPERBOL_PACKAGING=1
24-
INSTALLDIR=$(readlink -f "${TARGETDIR:-/home/bas/superbol}")
24+
INSTALLDIR="/home/bas/superbol"
2525
BUILDDIR=$(readlink -f "${BUILDDIR:-$(pwd)/tmp-builddir}")
2626
SWITCHNAME="${SWITCHNAME:-for-padbol}"
2727
TARGETDIR=$(readlink -f "${TARGETDIR:-INSTALL_DIR}")
2828

2929
echo "Packaging SuperBOL into ${TARGETDIR}"
3030

31-
export LD_LIBRARY_PATH="${TARGETDIR}/lib:${TARGETDIR}/lib64"
32-
export LIBRARY_PATH="${TARGETDIR}/lib:${TARGETDIR}/lib64"
31+
export LD_LIBRARY_PATH="${TARGETDIR}/${INSTALLDIR}/lib:${TARGETDIR}/${INSTALLDIR}/lib64"
32+
export LIBRARY_PATH="${TARGETDIR}/${INSTALLDIR}/lib:${TARGETDIR}/${INSTALLDIR}/lib64"
33+
export CFLAGS="-static-libgcc"
34+
export CXXFLAGS="-static-libgcc -static-libstdc++"
3335

3436
DATE=$(date +%Y%m%d%H%M)
3537

@@ -76,7 +78,7 @@ if [ -e padbol ]; then
7678
cd ..
7779
fi
7880
else
79-
git clone -b packaging-build [email protected]:emilienlemaire/padbol --depth 1
81+
git clone -b edit-port [email protected]:emilienlemaire/padbol --depth 1
8082
cd padbol
8183
if [ ! -e _opam ]; then
8284
opam switch link $SWITCHNAME
@@ -109,34 +111,34 @@ fi
109111

110112
if [ ! -e ${TARGETDIR}/commits/gixsql-${GIXSQL_COMMIT} ]; then
111113

112-
export CMAKE_PREFIX_PATH=$TARGETDIR
113-
export CMAKE_MODULE_PATH=$TARGETDIR/lib
114-
export PKG_CONFIG_PATH=${TARGETDIR}/lib64/pkgconfig:${TARGETDIR}/lib/pkgconfig
114+
export CMAKE_PREFIX_PATH=$TARGETDIR/$INSTALLDIR
115+
export CMAKE_MODULE_PATH=${TARGETDIR}/${INSTALLDIR}/lib
116+
export PKG_CONFIG_PATH=${TARGETDIR}/${INSTALLDIR}/lib64/pkgconfig:${TARGETDIR}/${INSTALLDIR}/lib/pkgconfig
115117
export CMAKE_FIND_USE_CMAKE_SYSTEM_PATH=FALSE
116118

117119
cd fmt
118120
if [ ! -e "_build/commits/${FMT_COMMIT}" ]; then
119121
mkdir -p _build
120122
cd _build
121-
cmake -DCMAKE_INSTALL_PREFIX:PATH=${TARGETDIR} -DBUILD_SHARED_LIBS=TRUE -DFMT_TEST=OFF ..
123+
cmake -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR} -DBUILD_SHARED_LIBS=TRUE -DFMT_TEST=OFF ..
122124
make -j
123125
cd ..
124126
fi
125127
cd _build
126-
make install
128+
make DESTDIR=${TARGETDIR} install
127129
rm -rf commits
128130
mkdir commits
129131
touch commits/${FMT_COMMIT}
130132
cd ../..
131133

132-
export CXXFLAGS="$(pkg-config --cflags fmt)"
134+
export CXXFLAGS="$(pkg-config --cflags fmt) $CXXFLAGS"
133135
export LIBS="$(pkg-config --libs fmt) $LIBS"
134136

135137
cd spdlog
136138
if [ ! -e "_build/commits/${SPDLOG_COMMIT}" ]; then
137139
mkdir -p _build
138140
cd _build
139-
cmake -DCMAKE_INSTALL_PREFIX:PATH=${TARGETDIR} \
141+
cmake -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR} \
140142
-DBUILD_SHARED_LIBS=TRUE \
141143
-DSPDLOG_BUILD_EXAMPLE=NO \
142144
-DSPDLOG_BUILD_TESTS=NO \
@@ -147,7 +149,7 @@ if [ ! -e ${TARGETDIR}/commits/gixsql-${GIXSQL_COMMIT} ]; then
147149
cd ..
148150
fi
149151
cd _build
150-
make install
152+
make DESTDIR=${TARGETDIR} install
151153
rm -rf commits
152154
mkdir commits
153155
touch commits/${SPDLOG_COMMIT}
@@ -160,10 +162,10 @@ if [ ! -e ${TARGETDIR}/commits/gixsql-${GIXSQL_COMMIT} ]; then
160162
if [ ! -e "commits/${GIXSQL_COMMIT}" ]; then
161163
touch extra_files.mk
162164
autoreconf -i
163-
./configure --prefix=${TARGETDIR}
165+
./configure --prefix=${INSTALLDIR}
164166
make -j
165167
fi
166-
make install
168+
make DESTDIR=${TARGETDIR} install
167169
mkdir -p commits
168170
touch commits/${GIXSQL_COMMIT}
169171
mkdir -p ${TARGETDIR}/commits/
@@ -176,53 +178,46 @@ if [ ! -e ${TARGETDIR}/commits/gnucobol-${GNUCOBOL_COMMIT} ]; then
176178
cd visam-2.2
177179
if [ ! -e _build/version/2.2 ]; then
178180
echo "Not installed: building"
181+
if [ -e Makefile ]; then
182+
make distclean
183+
fi
179184
rm -rf _build
180185
mkdir -p _build
181186
cd _build
182-
../configure --prefix=${TARGETDIR} --enable-vbisamdefault
187+
../configure --prefix=${INSTALLDIR} --enable-vbisamdefault
183188
make -j
184189
cd ..
185190
else
186191
echo "Installed"
187192
fi
188193
cd _build
189-
make install
190-
ln -s ${TARGETDIR}/lib/libvisam.so ${TARGETDIR}/lib/libvbisam.so
191-
ln -s ${TARGETDIR}/include/visam.h ${TARGETDIR}/include/vbisam.h
194+
make DESTDIR=${TARGETDIR} install
195+
ln -s ${TARGETDIR}/${INSTALLDIR}/lib/libvisam.so ${TARGETDIR}/${INSTALLDIR}/lib/libvbisam.so
196+
ln -s ${TARGETDIR}/${INSTALLDIR}/include/visam.h ${TARGETDIR}/${INSTALLDIR}/include/vbisam.h
192197
mkdir -p version
193198
touch version/2.2
194199
cd ../..
195-
LD_LIBRARY_PATH=${TARGETDIR}/lib:${LD_LIBRARY_PATH}
196-
export LD_LIBRARY_PATH
197-
LIBRARY_PATH=${LD_LIBRARY_PATH}
198-
export LIBRARY_PATH
199-
C_INCLUDE_PATH=${TARGETDIR}/include
200+
C_INCLUDE_PATH=${TARGETDIR}/${INSTALLDIR}/include
200201
export C_INCLUDE_PATH
201202
cd gnucobol
202203
if [ ! -e _build/commits/${GNUCOBOL_COMMIT} ]; then
203204
mkdir -p _build
204205
cd _build
205206
../autogen.sh install
206-
../configure --prefix=${TARGETDIR} --with-vbisam
207+
../configure --prefix=${INSTALLDIR} --with-vbisam
207208
make -j
208209
rm -rf commits
209210
mkdir commits
210211
touch commits/${GNUCOBOL_COMMIT}
211212
cd ..
212213
fi
213214
cd _build
214-
make install
215+
make DESTDIR=${TARGETDIR} install
215216
mkdir -p ${TARGETDIR}/commits/
216217
touch ${TARGETDIR}/commits/gnucobol-${GNUCOBOL_COMMIT}
217218
cd ../..
218219
fi
219220

220-
LD_LIBRARY_PATH=${TARGETDIR}/lib:${LD_LIBRARY_PATH}
221-
export LD_LIBRARY_PATH
222-
223-
LIBRARY_PATH=${LD_LIBRARY_PATH}
224-
export LIBRARY_PATH
225-
226221
C_INCLUDE_PATH=${TARGETDIR}/include
227222
export C_INCLUDE_PATH
228223

@@ -240,11 +235,12 @@ if [ ! -e ${TARGETDIR}/commits/superbol-${SUPERBOL_COMMIT} ]; then
240235
mkdir -p ${TARGETDIR}/bin/
241236
mkdir -p ${TARGETDIR}/lib/
242237

243-
cp -f padbol ${TARGETDIR}/bin/superbol
244-
find superkix/third-parties -name '*.so' -exec cp -f {} ${TARGETDIR}/lib \;
245-
cp -f superkix/target/release/server ${TARGETDIR}/bin/superkix
246-
cp -f superkix/target/release/libsuperkix.so ${TARGETDIR}/lib/
247-
cp -f $(ldd ${TARGETDIR}/bin/superkix | awk '{ print $3 }' | grep -v ${TARGETDIR}) ${TARGETDIR}/lib/
238+
cp -fv padbol ${TARGETDIR}/${INSTALLDIR}/bin/superbol
239+
find superkix/third-parties -name '*.so' -exec cp -fv {} ${TARGETDIR}/${INSTALLDIR}/lib \;
240+
cp -fv superkix/target/release/libsuperkix.so ${TARGETDIR}/${INSTALLDIR}/lib
241+
cp -fv superkix/target/release/server ${TARGETDIR}/${INSTALLDIR}/bin/superkix
242+
cp -fv $(ldd ${TARGETDIR}/${INSTALLDIR}/bin/superkix | awk '{ print $3 }' | grep -v ${TARGETDIR}) ${TARGETDIR}/${INSTALLDIR}/lib/
243+
rm -f ${TARGETDIR}/${INSTALLDIR}/lib/libc.so.*
248244
cd ..
249245

250246
touch ${TARGETDIR}/commits/superbol-${SUPERBOL_COMMIT}

scripts/vm-build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#!/usr/bin/bash
22

3+
pwd
4+
5+
export LD_LIBRARY_PATH=/home/bas/superbol/lib:/usr/host/lib
6+
export PATH=/home/bas/superbol/bin:${PATH}
7+
8+
if [ ! -e Makefile ]; then
9+
cd ${APP_HOME}/cobol_repo
10+
fi
11+
312
./configure
413
make
514
make install

scripts/vm-git-check.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ mkdir -p $(dirname $LOG_FILE)
77

88

99
${APP_HOME}/scripts/vm-build.sh >> $LOG_FILE 2>&1
10+
pkill -HUP superkix
1011

1112
# Fonction principale
1213
while true; do
@@ -26,10 +27,11 @@ while true; do
2627

2728
# Recompiler et installer
2829
echo "Running ./configure && make && make install" >> $LOG_FILE 2>&1
29-
${APP_HOME}/scripts/vm-build.sh
30+
${APP_HOME}/scripts/vm-build.sh >> $LOG_FILE 2>&1
3031

3132
if [ $? -eq 0 ]; then
3233
echo "Build and installation successful." >> $LOG_FILE 2>&1
34+
pkill -HUP superkix
3335
else
3436
echo "Build or installation failed." >> $LOG_FILE 2>&1
3537
fi

scripts/vm-install.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Install the latest release on the VM
6+
7+
INSTALLDIR=$(readlink -f "${INSTALLDIR:-${HOME}/superbol}")
8+
9+
mkdir -p tmp-install
10+
11+
mkdir -p ${INSTALLDIR}/bin
12+
mkdir -p ${INSTALLDIR}/lib
13+
mkdir -p ${INSTALLDIR}/include
14+
mkdir -p ${INSTALLDIR}/share
15+
16+
17+
tar -xvzf superbol-install.tar.gz -C tmp-install
18+
19+
cp -Rf tmp-install/target/home/* /home/
20+
21+
export PATH=${INSTALLDIR}/bin:${PATH}
22+
export LD_LIBRARY_PATH=${INSTALLDIR}/lib:${LD_LIBRARY_PATH}
23+
export C_INCLUDE_PATH=${INSTALLDIR}/include:${C_INCLUDE_PATH}

scripts/vm-start.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/bash
22

3+
set -e
4+
35
cat << EOM
46
.,,,,,,*
57
,,,,,,*****
@@ -18,7 +20,10 @@ cat << EOM
1820
EOM
1921

2022

21-
git clone $COB_GIT_REPO cobol_repo
23+
./scripts/vm-install.sh
24+
git clone $COB_GIT_REPO ${APP_HOME}/cobol_repo
25+
export LD_LIBRARY_PATH=/home/bas/superbol/lib:/usr/host/lib
26+
export PATH=/home/bas/superbol/bin:$PATH
2227
${APP_HOME}/scripts/vm-git-check.sh &
2328
env | sort
24-
/home/bas/superbol/bin/server -v run -c $APP_HOME/cobol_repo/config.toml
29+
/home/bas/superbol/bin/superkix -v run $APP_HOME/cobol_repo

superbol-install.tar.gz

49.2 MB
Binary file not shown.
Binary file not shown.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
@font-face {
2+
font-family: Departure;
3+
src: url(/resources/DepartureMono-Regular.woff2);
4+
}
5+
6+
:root {
7+
background: rgb(9,9,121);
8+
background: radial-gradient(circle, rgba(9,9,121,1) 0%, rgb(0, 70, 140) 100%);
9+
/* color: hsl(214, 100%, 60%); */
10+
color: hsl(214, 100%, 65%);
11+
font-family: sans-serif;
12+
font-size: 110%;
13+
min-height: 100vh;
14+
}
15+
16+
body {
17+
display: grid;
18+
justify-content: center;
19+
gap: 0.3em;
20+
21+
grid-template-columns: fit-content(60em) fit-content(35em);
22+
grid-template-rows: auto;
23+
grid-template-areas:
24+
"header header"
25+
"sub-header sub-header"
26+
"logs connections"
27+
;
28+
}
29+
30+
.widget {
31+
background-color: #222222;
32+
border-radius: 0.3rem;
33+
34+
box-shadow: 0pt 0pt 0.5rem 0.1rem rgba(47, 47, 47, 0.627);
35+
36+
h2 {
37+
background-color: #333333;
38+
color: hsl(214, 100%, 65%);
39+
margin: 0pt;
40+
border-top-left-radius: 0.3rem;
41+
border-top-right-radius: 0.3rem;
42+
}
43+
44+
h2,
45+
.widget-content {
46+
padding: 0.5rem;
47+
}
48+
49+
.widget-content {
50+
font-family: Departure, monospace;
51+
}
52+
}
53+
54+
header {
55+
grid-area: header;
56+
justify-self: center;
57+
color: #ffffff;
58+
}
59+
60+
#logs {
61+
grid-area: logs;
62+
}
63+
64+
#last_config {
65+
grid-area: sub-header;
66+
}
67+
68+
.console {
69+
white-space: pre-wrap;
70+
word-wrap: break-word;
71+
max-height: 30em;
72+
overflow: scroll;
73+
}
74+
75+
#connections {
76+
grid-area: connections;
77+
}
78+
79+
table {
80+
width: 100%;
81+
border-collapse: collapse;
82+
}
83+
84+
table,
85+
th,
86+
td {
87+
border: 1px solid hsla(214, 100%, 65%, 0.566);
88+
;
89+
}
90+
91+
th,
92+
td {
93+
padding: 8px;
94+
text-align: left;
95+
}

0 commit comments

Comments
 (0)