From 2f0148ba548eeedb676e2d22fb62ec66860b540a Mon Sep 17 00:00:00 2001 From: liuyuntao Date: Fri, 15 Sep 2023 14:51:48 +0800 Subject: [PATCH] add subpackage openssl-relocation --- openssl.spec | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/openssl.spec b/openssl.spec index 5df90b1..cfeadd0 100644 --- a/openssl.spec +++ b/openssl.spec @@ -1,8 +1,10 @@ +%global ENABLE_RLOC 1 +%define _find_debuginfo_opts -strip_a %define soversion 3 Name: openssl Epoch: 1 Version: 3.0.9 -Release: 4 +Release: 5 Summary: Cryptography and SSL/TLS Toolkit License: OpenSSL and SSLeay URL: https://www.openssl.org/ @@ -79,6 +81,16 @@ Requires: man info %description help Man pages and other related documents for %{name}. +%if %{?ENABLE_RLOC} +%package relocation +Summary: Relocation for %{name} +Requires: %{name} = %{version}-%{release} +BuildRequires: native-turbo-tools + +%description relocation +This package contains relocations for %{name}. +%endif + %prep %autosetup -n %{name}-%{version} -p1 @@ -107,7 +119,11 @@ RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wa,--noexecstack -Wa,--generate-missing-build-not -Wl,--allow-multiple-definition +%if %{?ENABLE_RLOC} +%make_build all LDFLAGS=-Wl,--emit-relocs +%else %make_build all +%endif %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT @@ -124,6 +140,13 @@ for lib in $RPM_BUILD_ROOT%{_libdir}/*.so.%{version} ; do ln -s -f `basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`.%{soversion} done +%if %{?ENABLE_RLOC} +mkdir -p ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir} +xz -k $(readlink -f $RPM_BUILD_ROOT%{_libdir}/libcrypto.so) +mv $(readlink -f $RPM_BUILD_ROOT%{_libdir}/libcrypto.so).xz $(readlink -f $RPM_BUILD_ROOT%{_libdir}/libcrypto.so).relocation +mv $RPM_BUILD_ROOT%{_libdir}/*.relocation ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir} +%endif + mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_pkgdocdir}/Makefile.certificate @@ -232,7 +255,16 @@ make test || : %ldconfig_scriptlets libs +%if %{?ENABLE_RLOC} +%files relocation +%defattr(400,root,root,-) +%attr(400, root, root) /usr/lib/relocation%{_libdir}/*.relocation +%endif + %changelog +* Fri Sep 15 2023 liuyuntao - 1:3.0.9-5 +- add subpackage openssl-relocation + * Wed Sep 13 2023 luhuaxin - 1:3.0.9-4 - Support decode SM2 parameters -- Gitee