diff --git a/05-popt.sh b/05-popt.sh new file mode 100644 index 0000000..a1cda64 --- /dev/null +++ b/05-popt.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +if [ "`whoami`" == "root" ]; then + echo "Danger, Will Robinson!" + echo "Do not execute me as r00t" + exit 1 +fi + +TARBALL="popt-1.19.tar.gz" +DNL="http://ftp.rpm.org/popt/releases/popt-1.x/popt-1.19.tar.gz" +SHA256="c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9" + +[ -d popt-1.19 ] && rm -rf popt-1.19 + +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 popt-1.19 + +./configure --prefix=/usr --disable-static +if [ $? -ne 0 ]; then + echo "Configure script failed for popt. Sorry." + exit 1 +fi + +make +if [ $? -ne 0 ]; then + echo "Failed building popt. Sorry." + exit 1 +fi + +echo "running make check" +make check > popt.check.log 2>&1 + +echo "Inspect popt-1.19/popt.check.log" +echo "If it looks good, then as root:" +echo +echo " cd popt-1.19" +echo " make install" +echo diff --git a/README.md b/README.md index e33c9d7..790b57d 100644 --- a/README.md +++ b/README.md @@ -37,4 +37,10 @@ Justification: Needed to build RPM itself. Depends upon libgpg-error. * Script: [`04-libgcrypt.sh`](04-libgcrypt.sh) * Status: Script Works +Dependency Five: popt +--------------------- +Justification: Needed to build RPM itself. No build dependencies outside of LFS. + +* Script: [`05-popt.sh`](05-popt.sh) +* Status: Script Untested