description="Collection of tools for accessing the file system MS-DOS"
url="http://mtools.linux.lu/"
packager="tnut <tnut@nutyx.org>"
contributors="pierre at nutyx dot org"

name=mtools
version=4.0.23

source=(ftp://ftp.gnu.org/gnu/mtools/$name-$version.tar.bz2)

build() {
	cd $name-$version

	sed -i '/^SAMPLE FILE$/s:^:# :' mtools.conf

	./configure --prefix=/usr \
              --mandir=/usr/share/man \
              --infodir=/usr/share/info \
	      --sysconfdir=/etc

	make
	make -j1 prefix=$PKG/usr install
	
	install -Dm644 mtools.conf $PKG/etc/mtools.conf
}
uptodate() {
local url ext
url="https://ftp.gnu.org/gnu/$name/"
ext=".tar.bz2"
lynx -read_timeout=20 -dump -listonly -nonumbers \
$url?C=M\;O=A|grep $name-[0-9]|grep [0-9]$ext$| \
sed "s@$url$name-@@"|sed "s@$ext@@"|tail -1
}
