etc/protocols - sync with NetBSD-8
[minix.git] / external / lgpl3 / gmp / fetch.sh
blobd17dfa47472083ee27178f13b00b0c2b4563172b
1 #!/bin/sh
3 # Make sure we're in our directory (i.e., where this shell script is)
4 echo $0
5 cd `dirname $0`
7 # Configure fetch method
8 URL="http://www.minix3.org/pkgsrc/distfiles/minix/3.4.0/gmp-5.1.3.tar.bz2"
9 BACKUP_URL="ftp://ftp.gmplib.org/pub/gmp-5.1.3/gmp-5.1.3.tar.bz2"
10 FETCH=ftp
11 which curl >/dev/null
12 if [ $? -eq 0 ]; then
13 FETCH="curl -O -f"
16 # Fetch sources if not available
17 if [ ! -d dist ];
18 then
19 if [ ! -f gmp-5.1.3.tar.bz2 ]; then
20 $FETCH $URL
21 if [ $? -ne 0 ]; then
22 $FETCH $BACKUP_URL
26 tar -oxjf gmp-5.1.3.tar.bz2
27 mv gmp-5.1.3 dist && \
28 cd dist && \
29 cat ../patches/* |patch -p1