diff --git a/openssl.spec b/openssl.spec index 5df90b100a4e60af0579d4873d498a10c1cbd0e7..cfeadd0939ef811340e6be314cc6723e5792823e 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