description="The GNU Project debugger, allows you to see what is going on “inside” another program while it executes."
url="http://www.sourceware.org/gdb/"
packager="tnut <tnut@nutyx.org>"

name=gdb
version=8.3

source=(https://ftp.gnu.org/gnu/gdb/$name-$version.tar.xz)
build() {
cd $name-$version
./configure --prefix=/usr --with-system-readline
make
make DESTDIR=$PKG install
rm $PKG/usr/include/plugin-api.h
rm $PKG/usr/share/info/bfd.info
rm $PKG/usr/include/ansidecl.h
rm $PKG/usr/include/bfd.h
rm $PKG/usr/include/bfdlink.h
rm $PKG/usr/include/dis-asm.h
rm $PKG/usr/include/symcat.h
rm $PKG/usr/include/bfd_stdint.h
rm $PKG/usr/lib/libbfd.a
rm $PKG/usr/lib/libbfd.la
rm $PKG/usr/lib/libopcodes.a
rm $PKG/usr/lib/libopcodes.la

# Most of the locale are allready present from binnutils, beter get rid of all of them
rm -r $PKG/usr/share/locale
rm $PKG/usr/include/diagnostics.h
}

uptodate() {
local url ext
url="https://ftp.gnu.org/gnu/$name/"
ext=".tar.xz"
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
}
