lfs-buildscripts/CH8Build/CH08.46-libressl.sh

74 lines
1.7 KiB
Bash
Raw Normal View History

2024-10-06 04:57:41 +08:00
#!/bin/bash
source versions.sh
GLSOURCES="/sources"
2024-10-09 09:50:04 +08:00
pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
2024-10-06 04:57:41 +08:00
[ -d libressl-${libressl_version} ] && rm -rf libressl-${libressl_version}
tar -zxf ${libressl_tarball}
cd libressl-${libressl_version}
2024-10-06 11:46:48 +08:00
patch -p1 < ../libressl-${libressl_version}-cnf-name.patch
2024-10-06 04:57:41 +08:00
mv openssl.cnf libressl.cnf
2024-10-06 10:44:43 +08:00
mv man/openssl.cnf.5 man/libressl.cnf.5
2024-10-06 04:57:41 +08:00
pushd apps/openssl
2024-10-08 14:25:15 +08:00
sed -i 's?^.Dt OPENSSL?.Dt LIBRESSL?' openssl.1
2024-10-06 04:57:41 +08:00
sed -i 's?openssl.1?libressl.1?' openssl.1
sed -i 's?^.Nd OpenSSL?.Nd LibreSSL?g' openssl.1
sed -i 's?^.Nm openssl ?.Nm libressl ?g' openssl.1
sed -i 's?^.Nm openssl$?.Nm libressl?g' openssl.1
sed -i 's?^.It Nm openssl ?.It Nm libressl ?g' openssl.1
sed -i 's?^.Cm openssl ?.Cm libressl ?g' openssl.1
sed -i 's?^.Bl -hang -width "openssl?.Bl -hang -width "libressl?g' openssl.1
mv openssl.1 libressl.1
sed -i 's?openssl.1?libressl.1?' CMakeLists.txt
sed -i 's?openssl.1?libressl.1?' Makefile.am
sed -i 's?openssl.1?libressl.1?' Makefile.in
popd
./configure --prefix=/usr \
--with-openssldir=/etc/ssl \
--libdir=/usr/lib
make
if [ $? -ne 0 ]; then
myfail "Failed building libressl"
fi
2024-10-09 09:50:04 +08:00
if [ ! -f ${GLSOURCES}/SKIPTESTS ]; then
echo "running libressl make check"
make check > ${GLSOURCES}/libressl.check.log 2>&1
fi
2024-10-06 04:57:41 +08:00
make install
if [ $? -ne 0 ]; then
myfail "Failed installing libressl"
fi
2024-10-06 10:44:43 +08:00
# rename binary and make compatibility links
mv /usr/bin/openssl /usr/bin/libressl
ln -s libressl /usr/bin/openssl
ln -s libressl.cnf /etc/ssl/openssl.cnf
cat > /usr/share/man/man1/openssl.1 << "EOF"
.so man1/libressl.1
EOF
cat > /usr/share/man/man5/openssl.cnf.5 << "EOF"
.so man5/libressl.cnf.5
EOF
2024-10-08 14:25:15 +08:00
popd
# cleanup
pushd $GLSOURCES
rm -rf libressl-${libressl_version}
popd