#!/bin/sh CWD=`pwd` TMP=/tmp PKG=$TMP/package-binutils VERSION=2.20.51.0.8 ARCH=alpha BUILD=1 TARGET=$ARCH-alphaslack-linux rm -rf $PKG mkdir -p $PKG/usr ( cd $TMP rm -rf binutils-$VERSION tar xjf $CWD/binutils-$VERSION.tar.bz2 cd binutils-$VERSION chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; # Build for a standard glibc2-based Linux system: ./configure \ --prefix=/usr \ --infodir=/usr/info \ --mandir=/usr/man \ --enable-shared \ --enable-targets=$TARGET \ --build=$TARGET make || exit 1 # Install into the $PKG location: make install DESTDIR=$PKG || exit 1 # Missing? # "make install" skips this, but binutils.spec doesn't. Sneaky, huh? cp -a include/libiberty.h $PKG/usr/include/libiberty.h # cp docu mkdir -p $PKG/usr/doc/binutils-$VERSION cp -a COPYING* README* $PKG/usr/doc/binutils-$VERSION # Differentiate between BSD strings and GNU strings ( cd $PKG/usr/bin ; mv strings strings-GNU ) ( cd $PKG/usr/man/man1 ; mv strings.1 strings-GNU.1 ) # Add slack-desc: mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # Now we must remember to adjust ldscripts (real dir is /usr/$TARGET/lib/ldscripts/, # links go in /usr/lib/ ), and the bin links: ( cd $PKG/usr/lib ; rm -rf ldscripts ; ln -sf ../$TARGET/lib/ldscripts . ) ( cd $PKG/usr/bin for file in * ; do if [ -r "../$TARGET/bin/$file" ]; then rm $file ln -sf ../$TARGET/bin/$file . fi done ) rm -f $PKG/usr/man/man1/{dlltool,windres}.1 gzip -9 $PKG/usr/man/man1/* $PKG/usr/info/*.info rm -rf $PKG/usr/info/dir ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) chown -R root.bin $PKG/usr/bin cd $PKG makepkg -l y -c n $TMP/binutils-$VERSION-$ARCH-$BUILD.tgz ) 2>&1 | tee $TMP/binutils.build.log