xref: /minix3/gnu/dist/fetch.sh (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
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 - TEXINFO
14URL="http://www.minix3.org/pkgsrc/distfiles/minix/3.4.0/texinfo-4.8.tar.bz2"
15BACKUP_URL="ftp://ftp.gnu.org/gnu/texinfo/texinfo-4.8.tar.bz2"
16
17# Fetch sources if not available
18if [ ! -d texinfo ];
19then
20	if [ ! -f texinfo-4.8.tar.bz2 ]; then
21		$FETCH $URL
22		if [ $? -ne 0 ]; then
23			$FETCH $BACKUP_URL
24		fi
25	fi
26
27	tar -xjf texinfo-4.8.tar.bz2 && \
28	cd texinfo-4.8 && \
29	cat ../../usr.bin/texinfo/patches/* | patch -p1 && \
30	cd - && \
31	mv texinfo-4.8 texinfo
32fi
33
34