xref: /minix3/external/gpl2/gmake/fetch.sh (revision 5ef5b27fc158620d80785f43f03fc1ff30cbe16f)
1#!/bin/sh
2
3# Make sure we're in our directory (i.e., where this shell script is)
4echo $0
5cd `dirname $0`
6
7FETCH=ftp
8which curl >/dev/null
9if [ $? -eq 0 ]; then
10        FETCH="curl -O -f"
11fi
12
13# Configure fetch method - GMAKE
14URL="http://www.minix3.org/pkgsrc/distfiles/minix/3.4.0/make-3.81.tar.bz2"
15BACKUP_URL="ftp://ftp.gnu.org/gnu/make/make-3.81.tar.bz2"
16
17# Fetch sources if not available
18if [ ! -d dist ];
19then
20        if [ ! -f make-3.81.tar.bz2 ]; then
21                $FETCH $URL
22                if [ $? -ne 0 ]; then
23                        $FETCH $BACKUP_URL
24                fi
25        fi
26
27        tar -xjf make-3.81.tar.bz2 && \
28        mv make-3.81 dist && \
29        cd dist && \
30        cat ../patches/* | patch -p 1 || true
31fi
32