unrealircd

- supernets unrealircd source & configuration
git clone git://git.acid.vegas/unrealircd.git
Log | Files | Refs | Archive | README | LICENSE

curlinstall (1740B)

      1 #!/bin/sh
      2 URL="https://www.unrealircd.org/files/curl-latest.tar.gz"
      3 OUTF="curl-latest.tar.gz"
      4 OUTD="curl-latest"
      5 UNREALDIR="`pwd`"
      6 PRIVATELIBDIR="$1"
      7 
      8 if [ "x$1" = "x" ]; then
      9 	echo "You should (no longer) run this program directly."
     10 	echo "It will be invoked by ./Config"
     11 	exit 1
     12 fi
     13 
     14 if [ ! -f src/parse.c ]; then
     15 	if [ -f ../src/parse.c ]; then
     16 		cd ..
     17 	else
     18 		echo "Please run this program from your UnrealIRCd directory"
     19 		echo "(usually $HOME/unrealircd-5.0.X or something like that)"
     20 		exit 1
     21 	fi
     22 fi
     23 
     24 wget --version 1>/dev/null 2>&1
     25 if [ "$?" = 0 ]; then
     26 	FETCHER="wget"
     27 else
     28 	fetch --version 1>/dev/null 2>&1
     29 	if [ "$?" = 0 ]; then
     30 		FETCHER="fetch"
     31 	else
     32 		lynx --version 1>/dev/null 2>&1
     33 		if [ "$?" = 0 ]; then
     34 			FETCHER="lynx"
     35 		else
     36 			echo "ERROR: unable to find wget/fetch/lynx, please install at least one of these programs"
     37 			exit 1
     38 		fi
     39 	fi
     40 fi
     41 
     42 if [ ! -d tmp ]; then
     43 	mkdir tmp || exit 1
     44 fi
     45 
     46 cd tmp || exit 1
     47 
     48 rm -f "$OUTF"
     49 
     50 if [ "$FETCHER" = "wget" ]; then
     51 	wget -O "$OUTF" "$URL"
     52 elif [ "$FETCHER" = "lynx" ]; then
     53 	lynx -dump "$URL" >"$OUTF"
     54 elif [ "$FETCHER" = "fetch" ]; then
     55 	cd tmp #todo: find out the cmd line parameter ;)
     56 	fetch "$URL"
     57 fi
     58 
     59 if [ "$?" != 0 ]; then
     60 	echo "ERROR: Something went wrong while trying to download $URL"
     61 	exit 1
     62 fi
     63 
     64 rm -rf "$OUTD" # remove old directory prior to extracting
     65 tar xzf "$OUTF" || exit 1
     66 
     67 
     68 if [ "`eval echo -n 'a'`" = "-n a" ] ; then
     69         c="\c"
     70 else
     71         n="-n"
     72 fi
     73 
     74 # We assume curl has been packaged in a way it will extract to "$OUTD"/
     75 cd "$OUTD" || exit 1
     76 
     77 echo "Building and installing libcurl"
     78 ./configure --prefix=$UNREALDIR/extras/curl --libdir=$PRIVATELIBDIR --enable-shared --with-openssl
     79 make || exit 1
     80 rm -f "$PRIVATELIBDIR/"libcurl*
     81 make install || exit 1