The Mbed TLS package provides TLS libraries and aims to flexible and portable.
Install Mbed TLS by running the following commands:
mkdir build &&
cd build &&
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_SKIP_RPATH=ON \
-D USE_SHARED_MBEDTLS_LIBRARY=ON \
-D USE_STATIC_MBEDTLS_LIBRARY=OFF \
-D ENABLE_TESTING=OFF \
-G Ninja .. &&
ninja
Now, as the root user:
DESTDIR=$PWD/DESTDIR ninja install &&
pushd DESTDIR/usr/bin &&
for i in *; do
mv -v {,mbedtls_}$i
done
popd &&
cp -vR DESTDIR/usr/* /usr
-D
CMAKE_SKIP_INSTALL_RPATH=ON: This switch makes
cmake remove
hardcoded library search paths (rpath) when installing a binary
executable file or a shared library. This package does not need
rpath once it's installed into the standard location, and rpath may
sometimes cause unwanted effects or even security issues.
-D
USE_SHARED_MBEDTLS_LIBRARY=ON: This parameter ensures
shared libraries are built.
-D
USE_STATIC_MBEDTLS_LIBRARY=OFF: This parameter ensures
the main libraries are not statically built.
-D ENABLE_TESTING=OFF: This
parameter disables building tests that make the building process
twice as long.
pushd DESTDIR/usr/bin ...: These commands rename the programs as to not conflict with those that may be installed by other programs.