updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / cross-sparc64-linux-gnu-binutils / PKGBUILD
bloba6e99f0bd38c180e258261cdacaa6406c11a48e0
1 # Contributor: Vojtech Horky <vojta . horky at-symbol seznam . cz>
2 pkgname=cross-sparc64-linux-gnu-binutils
3 _pkgname=binutils
4 _target="sparc64-linux-gnu"
5 pkgver=2.22
6 pkgrel=1
7 pkgdesc="A set of programs to assemble and manipulate binary and object files for the Sparc64 architecture"
8 url="http://www.gnu.org/software/binutils/"
9 arch=('i686' 'x86_64')
10 license=('GPL')
11 depends=('zlib')
12 source=("ftp://ftp.gnu.org/gnu/binutils/${_pkgname}-${pkgver}.tar.bz2")
13 md5sums=('ee0f10756c84979622b992a4a61ea3f5')
14 _sysroot="/usr/lib/cross-${_target}"
16 build() {
17         cd ${srcdir}/${_pkgname}-${pkgver}
18         
19         ./configure \
20                 "--prefix=${_sysroot}" \
21                 "--bindir=/usr/bin" "--program-prefix=${_target}-" \
22                 "--with-sysroot=${_sysroot}" \
23                 "--target=${_target}" "--build=$CHOST" "--host=$CHOST" \
24                 "--disable-nls" \
25                 --with-gcc --with-gnu-as --with-gnu-ld \
26                 --without-included-gettext
27                 
28         make all
31 package() {
32         cd ${srcdir}/${_pkgname}-${pkgver}
33         
34         make DESTDIR=${pkgdir} install
35         
36         msg "Removing duplicit files..."
37         # remove these files as they are already in the system
38         # (with native binutils)
39         rm -Rf ${pkgdir}${_sysroot}/share/{man,info}
40         # remove conflicting binaries
41         find ${pkgdir}/usr/bin/ -type f -not -name "${_target}-*" -delete
42         
43         msg "Creating out-of-path executables..."
44         # symlink executables to single directory with no-arch-prefix name
45         mkdir -p ${pkgdir}/usr/bin/cross/${_target}/;
46         cd ${pkgdir}/usr/bin/cross/${_target}/;
47         for bin in ${pkgdir}/usr/bin/${_target}-*; do
48                 bbin=`basename "$bin"`;
49                 ln -s "/usr/bin/${bbin}" `echo "$bbin" | sed "s#^${_target}-##"`;
50         done