From f5cee9dd423e9786251c12c8ba2e929c00f4a6a5 Mon Sep 17 00:00:00 2001 From: Tie Liu Date: Tue, 11 Jul 2023 19:52:17 +0800 Subject: [PATCH] Generate available relocations for sysboost --- ncurses.spec | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/ncurses.spec b/ncurses.spec index 006b8dd..23e9d39 100644 --- a/ncurses.spec +++ b/ncurses.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: ncurses Version: 6.4 -Release: 4 +Release: 5 Summary: Terminal control library License: MIT URL: https://invisible-island.net/ncurses/ncurses.html @@ -90,6 +98,16 @@ Requires: %{name} = %{version}-%{release} This package contains development documentation, manuals for interface function, and related documents. +%if %{?ENABLE_RELOC} +%package relocation +Summary: Relocations for %{name} +Requires: %{name}-libs = %{version}-%{release} +BuildRequires: native-turbo-tools + +%description relocation +Relocations for %{name} +%endif + %prep %autosetup -n %{name}-%{version} -p1 @@ -126,7 +144,7 @@ for abi in 5 6; do [ $abi = 5 ] && echo $abi5_options [ $char = widec ] && echo --enable-widec [ $progs = yes ] || echo --without-progs - ) + ) LDFLAGS="%{?ldflags_options}" %make_build libs [ $progs = yes ] && %make_build -C progs @@ -134,6 +152,10 @@ for abi in 5 6; do popd done done +%if %{?ENABLE_RELOC} +objreloc widec6/lib/libtinfo.so.%{version} +mv -f widec6/lib/libtinfo.so.%{version}.relocation ${RPM_BUILD_DIR}/libtinfo.so.%{version}.relocation +%endif %install make -C narrowc5 DESTDIR=$RPM_BUILD_ROOT install.libs @@ -143,6 +165,12 @@ make -C narrowc6 DESTDIR=$RPM_BUILD_ROOT install.libs rm ${RPM_BUILD_ROOT}%{_libdir}/lib{tic,tinfo}.so.6* make -C widec6 DESTDIR=$RPM_BUILD_ROOT install.{libs,progs,data,includes,man} +%if %{?ENABLE_RELOC} +mkdir -p ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir} +mv ${RPM_BUILD_DIR}/libtinfo.so.%{version}.relocation ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir}/libtinfo.so.%{version}.relocation +chmod 400 ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir}libtinfo.so.%{version}.relocation +%endif + chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/lib*.so.*.* chmod 644 ${RPM_BUILD_ROOT}%{_libdir}/lib*.a @@ -247,7 +275,18 @@ xz NEWS %{_mandir}/man5/* %{_mandir}/man7/* +%if %{?ENABLE_RELOC} +%files relocation +/usr/lib/relocation/%{_libdir}libtinfo.so.%{version}.relocation +%endif + %changelog +* Tue Jul 11 2023 liutie - 6.4-5 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: Generate the relocation subpackage + * Tue Jul 04 2023 yanglu - 6.4-4 - Type:bugfix - CVE:NA -- Gitee