From 264c499b9da98d53375549daf47f633b16beda7b Mon Sep 17 00:00:00 2001 From: YellowJacketLinux Date: Tue, 15 Oct 2024 23:24:35 -0700 Subject: [PATCH] Nettle --- 09-nettle.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 14 ++++++++++--- 2 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 09-nettle.sh diff --git a/09-nettle.sh b/09-nettle.sh new file mode 100644 index 0000000..7853580 --- /dev/null +++ b/09-nettle.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +if [ "`whoami`" == "root" ]; then + echo "Danger, Will Robinson!" + echo "Do not execute me as r00t" + exit 1 +fi + +TARBALL="nettle-3.10.tar.gz" +DNL="https://ftp.gnu.org/gnu/nettle/nettle-3.10.tar.gz" +SHA256="b4c518adb174e484cb4acea54118f02380c7133771e7e9beb98a0787194ee47c" + +[ -d nettle-3.10 ] && rm -rf nettle-3.10 + +if [ ! -f ${TARBALL} ]; then + wget ${DNL} + if [ $? -ne 0 ]; then + echo "Could not retrieve ${DNL}" + echo "Sorry." + exit 1 + fi +fi + +CHECK="`sha256sum ${TARBALL} |awk ' { print $1 } ' `" +if [ "${CHECK}" != "${SHA256}" ]; then + echo "${TARBALL} does not match expected SHA256. Sorry." + exit 1 +fi + +tar -zxf ${TARBALL} && cd nettle-3.10 +./configure --prefix=/usr --disable-static +if [ $? -ne 0 ]; then + echo "Configure script failed for nettle. Sorry." + exit 1 +fi + +make +if [ $? -ne 0 ]; then + echo "Failed building nettle. Sorry." + exit 1 +fi + +echo "running make check" +make check > nettle.check.log 2>&1 + +cat > makeinstall.sh << "EOF" +#!/bin/bash +make install +chmod 755 /usr/lib/lib{hogweed,nettle}.so +install -d -m755 /usr/share/doc/nettle-3.10 +install -m644 nettle.{html,pdf} /usr/share/doc/nettle-3.10 +EOF + +echo "Inspect nettle-3.10/nettle.check.log" +echo "If all looks good, as root:" +echo +echo " cd nettle-3.10" +echo " bash makeinstall.sh" +echo diff --git a/README.md b/README.md index 559fcb5..45db11a 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Justification: Needed to build RPM itself. No build dependencies outside of LFS. Dependency Six: ICU ------------------- -Justification: Needed to build libxml2. +Justification: Needed to build libxml2. No build dependencies outside of LFS. * Script: [`06-icu.sh`](06-icu.sh) * Status: Script Untested @@ -56,7 +56,7 @@ Justification: Needed to build libxml2. Dependency Seven: libxml2 ------------------------- -Justification: Needed for libarchive. +Justification: Needed for libarchive. Depends on ICU. * Script: [`07-libxml2.sh`](07-libxml2.sh) * Status: Script Untested @@ -64,9 +64,17 @@ Justification: Needed for libarchive. Dependency Eight: LZO --------------------- -Justification: Needed for libarchive. +Justification: Needed for libarchive. No build dependencies outside of LFS. * Script: [`08-lzo.sh`](08-lzo.sh) * Status: Script Untested +Dependency Nine: nettle +----------------------- + +Justification: Needed for libarchive. No build dependencies outside of LFS. + +* Script: [`09-nettle.sh`](09-nettle.sh) +* Status: Script Untested +