]> jfr.im git - irc/unrealircd/unrealircd.git/blame - curlinstall
Create branch unreal33.
[irc/unrealircd/unrealircd.git] / curlinstall
CommitLineData
3be92d02 1#!/bin/sh
6b28bfd1
BM
2URL="http://www.unrealircd.com/files/curl-latest.tar.gz"
3OUTF="curl-latest.tar.gz"
4OUTD="curl-latest"
5ARESPATH="`pwd`/extras/c-ares"
84007d4c 6CARESVERSION="1.7.3"
6b28bfd1
BM
7if [ ! -f "Unreal.nfo" ]; then
8 echo "Please run this program from your UnrealIRCd directory"
9 echo "(usually $HOME/Unreal3.2 or something like that)"
10 exit 1
11fi
3be92d02 12
6b28bfd1
BM
13wget --version 1>/dev/null 2>&1
14if [ "$?" = 0 ]; then
15 FETCHER="wget"
16else
17 fetch --version 1>/dev/null 2>&1
18 if [ "$?" = 0 ]; then
19 FETCHER="fetch"
20 else
21 lynx --version 1>/dev/null 2>&1
22 if [ "$?" = 0 ]; then
23 FETCHER="lynx"
24 else
25 echo "ERROR: unable to find wget/fetch/lynx, please install at least one of these programs"
26 exit 1
27 fi
28 fi
29fi
30
31if [ ! -d tmp ]; then
32 mkdir tmp || exit 1
33fi
34
35cd tmp || exit 1
36
37rm -f "$OUTF"
38
39if [ "$FETCHER" = "wget" ]; then
40 wget -O "$OUTF" "$URL"
41elif [ "$FETCHER" = "lynx" ]; then
42 lynx -dump "$URL" >"$OUTF"
43elif [ "$FETCHER" = "fetch" ]; then
44 cd tmp #todo: find out the cmd line parameter ;)
45 fetch "$URL"
46fi
47
48if [ "$?" != 0 ]; then
49 echo "ERROR: Something went wrong while trying to download $URL"
3be92d02 50 exit 1
51fi
52
6b28bfd1
BM
53rm -rf "$OUTD" # remove old directory prior to extracting
54tar xzf "$OUTF" || exit 1
55
56
3be92d02 57if [ "`eval echo -n 'a'`" = "-n a" ] ; then
58 c="\c"
59else
60 n="-n"
61fi
62
6b28bfd1
BM
63if [ ! -d "$ARESPATH/lib" ]; then
64 echo "c-ares has not been build yet, let's do that now..."
65 cd ../extras/
66 tar xzf c-ares.tar.gz || exit 1
67 cd c-ares-$CARESVERSION || exit 1
68 ./configure --prefix=$ARESPATH || exit 1
69 (make && make install) || exit 1
70 cd ../../tmp/
71 echo "c-ares built."
3be92d02 72 echo ""
99a3c537 73fi
3be92d02 74
6b28bfd1
BM
75# We assume curl has been packaged in a way it will extract to "$OUTD"/
76cd "$OUTD" || exit 1
042ce076 77
6b28bfd1
BM
78echo "Building and installing libcurl"
79CPPFLAGS="-I$ARESPATH/include" ./configure --prefix=$HOME/curl --disable-shared \
80 --disable-thread --enable-ares=$ARESPATH --disable-ipv6 $SSLFLAG
81cp -R $ARESPATH/lib ares
82make && make install
3be92d02 83
6b28bfd1
BM
84#cp $ARESPATH/lib/libcares.a $HOME/curl/lib
85# that isn't needed anymore as the lib is already in unreal...