From a6b35242433347c2f556fc9627dadc1a61c77985 Mon Sep 17 00:00:00 2001 From: Tie Liu Date: Fri, 12 May 2023 16:57:53 +0800 Subject: [PATCH] Generate available relocations for sysboost --- ncurses.spec | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/ncurses.spec b/ncurses.spec index bba2c64..487b93b 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: 2 +Release: 3 Summary: Terminal control library License: MIT URL: https://invisible-island.net/ncurses/ncurses.html @@ -86,6 +94,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: sysboost-devel + +%description relocation +Relocations for %{name} +%endif + %prep %autosetup -n %{name}-%{version} -p1 @@ -122,7 +140,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 @@ -130,6 +148,9 @@ for abi in 5 6; do popd done done +%if %{?ENABLE_RELOC} +cp widec6/lib/libtinfo.so.%{version} ${RPM_BUILD_DIR}/libtinfo.so.%{version}.relocation +%endif %install make -C narrowc5 DESTDIR=$RPM_BUILD_ROOT install.libs @@ -139,6 +160,11 @@ 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}%{_libdir}/sysboost +mv ${RPM_BUILD_DIR}/libtinfo.so.%{version}.relocation $RPM_BUILD_ROOT%{_libdir}/sysboost/libtinfo.so.%{version}.relocation +%endif + chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/lib*.so.*.* chmod 644 ${RPM_BUILD_ROOT}%{_libdir}/lib*.a @@ -243,7 +269,18 @@ xz NEWS %{_mandir}/man5/* %{_mandir}/man7/* +%if %{?ENABLE_RELOC} +%files relocation +%{_libdir}/sysboost/libtinfo.so.%{version}.relocation +%endif + %changelog +* Mon May 8 2023 liutie - 6.4-3 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: Independently generate the objreloc tool + * Tue Feb 28 2023 zhujunhao - 6.4-2 - Type:requirement - CVE:NA -- Gitee