From a4ac78c3572fe235257fac211b1b6b5fe06d066b Mon Sep 17 00:00:00 2001 From: Tie Liu Date: Sat, 6 May 2023 16:54:43 +0800 Subject: [PATCH 1/2] Generate available relocations for sysboost --- ncurses.spec | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/ncurses.spec b/ncurses.spec index ab17351..af4a662 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -1,6 +1,8 @@ +%global ENABLE_RELOC 1 + Name: ncurses Version: 6.3 -Release: 6 +Release: 7 Summary: Terminal control library License: MIT URL: https://invisible-island.net/ncurses/ncurses.html @@ -24,10 +26,10 @@ Provides: %{name}-term = %{version}-%{release} Obsoletes: %{name}-term < %{version}-%{release} %description -The ncurses (new curses) library is a free software emulation of -curses in System V Release 4.0 (SVr4), and more. It uses terminfo -format, supports pads and color and multiple highlights and forms -characters and function-key mapping, and has all the other SVr4-curses +The ncurses (new curses) library is a free software emulation of +curses in System V Release 4.0 (SVr4), and more. It uses terminfo +format, supports pads and color and multiple highlights and forms +characters and function-key mapping, and has all the other SVr4-curses enhancements over BSD curses. SVr4 curses became the basis of X/Open Curses. %package base @@ -55,7 +57,7 @@ Obsoletes: libtermcap-devel < 2.0.8-48 %description devel The header files and libraries for developing applications that use -the ncurses terminal handling library.a, including static libraries +the ncurses terminal handling library.a, including static libraries of the ncurses library. %package compat-libs @@ -75,7 +77,7 @@ compatibility. %package static Summary: Static libraries for the ncurses library Requires: %{name}-devel = %{version}-%{release} - + %description static The ncurses-static package includes static libraries of the ncurses library. @@ -84,9 +86,19 @@ Summary: Ncurse help document Requires: %{name} = %{version}-%{release} %description help -This package contains development documentation, manuals +This package contains development documentation, manuals for interface function, and related documents. +%if %{?ENABLE_RELOC} +%package reloc +Summary: Relocations for %{name} +Requires: %{name}-libs = %{version}-%{release} +BuildRequires: sysboost-devel + +%description reloc +Relocations for %{name} +%endif + %prep %autosetup -n %{name}-%{version} -p1 @@ -123,7 +135,7 @@ for abi in 5 6; do [ $abi = 5 ] && echo $abi5_options [ $char = widec ] && echo --enable-widec [ $progs = yes ] || echo --without-progs - ) + ) LDFLAGS="-Wl,--emit-relocs" make %{?_smp_mflags} libs [ $progs = yes ] && make %{?_smp_mflags} -C progs @@ -140,6 +152,13 @@ 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} +objreloc ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3 +rm -rf ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3 +mv ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3.prim ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3 +mv ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3.relocation ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.relocation +%endif + chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/lib*.so.*.* chmod 644 ${RPM_BUILD_ROOT}%{_libdir}/lib*.a @@ -245,7 +264,18 @@ xz NEWS %{_mandir}/man5/* %{_mandir}/man7/* +%if %{?ENABLE_RELOC} +%files reloc +%{_libdir}/libtinfo.so.relocation +%endif + %changelog +* Mon May 8 2023 liutie - 6.3-7 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: Independently generate the objreloc tool + * Tue Feb 28 2023 zhujunhao - 6.3-6 - Type:bugfix - CVE:NA -- Gitee From b7dbd292c719abfa47aad0d28ff45d5a97553d4d Mon Sep 17 00:00:00 2001 From: Tie Liu Date: Fri, 19 May 2023 10:27:59 +0800 Subject: [PATCH 2/2] Ensure the consistency between BUILDID and relocation of the .so file --- ncurses.spec | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ncurses.spec b/ncurses.spec index af4a662..6e8bf43 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -2,7 +2,7 @@ Name: ncurses Version: 6.3 -Release: 7 +Release: 8 Summary: Terminal control library License: MIT URL: https://invisible-island.net/ncurses/ncurses.html @@ -90,12 +90,12 @@ This package contains development documentation, manuals for interface function, and related documents. %if %{?ENABLE_RELOC} -%package reloc +%package relocation Summary: Relocations for %{name} Requires: %{name}-libs = %{version}-%{release} BuildRequires: sysboost-devel -%description reloc +%description relocation Relocations for %{name} %endif @@ -154,9 +154,7 @@ make -C widec6 DESTDIR=$RPM_BUILD_ROOT install.{libs,progs,data,includes,man} %if %{?ENABLE_RELOC} objreloc ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3 -rm -rf ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3 -mv ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3.prim ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3 -mv ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3.relocation ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.relocation +rm -rf ${RPM_BUILD_ROOT}%{_libdir}/libtinfo.so.6.3.prim %endif chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/lib*.so.*.* @@ -265,11 +263,17 @@ xz NEWS %{_mandir}/man7/* %if %{?ENABLE_RELOC} -%files reloc -%{_libdir}/libtinfo.so.relocation +%files relocation +%{_libdir}/libtinfo.so.6.3.relocation %endif %changelog +* Mon May 8 2023 liutie - 6.3-8 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: Ensure the consistency between BUILDID and relocation of the .so file + * Mon May 8 2023 liutie - 6.3-7 - Type:enhancement - ID:NA -- Gitee