# Description: Le paquet GNU Binutils est une collection d'outils 
# URL: http://sources.redhat.com/binutils/
# Maintainer:  NuTyX core team
# Packager: thierryn1 at hispeed dot ch
# Depends on: 

name=binutils
version=2.19.1
release=2
source=(ftp://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2)

build() {
cd $name-$version

rm -fv etc/standards.info
sed -i.bak '/^INFO/s/standards.info //' etc/Makefile.in

sed -i -e 's/getline/get_line/' libiberty/testsuite/test-demangle.c

	
mkdir ../binutils-build
cd ../binutils-build
../$name-$version/configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--enable-shared
sed -i -e "s:mandir \= \/usr\/share:mandir \= ${pkgdir}\/usr\/share:" Makefile
sed -i -e "s:infodir \= \/usr\/share:infodir \= ${pkgdir}\/usr\/share:" Makefile 
make tooldir=/usr
make check
make tooldir=/usr DESTDIR=$PKG install
cp ../$name-$version/include/libiberty.h $PKG/usr/include
rm -rf $PKG/usr/info
sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/libbfd.la

}