/
get-wget-lua.sh
executable file
·47 lines (42 loc) · 1.01 KB
/
get-wget-lua.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
#
# This script downloads and compiles wget-lua.
#
# 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
TARVERSION=1.14.lua.20130120-8476
TARFILE=wget-$TARVERSION.tar.bz2
TARDIR=wget-$TARVERSION
rm -rf $TARFILE $TARDIR/
wget http://warriorhq.archiveteam.org/downloads/wget-lua/$TARFILE
tar xjf $TARFILE
cd $TARDIR/
if ./configure $CONFIGURE_SSL_OPT --disable-nls && make && src/wget -V | grep -q lua
then
cp src/wget ../wget-lua
cd ../
echo
echo
echo "###################################################################"
echo
echo "wget-lua successfully built."
echo
./wget-lua --help | grep -iE "gnu|warc|lua"
rm -rf $TARFILE $TARDIR/
else
echo
echo "wget-lua not successfully built."
echo
fi