From 134f2e06d6669d8116a1758f02c40d1290cc9d74 Mon Sep 17 00:00:00 2001 From: YellowJacketLinux Date: Tue, 15 Oct 2024 22:31:16 -0700 Subject: [PATCH] libxml2 --- 07-libxml2.sh | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 14 +++++++++++-- 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 07-libxml2.sh diff --git a/07-libxml2.sh b/07-libxml2.sh new file mode 100644 index 0000000..b5dff0f --- /dev/null +++ b/07-libxml2.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +if [ "`whoami`" == "root" ]; then + echo "Danger, Will Robinson!" + echo "Do not execute me as r00t" + exit 1 +fi + +TARBALL="libxml2-2.13.4.tar.xz" +DNL="https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.4.tar.xz" +SHA256="65d042e1c8010243e617efb02afda20b85c2160acdbfbcb5b26b80cec6515650" + +[ -d libxml2-2.13.4 ] && rm -rf libxml2-2.13.4 + +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 -Jxf ${TARBALL} && cd libxml2-2.13.4 + +./configure --prefix=/usr \ + --sysconfdir=/etc \ + --disable-static \ + --with-history \ + --with-icu \ + PYTHON=/usr/bin/python3 \ + --docdir=/usr/share/doc/libxml2-2.13.4 +if [ $? -ne 0 ]; then + echo "Configure script failed for libxml2. Sorry." + exit 1 +fi + +cat > makeinstall.sh << "EOF" +#!/bin/bash + +make install +rm -f /usr/lib/libxml2.la +sed '/libs=/s/xml2.*/xml2"/' -i /usr/bin/xml2-config +EOF + +echo +echo "As the root user:" +echo +echo " cd libxml2-2.13.4" +echo " bash makeinstall.sh" +echo diff --git a/README.md b/README.md index 0d470e5..e38b634 100644 --- a/README.md +++ b/README.md @@ -45,10 +45,20 @@ Justification: Needed to build RPM itself. No build dependencies outside of LFS. * Script: [`05-popt.sh`](05-popt.sh) * Status: Script Works -Dependency Five: ICU --------------------- +Dependency Six: ICU +------------------- Justification: Needed to build libxml2. * Script: [`06-icu.sh`](06-icu.sh) * Status: Script Untested + +Dependency Seven: libxml2 +------------------------- + +Justification: Needed for libarchive. + +* Script: [`07-libxml2.sh`](07-libxml2.sh) +* Status: Script Untested + +