echo "--------- BUILDING FILE UTILITY -----------"

cd $TMP
tar xzvf $ORIGPATH/source/file-3.41.tar.gz
cd file-*

# These are the same patches as Slackware v9 uses.
zcat $ORIGPATH/source/file.magic.diff.gz | patch -p1 -E --verbose
zcat $ORIGPATH/source/file.makefile.in.diff.gz | patch -p1 -E --verbose
zcat $ORIGPATH/source/file.quiet.diff.gz | patch -p1 -E --verbose
zcat $ORIGPATH/source/file.short.diff.gz | patch -p1 -E --verbose

$ARMCONFIGURE --prefix=/usr --sysconfdir=/etc --datadir=/etc --enable-fsect-man5 

# Ignore some of the errors from this; it compiles 'file' ok.
make -e

mkdir -p /usr/doc/file-3.41
install -m644 LEGAL.NOTICE README /usr/doc/file-3.41

mv file /usr/bin/
install -m644 magic /etc/magic.new
install -m644 magic.mime /etc/magic.mime.new

# Man pages
install -m644 file.1 /usr/man/man1/
install -m644 magic.5 /usr/man/man5/

#EOF
