Added macro _openssldir = /etc/pki/tls for repository-wide consistency of this directory

This commit is contained in:
Mikhail Novosyolov 2018-12-24 23:18:17 +03:00
parent 3d8cbe74da
commit c05b494a7e
2 changed files with 15 additions and 1 deletions

1
openssl.macros Normal file
View file

@ -0,0 +1 @@
%_openssldir @OPENSSLDIR@

View file

@ -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