diff --git a/08-lzo.sh b/08-lzo.sh new file mode 100644 index 0000000..f167c6b --- /dev/null +++ b/08-lzo.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +if [ "`whoami`" == "root" ]; then + echo "Danger, Will Robinson!" + echo "Do not execute me as r00t" + exit 1 +fi + +TARBALL="lzo-2.10.tar.gz" +DNL="https://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz" +SHA256="c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072" + +[ -d lzo-2.10 ] && rm -rf lzo-2.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 lzo-2.10 + +./configure --prefix=/usr \ + --enable-shared \ + --disable-static \ + --docdir=/usr/share/doc/lzo-2.10 +if [ $? -ne 0 ]; then + echo "Configure script failed for LZO. Sorry." + exit 1 +fi + +make +if [ $? -ne 0 ]; then + echo "Failed building LZO. Sorry." + exit 1 +fi + +echo "running make check" +make check > lzo.check.log 2>&1 + +echo +echo "Inspect lzo-2.10/lzo.check.log" +echo "If it looks good, as root:" +echo +echo " cd lzo-2.10" +echo " make install" +echo diff --git a/README.md b/README.md index e38b634..559fcb5 100644 --- a/README.md +++ b/README.md @@ -61,4 +61,12 @@ Justification: Needed for libarchive. * Script: [`07-libxml2.sh`](07-libxml2.sh) * Status: Script Untested +Dependency Eight: LZO +--------------------- + +Justification: Needed for libarchive. + +* Script: [`08-lzo.sh`](08-lzo.sh) +* Status: Script Untested +