diff --git a/openssl.macros b/openssl.macros new file mode 100644 index 0000000..08db08c --- /dev/null +++ b/openssl.macros @@ -0,0 +1 @@ +%_openssldir @OPENSSLDIR@ diff --git a/openssl.spec b/openssl.spec index b5532c3..4b9c438 100644 --- a/openssl.spec +++ b/openssl.spec @@ -18,12 +18,16 @@ %define with_krb5 %{?_with_krb5:1}%{!?_with_krb5:0} +# This directory is defined in /usr/bin/openssl-config and /etc/rpm/macros.d/openssl.macros +# during the build. +# The purpose is a system-wide definition of this directory +# to guarantee consistency across the whole repository. %define openssldir %{_sysconfdir}/pki/tls Summary: Secure Sockets Layer communications libs & utils Name: openssl Version: 1.0.2q -Release: 3 +Release: 4 License: BSD-like Group: System/Libraries Url: https://www.openssl.org @@ -33,6 +37,7 @@ Source2: Makefile.certificate Source3: make-dummy-cert Source4: openssl-thread-test.c Source5: openssl-config +Source6: openssl.macros # Based on https://github.com/gost-engine/engine # Never remove gost-engine patches Patch0: openssl-1.0.2l-gost-engine.patch @@ -164,6 +169,7 @@ and SSL. %{_libdir}/libssl.so %{_mandir}/man3/* %{_libdir}/pkgconfig/* +%{_sys_macros_dir}/openssl.macros #---------------------------------------------------------------------------- @@ -396,3 +402,10 @@ sed -i %{buildroot}/%{_bindir}/openssl-config \ -e "s#@LDFLAGS@#%{ldflags}#g" # test openssl-config [ "$(%{buildroot}/%{_bindir}/openssl-config --openssldir)" = '%{openssldir}' ] + +# make and install openssl.macros +install -d -m0755 %{buildroot}/%{_sys_macros_dir} +cat %{SOURCE6} | sed -e "s#@OPENSSLDIR@#%{openssldir}#g" > %{buildroot}/%{_sys_macros_dir}/openssl.macros +chmod 0644 %{buildroot}/%{_sys_macros_dir}/openssl.macros +# verify openssl.macros +grep -q '%{openssldir}' %{buildroot}%{_sys_macros_dir}/openssl.macros