#!/bin/sh set -e set -u myself=`echo "$0" | sed 's,.*/,,'` say() { echo "$myself: $@." } die() { echo >&2 "$myself: $@." exit 1 } found_browser=no if [ ! -f lib/system.h ] then if [ -f ../lib/system.h ] then cd .. else die 'Please call me from the NSCA-ng source directory' fi fi for browser in 'lynx' 'elinks' 'links' do if type `expr "$browser" : '\([^ ]*\)'` >/dev/null 2>&1 && $browser -dump 'https://www.openssl.org/' >/dev/null 2>&1 then found_browser=yes break fi done test "$found_browser" = yes || die 'Cannot find a usable text web browser, please install lynx(1)' install_dir=`pwd`/lib/ssl tarball=`$browser -dump 'https://www.openssl.org/source/' | sed -n 's/.*\(openssl-[1-9].*\.tar\.gz\).*/\1/p' | head -1` if [ ! -f "$tarball" ] then if type curl >/dev/null 2>&1 then get="curl -L -o $tarball" elif type wget >/dev/null 2>&1 then get=wget else say 'Cannot find an HTTP client' die "Please download '$tarball' into `pwd`" fi $get "https://www.openssl.org/source/$tarball" test -f "$tarball" || die "Downloading '$tarball' failed" fi gzip -c -d "$tarball" | tar xf - cd `expr "$tarball" : '\(.*\)\.tar\.gz$'` ./config --prefix="$install_dir" no-shared no-threads make make install say 'Success' # vim:set joinspaces noexpandtab textwidth=80: