From 1df0264c3825452983d66303be6088595a77f6a2 Mon Sep 17 00:00:00 2001 From: Tie Liu Date: Tue, 11 Jul 2023 16:33:28 +0800 Subject: [PATCH] Generate available relocations for sysboost --- bash.spec | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/bash.spec b/bash.spec index a662af5..33a33ad 100644 --- a/bash.spec +++ b/bash.spec @@ -1,6 +1,14 @@ +%if %{?openEuler:1}0 +%global ENABLE_RELOC 1 +%endif + +%if %{ENABLE_RELOC} +%global ldflags_options -Wl,--emit-relocs +%endif + Name: bash Version: 5.1.8 -Release: 8 +Release: 9 Summary: It is the Bourne Again Shell License: GPLv3 URL: https://www.gnu.org/software/bash @@ -61,6 +69,16 @@ Requires: pkgconf-pkg-config %description devel This package contains development files for %{name}. +%if %{?ENABLE_RELOC} +%package relocation +Summary: Relocations for %{name} +Requires: %{name} = %{version}-%{release} +BuildRequires: native-turbo-tools + +%description relocation +This package contains relocations for %{name}. +%endif + %package help Summary: Documents for %{name} Buildarch: noarch @@ -76,12 +94,16 @@ Man pages and other related documents for %{name}. %build autoconf -%configure --with-bash-malloc=no --with-afs +%configure --with-bash-malloc=no --with-afs LDFLAGS="%{?ldflags_options}" MFLAGS="CPPFLAGS=-D_GNU_SOURCE -DRECYCLES_PIDS -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"' `getconf LFS_CFLAGS`" make "$MFLAGS" version.h make "$MFLAGS" -C builtins %make_build "$MFLAGS" +%if %{?ENABLE_RELOC} +objreloc $RPM_BUILD_DIR/%{name}-%{version}/bash +%endif + %install %make_install install-headers ln -sf bash %{buildroot}%{_bindir}/sh @@ -90,6 +112,11 @@ install -pDm 644 %SOURCE2 %{buildroot}/etc/skel/.bash_profile install -pDm 644 %SOURCE3 %{buildroot}/etc/skel/.bash_logout install -pDm 644 ./configs/alias.sh %{buildroot}%{_sysconfdir}/profile.d/alias.sh +%if %{?ENABLE_RELOC} +mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/relocation/%{_bindir} +install -pDm 400 $RPM_BUILD_DIR/%{name}-%{version}/bash.relocation ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_bindir}/bash.relocation +%endif + # bug #820192, need to add execable alternatives for regular built-ins for ea in alias bg cd command fc fg getopts hash jobs read type ulimit umask unalias wait do @@ -113,6 +140,12 @@ make check %{_bindir}/{hash,getopts,jobs,read,type,ulimit,umask,unalias} %config(noreplace) %{_sysconfdir}/profile.d/alias.sh +%if %{ENABLE_RELOC} +%files relocation +%defattr(-,root,root) +/usr/lib/relocation/%{_bindir}/bash.relocation +%endif + %files devel %defattr(-,root,root) %{_includedir}/%{name} @@ -130,6 +163,12 @@ make check %exclude %{_infodir}/dir %changelog +* Tue Jul 11 2023 liutie -5.1.8-9 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: Generate available relocations for sysboost + * Thu Jun 15 2023 wangyuhang -5.1.8-8 - Type:bugfix - ID:NA -- Gitee