Eliminate duplicates between sub-packages and add missing shared libraries.

Resolves: #2149646
This commit is contained in:
Nick Clifton 2022-12-07 15:54:58 +00:00
parent 58a5caed03
commit 0f14bb08c8
1 changed files with 36 additions and 26 deletions

View File

@ -2,7 +2,7 @@
Summary: A GNU collection of binary utilities
Name: binutils%{?_with_debug:-debug}
Version: 2.35.2
Release: 28%{?dist}
Release: 29%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -564,6 +564,9 @@ Conflicts: gcc-c++ < 4.0.0
#----------------------------------------------------------------------------
%if %{with crossbuilds}
# Only undefine with_testsuite here when testing changes to the spec file.
# %%undefine with_testsuite
%global cross_targets aarch64-redhat-linux ppc64le-redhat-linux s390x-redhat-linux x86_64-redhat-linux
%package -n cross-binutils-aarch64
@ -809,7 +812,9 @@ build()
esac
if test x$native == x1 ; then
SARGS="--with-sysroot=/ --prefix=%{_prefix}"
SARGS="--with-sysroot=/ \
--prefix=%{_prefix} \
--libdir=%{_libdir}"
else
TARGS=""
SARGS="--with-sysroot=%{_prefix}/$target/sys-root \
@ -824,7 +829,7 @@ build()
fi
../configure --target=$target $SARGS $RARGS $CARGS $TARGS || cat config.log
%if %{with docs}
# Because of parallel building, info has to be made after all.
%make_build %{_smp_mflags} tooldir=%{_prefix} all
@ -949,7 +954,7 @@ install_binutils()
local local_root=%{buildroot}/usr
local local_bindir=$local_root/bin
local local_libdir=$local_root/lib64
local local_libdir=%{buildroot}%{_libdir}
local local_mandir=$local_root/share/man/man1
local local_incdir=$local_root/include
local local_infodir=$local_root/share/info
@ -964,15 +969,13 @@ install_binutils()
pushd build-$target
%if %{with docs}
%make_install
%else
%make_install MAKEINFO=true
%endif
if test x$native == x1 ; then
%if %{with docs}
make infodir=$local_infodir install-info
%make_install DESTDIR=%{buildroot}
make prefix=%{buildroot}%{_prefix} infodir=$local_infodir install-info
%else
%make_install DESTDIR=%{buildroot} MAKEINFO=true
%endif
# Rebuild libiberty.a with -fPIC.
@ -1005,6 +1008,10 @@ install_binutils()
rm -f $local_infodir/{as,bfd,binutils,gprof,ld}*
%endif
%if %{enable_shared}
chmod +x $local_libdir/lib*.so*
%endif
# Prevent programs from linking against libbfd and libopcodes
# dynamically, as they are changed far too often.
rm -f $local_libdir/lib{bfd,opcodes}.so
@ -1058,7 +1065,13 @@ INPUT ( %{_libdir}/libopcodes.a -lbfd )
EOH
rm -fr $local_root/$target
else
else # CROSS BUILDS
local target_root=$local_root/$target
%make_install DESTDIR=%{buildroot} MAKEINFO=true
# For cross-binutils we drop the documentation.
rm -rf $local_infodir/$target
rm -rf $local_mandir/$target
@ -1067,12 +1080,14 @@ EOH
# Remove libtool files, which reference the .so libs
rm -f $local_libdir/lib{bfd,opcodes}.la
install $local_root/$target/bin/$target-ld.* $local_bindir
install $local_root/$target/bin/$target-[!l]* $local_bindir
rm $local_root/$target/bin/$target-*
mv $local_root/$target $local_root/fred
mv $local_root/fred/$target $local_root/$target
mv $local_root/fred/share $local_root/$target/share
install $target_root/bin/$target-ld.* $local_bindir
install $target_root/bin/$target-[!l]* $local_bindir
rm $target_root/bin/$target-*
# Also install the binaries into the sysroot.
mv $target_root $local_root/fred
mv $local_root/fred/$target $target_root
mv $local_root/fred/share $target_root/share
rm -fr $local_root/fred
fi
@ -1183,14 +1198,6 @@ exit 0
%endif
%endif
%if "%{_target_platform}" == "x86_64-redhat-linux"
/usr/lib/l*
%elif "%{_target_platform}" == "i686-redhat-linux"
/usr/lib64/l*
%else
%exclude /usr/lib/*
%endif
%license COPYING COPYING3 COPYING3.LIB COPYING.LIB
%doc README
%{_bindir}/[!l]*
@ -1254,6 +1261,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Wed Dec 07 2022 Nick Clifton <nickc@redhat.com> - 2.35.2-29
- Eliminate duplicates between sub-packages and add missing shared libraries. (#2149646)
* Wed Nov 30 2022 Nick Clifton <nickc@redhat.com> - 2.35.2-28
- Eliminate duplicates between sub-packages. (#2149646)