Reconstruct the Debug Package Generation Mode:

The default debuginfo management mechanism is not deleted.
  Instead, Use the default macro of RPM.
  /usr/lib/rpm/openEuler/macros defines:
  """
  %install% {?_Enable Debug Package:% {?Build subdirectory:% {debug package}\
  %%Install\
  %{nil}
  """
  There are two changes:
  1. The source files in /usr/src are
  correctly packed into the debugging source.
  2. The debugging file contains the glibc version number.
  The CI detects the file change. However, I think this is caused by the CI.

Signed-off-by: Yang Yanchao <yangyanchao6@huawei.com>
(cherry picked from commit 962ab381cb348507eef59878a6ce56b4203b59ce)
This commit is contained in:
Yang Yanchao 2022-01-27 17:45:39 +08:00 committed by openeuler-sync-bot
parent 2dc1a46a01
commit facbb7dec1

View File

@ -66,7 +66,7 @@
##############################################################################
Name: glibc
Version: 2.34
Release: 49
Release: 50
Summary: The GNU libc libraries
License: %{all_license}
URL: http://www.gnu.org/software/glibc/
@ -437,39 +437,6 @@ Obsoletes: %{name}-utils = 2.28
This package provides memusage, a memory usage profiler, mtrace, a memory leak
tracer and xtrace, a function call tracer, all of which is not necessory for you.
##############################################################################
# glibc debuginfo sub-package
##############################################################################
%if 0%{?_enable_debug_packages}
%define debug_package %{nil}
%define __debug_install_post %{nil}
%global __debug_package 1
%undefine _debugsource_packages
%undefine _debuginfo_subpackages
%undefine _unique_debug_names
%undefine _unique_debug_srcs
%package debuginfo
Summary: Debug information for %{name}
AutoReqProv: no
%description debuginfo
This package provides debug information for package %{name}.
Debug information is useful when developing applications that use this
package or when debugging this package.
%package debugsource
Summary: Debug source for %{name}
AutoReqProv: no
%description debugsource
This package provides debug sources for package %{name}.
Debug sources are useful when developing applications that use this
package or when debugging this package.
%endif # 0%{?_enable_debug_packages}
##############################################################################
# glibc help sub-package
##############################################################################
@ -696,14 +663,6 @@ truncate -s 0 $RPM_BUILD_ROOT/etc/gai.conf
truncate -s 0 $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache
chmod 644 $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache
# Install debug copies of unstripped static libraries
%if 0%{?_enable_debug_packages}
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}
cp -a $RPM_BUILD_ROOT%{_libdir}/*.a \
$RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/
rm -f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/*_p.a
%endif
# Remove any zoneinfo files; they are maintained by tzdata.
rm -rf $RPM_BUILD_ROOT%{_prefix}/share/zoneinfo
@ -787,7 +746,6 @@ touch nss-devel.filelist
touch libnsl.filelist
touch debugutils.filelist
touch benchtests.filelist
touch debuginfo.filelist
%if %{with compat_2_17}
touch compat-2.17.filelist
%endif
@ -956,59 +914,6 @@ echo "%{_prefix}/libexec/glibc-benchtests/validate_benchout.py*" >> benchtests.f
echo "%{_libdir}/libpthread-2.17.so" >> compat-2.17.filelist
%endif
%if 0%{?_enable_debug_packages}
##############################################################################
# glibc debuginfo sub-package
##############################################################################
touch debuginfo_additional.filelist
find_debuginfo_args='--strict-build-id -i'
%ifarch %{x86_arches}
find_debuginfo_args="$find_debuginfo_args \
-l common.filelist \
-l debugutils.filelist \
-l nscd.filelist \
-p '.*/(sbin|libexec)/.*' \
-o debuginfo_additional.filelist \
-l nss_modules.filelist \
-l libnsl.filelist \
-l glibc.filelist \
%if %{with benchtests}
-l benchtests.filelist
%endif
%if %{with compat_2_17}
-l compat-2.17.filelist \
%endif
"
%endif
if command -v find-debuginfo >/dev/null ; then
find_debuginfo=find-debuginfo
else
find_debuginfo=/usr/lib/rpm/find-debuginfo.sh
fi
$find_debuginfo $find_debuginfo_args -o debuginfo.filelist
%ifarch %{x86_arches}
sed -i '\#^$RPM_BUILD_ROOT%{_prefix}/src/debug/#d' debuginfo_additional.filelist
cat debuginfo_additional.filelist >> debuginfo.filelist
find $RPM_BUILD_ROOT%{_prefix}/src/debug \
\( -type d -printf '%%%%dir ' \) , \
-printf '%{_prefix}/src/debug/%%P\n' >> debuginfo.filelist
add_dir=%{_prefix}/lib/debug%{_libdir}
find $RPM_BUILD_ROOT$add_dir -name "*.a" -printf "$add_dir/%%P\n" >> debuginfo.filelist
%endif # %{x86_arches}
remove_dir="%{_prefix}/src/debug"
remove_dir="$remove_dir $(echo %{_prefix}/lib/debug{,/%{_lib},/bin,/sbin})"
remove_dir="$remove_dir $(echo %{_prefix}/lib/debug%{_prefix}{,/%{_lib},/libexec,/bin,/sbin})"
for d in $(echo $remove_dir | sed 's/ /\n/g'); do
sed -i "\|^%%dir $d/\?$|d" debuginfo.filelist
done
%endif # 0%{?_enable_debug_packages}
##############################################################################
# Run the glibc testsuite
##############################################################################
@ -1359,13 +1264,6 @@ fi
%files -f benchtests.filelist benchtests
%endif
%if 0%{?_enable_debug_packages}
%files -f debuginfo.filelist debuginfo
%files debugsource
%endif
%files help
#Doc of glibc package
%doc README NEWS INSTALL elf/rtld-debugger-interface.txt
@ -1380,6 +1278,14 @@ fi
%endif
%changelog
* Fri Jan 28 2022 Yang Yanchao <yangyanchao6@huawei.com> - 2.34-50
- The default debuginfo management mechanism is deleted.
Instead, Use the default macro of RPM.
There are two changes:
1. The source files in /usr/src are
correctly packed into the glibc-debugsource.
2. The debugging file contains the glibc version number.
* Fri Jan 28 2022 Lv Ying <lvying6@huawei.com> - 2.34-49
- fix CVE-2019-1010023