move 1st part to new install script

This commit is contained in:
Mario Fetka 2024-04-20 13:23:50 +02:00
parent 5e5a8a2838
commit f4faf1f737
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,59 @@
if [ $CRYPT = "Yes" ]; then
msg_info "Setting up ${APP} cryptlib for ssh/ssl (be patient compiling cryptlib)"
apt install -y build-essential &>/dev/null
apt install -y gcc-9 g++-9 cpp-9 gcc g++ cpp &>/dev/null
apt install -y patch &>/dev/null
apt install -y dos2unix &>/dev/null
wget -N http://www.mysticbbs.com/downloads/cl345.zip -O $MSTEMPDIR/cryptlib345.zip &>/dev/null
rm -rf $MSTEMPDIR/cryptlib-3.4.5 &>/dev/null
mkdir -p $MSTEMPDIR/cryptlib-3.4.5 &>/dev/null
pushd $MSTEMPDIR/cryptlib-3.4.5 &>/dev/null
unzip ../cryptlib345.zip &>/dev/null
dos2unix tools/* &>/dev/null
dos2unix kernel/* &>/dev/null
patch -p1 -i $MSTEMPDIR/mystic/cryptlib/patches/gccversion-345.patch &>/dev/null
patch -p0 -i $MSTEMPDIR/mystic/cryptlib/patches/cl-linux-yield.patch &>/dev/null
ln -sf gcc-9 /usr/bin/gcc &>/dev/null
ln -sf g++-9 /usr/bin/g++ &>/dev/null
ln -sf cpp-9 /usr/bin/cpp &>/dev/null
make shared &>/dev/null
cp libcl.so.3.4.5 ${LIBDIR}/ &>/dev/null
ln -sf libcl.so.3.4.5 ${LIBDIR}/libcl.so.3.4 &>/dev/null
ln -sf libcl.so.3.4 ${LIBDIR}/libcl.so.3 &>/dev/null
ln -sf libcl.so.3 ${LIBDIR}/libcl.so &>/dev/null
popd &>/dev/null
msg_ok "Setting up ${APP} cryptlib for ssh/ssl (be patient compiling cryptlib)"
msg_info "Setting up ${APP} pemtrans (be patient compiling cryptlib)"
SSLDEV=$(apt-cache madison libssl-dev | grep 1.0.1 | awk '{print $3}')
apt install -y =libssl-dev-${SSLDEV}
wget -N https://github.com/amenonsen/pemtrans/archive/refs/heads/master.zip -O $MSTEMPDIR/pemtrans.zip &>/dev/null
rm -rf $MSTEMPDIR/pemtrans-master &>/dev/null
pushd $MSTEMPDIR/ &>/dev/null
unzip pemtrans.zip &>/dev/null
popd &>/dev/null
cat << 'EOF' > $MSTEMPDIR/pemtrans-master/Makefile
## Tell the compiler where to find <openssl/pem.h> and <cryptlib.h>
## Cryptlib is usually linked with these libraries:
EXTRA_LIBS = -lresolv -lpthread
## Remember to change theese to suit your environment!!
INCLUDES = -I../cryptlib-3.4.5
pemtrans: pemtrans.c
gcc9 $(INCLUDES) $(LIBS) -o pemtrans pemtrans.c $(CRYPTLIB) \
-lcrypto -lssl -lcl $(EXTRA_LIBS)
EOF
pushd $MSTEMPDIR/pemtrans-master &>/dev/null
cp pemtrams ${MYSTIC_DIR}/
cp pemtrans.1 ${MYSTIC_DIR}/docs/
cp README ${MYSTIC_DIR}/docs/pemtrans_README
popd &>/dev/null
apt purge -y gcc g++ cpp &>/dev/null
apt install -y gcc g++ cpp &>/dev/null
msg_ok "Setting up ${APP} pemtrans (be patient compiling cryptlib)"
fi

View File

@ -185,6 +185,8 @@ source $MSTEMPDIR/mystic/spellcheck/install-${SCRIPT_VER}.sh
source $MSTEMPDIR/mystic/mrc-client/install-${SCRIPT_VER}.sh source $MSTEMPDIR/mystic/mrc-client/install-${SCRIPT_VER}.sh
# Add Multi Relay Chat Server # Add Multi Relay Chat Server
source $MSTEMPDIR/mystic/mrc-server/install-${SCRIPT_VER}.sh source $MSTEMPDIR/mystic/mrc-server/install-${SCRIPT_VER}.sh
# Add Cryptlib support
source $MSTEMPDIR/mystic/cryptlib/install-${SCRIPT_VER}.sh
exit 0 exit 0