diff --git a/binutils.changes b/binutils.changes index 3c76568..57e63b6 100644 --- a/binutils.changes +++ b/binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/binutils.spec b/binutils.spec index 7490cf0..c2538f6 100644 --- a/binutils.spec +++ b/binutils.spec @@ -98,6 +98,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -110,6 +111,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -121,7 +123,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -312,10 +313,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -368,23 +373,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -395,6 +414,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-aarch64-binutils.changes b/cross-aarch64-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-aarch64-binutils.changes +++ b/cross-aarch64-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-aarch64-binutils.spec b/cross-aarch64-binutils.spec index c5e1bfe..e472553 100644 --- a/cross-aarch64-binutils.spec +++ b/cross-aarch64-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-alpha-binutils.changes b/cross-alpha-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-alpha-binutils.changes +++ b/cross-alpha-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-alpha-binutils.spec b/cross-alpha-binutils.spec index ece222f..5b866f4 100644 --- a/cross-alpha-binutils.spec +++ b/cross-alpha-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-arm-binutils.changes b/cross-arm-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-arm-binutils.changes +++ b/cross-arm-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-arm-binutils.spec b/cross-arm-binutils.spec index 893f245..8d2786d 100644 --- a/cross-arm-binutils.spec +++ b/cross-arm-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-avr-binutils.changes b/cross-avr-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-avr-binutils.changes +++ b/cross-avr-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-avr-binutils.spec b/cross-avr-binutils.spec index 9233f10..b237e08 100644 --- a/cross-avr-binutils.spec +++ b/cross-avr-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-hppa-binutils.changes b/cross-hppa-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-hppa-binutils.changes +++ b/cross-hppa-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-hppa-binutils.spec b/cross-hppa-binutils.spec index 9d32893..7cbdc49 100644 --- a/cross-hppa-binutils.spec +++ b/cross-hppa-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-hppa64-binutils.changes b/cross-hppa64-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-hppa64-binutils.changes +++ b/cross-hppa64-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-hppa64-binutils.spec b/cross-hppa64-binutils.spec index 0404762..10d7488 100644 --- a/cross-hppa64-binutils.spec +++ b/cross-hppa64-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-i386-binutils.changes b/cross-i386-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-i386-binutils.changes +++ b/cross-i386-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-i386-binutils.spec b/cross-i386-binutils.spec index 2500dc6..5580bae 100644 --- a/cross-i386-binutils.spec +++ b/cross-i386-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-ia64-binutils.changes b/cross-ia64-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-ia64-binutils.changes +++ b/cross-ia64-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-ia64-binutils.spec b/cross-ia64-binutils.spec index de31c98..397936a 100644 --- a/cross-ia64-binutils.spec +++ b/cross-ia64-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-mips-binutils.changes b/cross-mips-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-mips-binutils.changes +++ b/cross-mips-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-mips-binutils.spec b/cross-mips-binutils.spec index 1709633..cba6dc4 100644 --- a/cross-mips-binutils.spec +++ b/cross-mips-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-ppc-binutils.changes b/cross-ppc-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-ppc-binutils.changes +++ b/cross-ppc-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-ppc-binutils.spec b/cross-ppc-binutils.spec index 23a86d9..63914f4 100644 --- a/cross-ppc-binutils.spec +++ b/cross-ppc-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-ppc64-binutils.changes b/cross-ppc64-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-ppc64-binutils.changes +++ b/cross-ppc64-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-ppc64-binutils.spec b/cross-ppc64-binutils.spec index 51470bd..f64e1e3 100644 --- a/cross-ppc64-binutils.spec +++ b/cross-ppc64-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-s390-binutils.changes b/cross-s390-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-s390-binutils.changes +++ b/cross-s390-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-s390-binutils.spec b/cross-s390-binutils.spec index 5b54eaa..6d532b9 100644 --- a/cross-s390-binutils.spec +++ b/cross-s390-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-s390x-binutils.changes b/cross-s390x-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-s390x-binutils.changes +++ b/cross-s390x-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-s390x-binutils.spec b/cross-s390x-binutils.spec index adeea98..7bf37c1 100644 --- a/cross-s390x-binutils.spec +++ b/cross-s390x-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-sparc-binutils.changes b/cross-sparc-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-sparc-binutils.changes +++ b/cross-sparc-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-sparc-binutils.spec b/cross-sparc-binutils.spec index 4b07f37..e526b73 100644 --- a/cross-sparc-binutils.spec +++ b/cross-sparc-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-sparc64-binutils.changes b/cross-sparc64-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-sparc64-binutils.changes +++ b/cross-sparc64-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-sparc64-binutils.spec b/cross-sparc64-binutils.spec index b1ad074..32995cc 100644 --- a/cross-sparc64-binutils.spec +++ b/cross-sparc64-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-spu-binutils.changes b/cross-spu-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-spu-binutils.changes +++ b/cross-spu-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-spu-binutils.spec b/cross-spu-binutils.spec index 1ea359c..7be1739 100644 --- a/cross-spu-binutils.spec +++ b/cross-spu-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold diff --git a/cross-x86_64-binutils.changes b/cross-x86_64-binutils.changes index 3c76568..57e63b6 100644 --- a/cross-x86_64-binutils.changes +++ b/cross-x86_64-binutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 27 15:30:41 UTC 2012 - jengelh@inai.de + +- Implement update-alternatives service for gold + ------------------------------------------------------------------- Tue Nov 27 12:44:19 UTC 2012 - adrian@suse.de diff --git a/cross-x86_64-binutils.spec b/cross-x86_64-binutils.spec index 83cc319..a2bea6a 100644 --- a/cross-x86_64-binutils.spec +++ b/cross-x86_64-binutils.spec @@ -101,6 +101,7 @@ Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch101: aarch64-biarch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: update-alternatives %description C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, @@ -113,6 +114,7 @@ Summary: The gold linker License: GPL-3.0+ Group: Development/Tools/Building Requires: binutils = %{version}-%{release} +PreReq: update-alternatives %if 0%{suse_version} > 1100 %if 0%{!?cross:1} %define gold_archs %ix86 %arm x86_64 ppc ppc64 %sparc @@ -124,7 +126,6 @@ gold is an ELF linker. It is intended to have complete support for ELF and to run as fast as possible on modern systems. For normal use it is a drop-in replacement for the older GNU linker. - %package devel Summary: GNU binutils (BFD development files) License: GPL-3.0+ @@ -315,10 +316,14 @@ make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes # we could eventually use alternatives for /usr/bin/ld -if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then - rm $RPM_BUILD_ROOT%{_bindir}/ld - ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld; +if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then + mv "%buildroot/%_bindir"/{ld,ld.bfd}; +else + rm -f "%buildroot/%_bindir/ld"; fi +mkdir -p "%buildroot/%_sysconfdir/alternatives"; +ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"; +ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld"; rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin @@ -371,23 +376,37 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt > ../binutils.lang %endif -%clean -rm -rf $RPM_BUILD_ROOT - %if 0%{!?cross:1} %post +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.bfd" 1 %install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz +%post gold +"%_sbindir/update-alternatives" --install \ + "%_bindir/ld" ld "%_bindir/ld.gold" 2 + %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + +%preun +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; +fi; + +%preun gold +if [ "$1" = 0 ]; then + "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; +fi; + %endif %files -f binutils.lang @@ -398,6 +417,7 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* +%ghost %_sysconfdir/alternatives/ld %ifarch %gold_archs %exclude %{_bindir}/gold %exclude %{_bindir}/ld.gold