#!/bin/bash

cd $SOURCE_DIR
if [ ! -f coreutils-$COREUTILS_VER.tar.gz ]; then
  wget http://ftp.gnu.org/gnu/coreutils/coreutils-$COREUTILS_VER.tar.gz
fi

cd $BUILD_DIR
rm -rf coreutils-$COREUTILS_VER
tar -xf $SOURCE_DIR/coreutils-$COREUTILS_VER.tar.gz

rm -rf coreutils-build
mkdir -p coreutils-build
cd coreutils-build

../coreutils-$COREUTILS_VER/configure \
  --host=$TARGET \
  --prefix=
make DESTDIR=$HURD_DIR install

cd $ROOT
