reddit-grab/get-wget-lua.sh

58 lines
1.2 KiB
Bash
Raw Normal View History

2015-07-05 09:43:31 +00:00
#!/usr/bin/env bash
#
2020-06-30 23:11:06 +00:00
# This script clones and compiles wget-lua.
2015-07-05 09:43:31 +00:00
#
# first, try to detect gnutls or openssl
CONFIGURE_SSL_OPT=""
if builtin type -p pkg-config &>/dev/null
then
if pkg-config gnutls
then
echo "Compiling wget with GnuTLS."
CONFIGURE_SSL_OPT="--with-ssl=gnutls"
elif pkg-config openssl
then
echo "Compiling wget with OpenSSL."
CONFIGURE_SSL_OPT="--with-ssl=openssl"
fi
fi
2020-06-30 23:11:06 +00:00
if ! zstd --version | grep -q 1.4.4
then
echo "Need version 1.4.4 of libzstd-dev and zstd"
exit 1
fi
2015-07-05 09:43:31 +00:00
rm -rf get-wget-lua.tmp/
mkdir -p get-wget-lua.tmp
cd get-wget-lua.tmp
2020-06-30 23:11:06 +00:00
git clone https://github.com/archiveteam/wget-lua.git
cd wget-lua
git checkout v1.20.3-at
#echo -n 1.20.3-at-lua | tee ./.version ./.tarball-version > /dev/null
2015-07-05 09:43:31 +00:00
2020-06-30 23:11:06 +00:00
if ./bootstrap && ./configure $CONFIGURE_SSL_OPT --disable-nls && make && src/wget -V | grep -q lua
2015-07-05 09:43:31 +00:00
then
2020-06-30 23:11:06 +00:00
cp src/wget ../../wget-at
cd ../../
2015-07-05 09:43:31 +00:00
echo
echo
echo "###################################################################"
echo
echo "wget-lua successfully built."
echo
2020-06-30 23:11:06 +00:00
./wget-at --help | grep -iE "gnu|warc|lua"
2015-07-05 09:43:31 +00:00
rm -rf get-wget-lua.tmp
exit 0
else
echo
echo "wget-lua not successfully built."
echo
exit 1
fi