Browse Source

binutils: updated to 2.22


git-svn-id: http://trac.vinelinux.org/repos/projects/specs@5184 ec354946-7b23-47d6-9f5a-488ba84defc7
kenta 13 years ago
parent
commit
e84ab8c0a0
1 changed files with 35 additions and 21 deletions
  1. 35 21
      b/binutils/binutils-vl.spec

+ 35 - 21
b/binutils/binutils-vl.spec

@@ -10,33 +10,35 @@
 Summary: A GNU collection of binary utilities.
 Summary(ja): GNU 版バイナリユーティリティ集
 Name: binutils
-Version: 2.20.51.0.12
+Version: 2.22
 Release: 1%{?_dist_release}
 License: GPLv3+
 Group: Development/Tools
 URL: http://sources.redhat.com/binutils
-Source: ftp://ftp.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.bz2
+
+Vendor:         Project Vine
+Distribution:   Vine Linux
+Packager:       kenta, shaolin, inagaki
+
+# Source: ftp://ftp.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.bz2
+# The ftp.kernel.org/pub/linux/devel/binutils/ page is (temporarily) unavailable
+# so we use the GNU site instead.
+# Source: ftp://ftp.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.bz2
+Source: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2
 Source2: binutils-2.19.50.0.1-output-format.sed
 Patch01: binutils-2.20.51.0.12-libtool-lib64.patch
 Patch02: binutils-2.20.51.0.12-ppc64-pie.patch
 Patch03: binutils-2.20.51.0.2-ia64-lib64.patch
 Patch04: binutils-2.20.51.0.12-version.patch
 Patch05: binutils-2.20.51.0.2-set-long-long.patch
-Patch06: binutils-2.20.51.0.12-build-id.patch
+Patch06: binutils-2.22-build-id.patch
 Patch07: binutils-2.20.51.0.12-copy-osabi.patch
 Patch08: binutils-2.20.51.0.12-sec-merge-emit.patch
-Patch09: binutils-2.20.51.0.12-gold-plugins.patch
 
 %if %{?_dist_release} > vl6
 %define gold_arches %ix86 x86_64
 %endif
 
-%ifarch %gold_arches
-%define build_gold	both
-%else
-%define build_gold	ld
-%endif
-
 %if 0%{?_with_debug:1}
 # Define this if you want to skip the strip step and preserve debug info.
 # Useful for testing.
@@ -66,7 +68,7 @@ Obsoletes: gnupro
 %{!?ld_bfd_priority: %define ld_bfd_priority	50}
 %{!?ld_gold_priority:%define ld_gold_priority	30}
 
-%if "%{build_gold}" == "both"
+%ifarch %gold_arches
 Requires(post): coreutils
 Requires(post): alternatives
 Requires(preun): alternatives
@@ -130,7 +132,6 @@ to consider using libelf instead of BFD.
 %patch06 -p0 -b .build-id~
 %patch07 -p0 -b .copy-osabi~
 %patch08 -p0 -b .sec-merge-emit~
-%patch09 -p0 -b .gold-plugins~
 
 # We cannot run autotools as there is an exact requirement of autoconf-2.59.
 
@@ -184,8 +185,10 @@ CFLAGS="$CFLAGS -O0 -ggdb2"
 %configure \
   --build=%{_target_platform} --host=%{_target_platform} \
   --target=%{binutils_target} \
-%if "%{build_gold}" == "both"
-  --enable-gold=%{build_gold} \
+%ifarch %gold_arches
+  --enable-gold=yes --enable-ld=yes \
+%else
+  --enable-gold=no --enable-ld=yes \
 %endif
 %if %{enable_shared}
   --enable-shared \
@@ -233,9 +236,14 @@ make CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C libiberty
 make -C bfd clean
 make CFLAGS="-g -fPIC $RPM_OPT_FLAGS -fvisibility=hidden" -C bfd
 
+# Rebuild libopcodes.a with -fPIC.
+make -C opcodes clean
+make CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C opcodes
+
 install -m 644 bfd/libbfd.a $RPM_BUILD_ROOT%{_libdir}
 install -m 644 libiberty/libiberty.a $RPM_BUILD_ROOT%{_libdir}
 install -m 644 include/libiberty.h $RPM_BUILD_ROOT%{_prefix}/include
+install -m 644 opcodes/libopcodes.a %{buildroot}%{_libdir}
 # Remove Windows/Novell only man pages
 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/{dlltool,nlmconv,windres}*
 
@@ -321,12 +329,13 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %post
-%if "%{build_gold}" == "both"
+%ifarch %gold_arches
 %__rm -f %{_bindir}/ld
-update-alternatives --install %{_bindir}/ld ld \
+  /sbin/alternatives --install %{_bindir}/ld ld \
   %{_bindir}/ld.bfd %{ld_bfd_priority}
-update-alternatives --install %{_bindir}/ld ld \
+  /sbin/alternatives --install %{_bindir}/ld ld \
   %{_bindir}/ld.gold %{ld_gold_priority}
+  /sbin/alternatives --auto ld 
 %endif
 
 /sbin/ldconfig
@@ -341,10 +350,10 @@ then
 fi
 
 %preun
-%if "%{build_gold}" == "both"
+%ifarch %gold_arches
 if [ $1 = 0 ]; then
-update-alternatives --remove ld %{_bindir}/ld.gold
-update-alternatives --remove ld %{_bindir}/ld.bfd
+  /sbi/alternatives --remove ld %{_bindir}/ld.gold
+  /sbin/alternatives --remove ld %{_bindir}/ld.bfd
 fi
 %endif
 
@@ -381,7 +390,7 @@ fi
 %defattr(-,root,root,-)
 %doc README
 %{_bindir}/*
-%if "%{build_gold}" == "both"
+%ifarch %gold_arches
 %ghost %{_bindir}/ld
 %endif
 %{_mandir}/man1/*
@@ -403,6 +412,11 @@ fi
 
 
 %changelog
+* Fri Nov 25 2011 NAKAMURA Kenta <kenta@vinelinux.org> - 2.22-1
+- updated to 2.22 (gnu.org)
+- updated Patch06: build-id patch
+- dropped Patch09: gold-plugins patch
+
 * Sun Apr 03 2011 NAKAMURA Kenta <kenta@vinelinux.org> - 2.20.51.0.12-1
 - updated to 2.20.51.0.12
 - updated --build-id patch.