Update to 1.1.1j, rewrite spec, move to optdir

This commit is contained in:
Sergey Zhemoitel 2021-03-04 14:22:11 +03:00
parent 1b9f823aae
commit 793d810148
3 changed files with 156 additions and 103 deletions

View file

@ -1,2 +1,3 @@
sources: sources:
openssl-1.1.1g.tar.gz: b213a293f2127ec3e323fb3cfc0c9807664fd997 openssl-1.1.1g.tar.gz: b213a293f2127ec3e323fb3cfc0c9807664fd997
openssl-1.1.1j.tar.gz: 04c340b086828eecff9df06dceff196790bb9268

View file

@ -2,3 +2,5 @@
addFilter("W: manpage-not-compressed.*.html") addFilter("W: manpage-not-compressed.*.html")
# for rpm5 platforms # for rpm5 platforms
addFilter("E: description-line-too-long") addFilter("E: description-line-too-long")
addFilter("E: dir-or-file-in-opt")
addFilter("E: compressed-symlink-with-wrong-ext")

View file

@ -1,3 +1,4 @@
%define oname openssl
%define major 1.1 %define major 1.1
%define engines_name %mklibname openssl-engines %{major} %define engines_name %mklibname openssl-engines %{major}
%define libcrypto %mklibname crypto %{major} %define libcrypto %mklibname crypto %{major}
@ -5,6 +6,9 @@
%define openssl_engines_dir %{_libdir}/engines-%{major} %define openssl_engines_dir %{_libdir}/engines-%{major}
%define _optdir /opt
%define _docs %{expand: %define _docs %{expand:
%doc AUTHORS \ %doc AUTHORS \
%doc CHANGES \ %doc CHANGES \
@ -16,14 +20,15 @@
} }
Summary: OpenSSL 1.1 for platforms with OpenSSL 1.0 as the main version of OpenSSL Summary: OpenSSL 1.1 for platforms with OpenSSL 1.0 as the main version of OpenSSL
Name: openssl1.1 Name: %{oname}%{major}
Version: 1.1.1g Version: 1.1.1j
Release: 1 Release: 1
License: OpenSSL License: OpenSSL
Group: System/Libraries Group: System/Libraries
Url: https://www.openssl.org URL: https://www.openssl.org
Source0: ftp://ftp.openssl.org/source/openssl-%{version}.tar.gz Source0: https://ftp.openssl.org/source/%{oname}-%{version}.tar.gz
Source1: %{name}.rpmlintrc Source1: fixsimlink.sh
Source1000: %{name}.rpmlintrc
Source4: openssl-thread-test.c Source4: openssl-thread-test.c
Patch1: openssl-alt-e2k-makecontext.patch Patch1: openssl-alt-e2k-makecontext.patch
BuildRequires: bc BuildRequires: bc
@ -60,54 +65,85 @@ This is OpenSSL 1.1 for platforms with OpenSSL 1.0 as the main version of OpenSS
%files %files
%_docs %_docs
%attr(0755,root,root) %{_bindir}/%{name} #attr(0755,root,root) %{_bindir}/%{name}
%{_mandir}/man[157]/%{name}_* #{_mandir}/man[157]/%{name}_*
%{_mandir}/man1/%{name}.1* #{_mandir}/man1/%{name}.1*
%{_defaultdocdir}/openssl/html/man[157] #{_defaultdocdir}/openssl/html/man[157]
%{_bindir}/%{name}
%{_optdir}/%{name}/bin
%{_optdir}/%{name}/lib/*.so.*
%{_optdir}/%{name}/lib/engines-%{major}/*
%{_optdir}/%{name}/ssl/*
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
%package -n %{engines_name} %package devel
Summary: Engines for %{name} Summary: Development files for openssl1.1
Group: System/Libraries
Provides: %{name}-engines = %{EVRD}
%description -n %{engines_name} %description devel
This package provides engines for openssl. Development files for openssl1.1
%files -n %{engines_name} %files devel
%_docs %_docs
%attr(0755,root,root) %dir %{openssl_engines_dir}/ %{_optdir}/%{name}/include
%attr(0755,root,root) %{openssl_engines_dir}/*.so %{_optdir}/%{name}/lib/*.so
%{_optdir}/%{name}/lib/pkgconfig/*.pc
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
%package -n %{libcrypto} %package docs
Summary: Secure Sockets Layer communications libs Summary: Documentation for openssl1.1
Group: System/Libraries
Requires: %{libssl} = %{EVRD}
%description -n %{libcrypto} %description docs
The libraries files are needed for various cryptographic algorithms Documentation for openssl1.1
and protocols, including DES, RC4, RSA and SSL.
%files -n %{libcrypto} %files docs
%_docs %{_optdir}/%{name}/share/doc/*
%{_libdir}/libcrypto.so.%{major}* %{_optdir}/%{name}/share/man/*
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
%package -n %{libssl} #%package -n %{engines_name}
Summary: Secure Sockets Layer communications libs #Summary: Engines for %{name}
Group: System/Libraries #Group: System/Libraries
#Provides: %{name}-engines = %{EVRD}
%description -n %{libssl} #description -n %{engines_name}
The libraries files are needed for various cryptographic algorithms #This package provides engines for openssl.
and protocols, including DES, RC4, RSA and SSL.
%files -n %{libssl} #files -n %{engines_name}
%_docs #_docs
%{_libdir}/libssl.so.%{major}* #attr(0755,root,root) %dir %{openssl_engines_dir}/
#attr(0755,root,root) %{openssl_engines_dir}/*.so
#----------------------------------------------------------------------------
#package -n %{libcrypto}
#Summary: Secure Sockets Layer communications libs
#Group: System/Libraries
#Requires: %{libssl} = %{EVRD}
#description -n %{libcrypto}
#The libraries files are needed for various cryptographic algorithms
#and protocols, including DES, RC4, RSA and SSL.
#files -n %{libcrypto}
#_docs
#{_libdir}/libcrypto.so.%{major}*
#----------------------------------------------------------------------------
#package -n %{libssl}
#Summary: Secure Sockets Layer communications libs
#Group: System/Libraries
#description -n %{libssl}
#The libraries files are needed for various cryptographic algorithms
#and protocols, including DES, RC4, RSA and SSL.
#files -n %{libssl}
#_docs
#{_libdir}/libssl.so.%{major}*
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -116,6 +152,8 @@ and protocols, including DES, RC4, RSA and SSL.
cp %{SOURCE4} openssl-thread-test.c cp %{SOURCE4} openssl-thread-test.c
chmod +x %{SOURCE1}
%build %build
# In rosa2016.1: /usr/bin/ld: crypto/bio/bio_cb.o: relocation R_X86_64_PC32 against undefined symbol # In rosa2016.1: /usr/bin/ld: crypto/bio/bio_cb.o: relocation R_X86_64_PC32 against undefined symbol
@ -152,9 +190,7 @@ sslarch=linux-generic64
# usable on all platforms. The Configure script already knows to use -fPIC and # usable on all platforms. The Configure script already knows to use -fPIC and
# RPM_OPT_FLAGS, so we can skip specifiying them here. # RPM_OPT_FLAGS, so we can skip specifiying them here.
./Configure \ ./Configure \
--prefix=%{_prefix} \ --prefix=%{_optdir}/%{name} \
--libdir=%{_libdir} \
--openssldir=%{_openssldir} \
${sslflags} \ ${sslflags} \
enable-camellia \ enable-camellia \
enable-cms \ enable-cms \
@ -172,6 +208,10 @@ sslarch=linux-generic64
shared \ shared \
${sslarch} ${sslarch}
# --libdir=%{_libdir} \
# --openssldir=%{_openssldir} \
%make all %make all
%check %check
@ -199,73 +239,83 @@ make test
%install %install
%makeinstall_std %makeinstall_std
( cd %{buildroot}%{_bindir} #( cd %{buildroot}%{_bindir}
mv openssl openssl%{major} # mv openssl openssl%{major}
) #)
# Based on libressl, rename mans xxx.N to openssl1.1_xxx.N # Based on libressl, rename mans xxx.N to openssl1.1_xxx.N
for i in $(seq 1 8) #for i in $(seq 1 8)
do #do
man_dir="%{buildroot}%{_mandir}/man${i}" # man_dir="%{buildroot}%{_mandir}/man${i}"
if [ ! -d "$man_dir" ]; then continue; fi # if [ ! -d "$man_dir" ]; then continue; fi
( cd "$man_dir" # ( cd "$man_dir"
grep -Irl '/etc/ssl' . | xargs sed -i 's,/etc/ssl,%{_openssldir},g' || : # grep -Irl '/etc/ssl' . | xargs sed -i 's,/etc/ssl,%{_openssldir},g' || :
if find . -name '%{name}_*' | grep -q '.' ; then # if find . -name '%{name}_*' | grep -q '.' ; then
echo 'Rewrite spec because upstream %{name}_* manpages appeared!' # echo 'Rewrite spec because upstream %{name}_* manpages appeared!'
exit 1 # exit 1
fi # fi
# Make all man pages with potentially the same names as in OpenSSL # # Make all man pages with potentially the same names as in OpenSSL
# be avaialble in standard man directories, but prevent conflicts with OpenSSL # # be avaialble in standard man directories, but prevent conflicts with OpenSSL
for openssl_manpage in $(ls -1v | grep -vE '^OPENSSL_|^openssl\.') ; do # for openssl_manpage in $(ls -1v | grep -vE '^OPENSSL_|^openssl\.') ; do
openssl_LibreSSL_manpage="%{name}_${openssl_manpage}" # openssl_LibreSSL_manpage="%{name}_${openssl_manpage}"
mv -v "$openssl_manpage" "$openssl_LibreSSL_manpage" # mv -v "$openssl_manpage" "$openssl_LibreSSL_manpage"
done # done
for openssl_manpage in $(ls -1v | grep '^openssl\.') ; do # for openssl_manpage in $(ls -1v | grep '^openssl\.') ; do
openssl_LibreSSL_manpage="$(echo "$openssl_manpage" | sed -e 's,openssl,%{name},g')" # openssl_LibreSSL_manpage="$(echo "$openssl_manpage" | sed -e 's,openssl,%{name},g')"
mv -v "$openssl_manpage" "$openssl_LibreSSL_manpage" # mv -v "$openssl_manpage" "$openssl_LibreSSL_manpage"
done # done
# relink symlinks # # relink symlinks
error=0 # error=0
for i in * # for i in *
do # do
if [ ! -L "$i" ]; then continue; fi # if [ ! -L "$i" ]; then continue; fi
realpath="$(realpath "$i")" # realpath="$(realpath "$i")"
if [ ! -e "$realpath"; then # if [ ! -e "$realpath"; then
if echo "$realpath" | grep -q '/openssl_' # if echo "$realpath" | grep -q '/openssl_'
then new_dest="$(echo "$realpath" | sed -e 's,/openssl_,/%{name}_,g')" # then new_dest="$(echo "$realpath" | sed -e 's,/openssl_,/%{name}_,g')"
else new_dest="%{name}_$(echo "$realpath" | awk -F '/' '{print $NF}')" # else new_dest="%{name}_$(echo "$realpath" | awk -F '/' '{print $NF}')"
fi # fi
if [ ! -e "$new_dest" ]; then # if [ ! -e "$new_dest" ]; then
list_not_e="${list_not_e}\n${new_dest}" # list_not_e="${list_not_e}\n${new_dest}"
error=1 # error=1
fi # fi
rm -fv "$i" # rm -fv "$i"
ln -s "$new_dest" "$i" # ln -s "$new_dest" "$i"
fi # fi
done # done
if [ "$error" != 0 ]; then # if [ "$error" != 0 ]; then
echo "Not existing destinations: ${list_not_e}" # echo "Not existing destinations: ${list_not_e}"
exit 1 # exit 1
fi # fi
) # )
done #done
# strip cannot touch these unless 755 # strip cannot touch these unless 755
chmod 755 %{buildroot}%{openssl_engines_dir}/*.so* #chmod 755 %{buildroot}%{openssl_engines_dir}/*.so*
chmod 755 %{buildroot}%{_libdir}/*.so* #chmod 755 %{buildroot}%{_libdir}/*.so*
chmod 755 %{buildroot}%{_bindir}/* #chmod 755 %{buildroot}%{_bindir}/*
# Remove devel parts (openssl 1.0 is devel) # Remove devel parts (openssl 1.0 is devel)
( cd %{buildroot} #( cd %{buildroot}
rm -fvr \ # rm -fvr \
./%{_bindir}/c_rehash \ # ./%{_bindir}/c_rehash \
./%{_libdir}/*.so \ # ./%{_libdir}/*.so \
./%{_libdir}/*.a \ # ./%{_libdir}/*.a \
./%{_includedir} \ # ./%{_includedir} \
./%{_openssldir} \ # ./%{_openssldir} \
./%{_libdir}/pkgconfig \ # ./%{_libdir}/pkgconfig \
./%{_mandir}/man3 \ # ./%{_mandir}/man3 \
./%{_defaultdocdir}/openssl/html/man3 # ./%{_defaultdocdir}/openssl/html/man3
) #)
install -d %{buildroot}%{_bindir}
ln -sf %{_optdir}/%{name}/bin/%{oname} %{buildroot}%{_bindir}/%{name}
# clean .a
rm -f %{buildroot}%{_optdir}/%{name}/lib/*.a
# mans compress
find %{buildroot}%{_optdir}/%{name}/share/man -type f -name "*.*" -exec xz -z {} \;
find %{buildroot}%{_optdir}/%{name}/share/man -type l -name "*.*" -exec %{SOURCE1} {} \;
find %{buildroot}%{_optdir}/%{name}/share/man -type l -name "*.*" -exec mv -f {} {}.xz \;