forked from unrealircd/unrealircd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurlinstall
executable file
·85 lines (72 loc) · 1.95 KB
/
curlinstall
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
URL="http://www.unrealircd.com/files/curl-latest.tar.gz"
OUTF="curl-latest.tar.gz"
OUTD="curl-latest"
ARESPATH="`pwd`/extras/c-ares"
CARESVERSION="1.10.0"
if [ ! -f "Unreal.nfo" ]; then
echo "Please run this program from your UnrealIRCd directory"
echo "(usually $HOME/Unreal3.2 or something like that)"
exit 1
fi
wget --version 1>/dev/null 2>&1
if [ "$?" = 0 ]; then
FETCHER="wget"
else
fetch --version 1>/dev/null 2>&1
if [ "$?" = 0 ]; then
FETCHER="fetch"
else
lynx --version 1>/dev/null 2>&1
if [ "$?" = 0 ]; then
FETCHER="lynx"
else
echo "ERROR: unable to find wget/fetch/lynx, please install at least one of these programs"
exit 1
fi
fi
fi
if [ ! -d tmp ]; then
mkdir tmp || exit 1
fi
cd tmp || exit 1
rm -f "$OUTF"
if [ "$FETCHER" = "wget" ]; then
wget -O "$OUTF" "$URL"
elif [ "$FETCHER" = "lynx" ]; then
lynx -dump "$URL" >"$OUTF"
elif [ "$FETCHER" = "fetch" ]; then
cd tmp #todo: find out the cmd line parameter ;)
fetch "$URL"
fi
if [ "$?" != 0 ]; then
echo "ERROR: Something went wrong while trying to download $URL"
exit 1
fi
rm -rf "$OUTD" # remove old directory prior to extracting
tar xzf "$OUTF" || exit 1
if [ "`eval echo -n 'a'`" = "-n a" ] ; then
c="\c"
else
n="-n"
fi
if [ ! -d "$ARESPATH/lib" ]; then
echo "c-ares has not been build yet, let's do that now..."
cd ../extras/
tar xzf c-ares.tar.gz || exit 1
cd c-ares-$CARESVERSION || exit 1
./configure --prefix=$ARESPATH || exit 1
(make && make install) || exit 1
cd ../../tmp/
echo "c-ares built."
echo ""
fi
# We assume curl has been packaged in a way it will extract to "$OUTD"/
cd "$OUTD" || exit 1
echo "Building and installing libcurl"
CPPFLAGS="-I$ARESPATH/include" ./configure --prefix=$HOME/curl --disable-shared \
--disable-thread --enable-ares=$ARESPATH --disable-ipv6 $SSLFLAG
cp -R $ARESPATH/lib ares
make && make install
#cp $ARESPATH/lib/libcares.a $HOME/curl/lib
# that isn't needed anymore as the lib is already in unreal...