add relocation package for bash

This commit is contained in:
l00580197 2023-08-04 19:45:54 +08:00
parent 9037a4e811
commit e89369b273

View File

@ -1,3 +1,9 @@
%global ENABLE_RELOC 1
%if %{ENABLE_RELOC}
%global ldflags_options -Wl,--emit-relocs
%endif
Name: bash
Version: 5.2.15
Release: 1
@ -47,6 +53,16 @@ Requires: pkgconf-pkg-config
%description devel
This package contains development files for %{name}.
%if %{?ENABLE_RELOC}
%package relocation
Summary: Relocation 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
@ -62,12 +78,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
@ -75,6 +95,9 @@ install -pDm 644 %SOURCE1 %{buildroot}/etc/skel/.bashrc
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}
install -pD $RPM_BUILD_DIR/%{name}-%{version}/bash.relocation %{buildroot}%{_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
@ -99,6 +122,13 @@ make check
%{_bindir}/{hash,getopts,jobs,read,type,ulimit,umask,unalias}
%config(noreplace) %{_sysconfdir}/profile.d/alias.sh
%if %{?ENABLE_RELOC}
%files relocation
%defattr(400,root,root,-)
%dir %attr(500, root, root) %{_bindir}
%attr(400, root, root) %{_bindir}/bash.relocation
%endif
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}
@ -116,6 +146,12 @@ make check
%exclude %{_infodir}/dir
%changelog
* Fri Aug 4 2023 longwei <longwei27@huawei.com> -5.2.15-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:Add relocation package
* Mon Jul 17 2023 wangyuhang <wangyuhang27@huawei.com> -5.2.15-1
- Type:bugfix
- ID:NA