Fork c9s' openssl to openssl3 for epel8 (and possibly Fedora <= 35)

- drop epoch as this is a new package
- adopt code for handling clashing files from openssl11

Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
epel8
Michel Alexandre Salim 3 years ago
parent 694c426faf
commit 910ecb6eaf

@ -13,10 +13,9 @@
%global _performance_build 1
Summary: Utilities from the general purpose cryptography library with TLS implementation
Name: openssl
Name: openssl3
Version: 3.0.0
Release: 3%{?dist}
Epoch: 1
Release: 3%{?dist}.1
# We have to remove certain patented algorithms from the openssl source
# tarball with the hobble-openssl script which is included below.
# The original openssl upstream tarball cannot be shipped in the .src.rpm.
@ -75,7 +74,7 @@ BuildRequires: perl(Time::HiRes), perl(IPC::Cmd), perl(Pod::Html), perl(Digest::
BuildRequires: perl(FindBin), perl(lib), perl(File::Compare), perl(File::Copy), perl(bigint)
BuildRequires: git-core
Requires: coreutils
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description
The OpenSSL toolkit provides support for secure communications between
@ -96,7 +95,7 @@ support cryptographic algorithms and protocols.
%package devel
Summary: Files for development of applications which will use OpenSSL
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
@ -104,18 +103,8 @@ OpenSSL is a toolkit for supporting cryptography. The openssl-devel
package contains include files needed to develop applications which
support various cryptographic algorithms and protocols.
%package perl
Summary: Perl scripts provided with OpenSSL
Requires: perl-interpreter
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description perl
OpenSSL is a toolkit for supporting cryptography. The openssl-perl
package provides Perl scripts for converting certificates and keys
from other formats to the formats used by the OpenSSL toolkit.
%prep
%autosetup -S git -n %{name}-%{version}
%autosetup -S git -n openssl-%{version}
# The hobble_openssl is called here redundantly, just to be sure.
# The tarball has already the sources removed.
@ -327,29 +316,60 @@ install -m644 %{SOURCE9} \
$RPM_BUILD_ROOT/%{_prefix}/include/openssl/configuration.h
%endif
# Transformation for openssl3
# see openssl11.spec
mkdir -p $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}/%{name}/
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/openssl.cnf
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/ct_log_list.cnf
rm -f $RPM_BUILD_ROOT%{_libdir}/*.so
mv -f $RPM_BUILD_ROOT%{_includedir}/{openssl,%{name}/openssl}/
mv -f $RPM_BUILD_ROOT%{_bindir}/{openssl,%{name}}
for pc in libcrypto libssl openssl; do
sed -e 's@\(Libs: -L${libdir}\)@\1 -L${libdir}/%{name}@' \
-e 's@\(Cflags: -I${includedir}\)@\1 -I${includedir}/%{name}@' \
-e 's@\(Requires.*:.*\)\(libssl\)@\1\23@g' \
-e 's@\(Requires.*:.*\)\(libcrypto\)@\1\23@g' \
$RPM_BUILD_ROOT%{_libdir}/pkgconfig/${pc}.pc > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/${pc}3.pc
touch -c -r $RPM_BUILD_ROOT%{_libdir}/pkgconfig/${pc}.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/${pc}3.pc
rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/${pc}.pc
done
ln -s ../libcrypto.so.%{version} $RPM_BUILD_ROOT%{_libdir}/%{name}/libcrypto.so
ln -s ../libssl.so.%{version} $RPM_BUILD_ROOT%{_libdir}/%{name}/libssl.so
pushd $RPM_BUILD_ROOT%{_mandir}
for manpage in man*/* ; do
[ "${manpage}" = "man1/%{name}.1" ] && continue
if [ -L ${manpage} ]; then
TARGET=`ls -l ${manpage} | awk '{ print $NF }'`
ln -snf ${TARGET}11 ${manpage}
rm -f ${manpage}
else
mv -f ${manpage} ${manpage}3
fi
done
popd
# No openssl3-perl, because it wouldn't be really different or newer
rm -rf $RPM_BUILD_ROOT{%{_sysconfdir}/pki/CA/,{%{_bindir},%{_mandir}/man1}/{CA.pl,c_rehash,*tsget}*}
# Remove dummy cert tools
rm -f $RPM_BUILD_ROOT%{_bindir}/{make,renew}-dummy-cert
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE.txt
%doc NEWS.md README.md
%{_bindir}/make-dummy-cert
%{_bindir}/renew-dummy-cert
%{_bindir}/openssl
%{_bindir}/%{name}
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man7/*
%{_pkgdocdir}/Makefile.certificate
%exclude %{_mandir}/man1/*.pl*
%exclude %{_mandir}/man1/tsget*
%files libs
%{!?_licensedir:%global license %%doc}
%license LICENSE.txt
%dir %{_sysconfdir}/pki/tls
%dir %{_sysconfdir}/pki/tls/certs
%dir %{_sysconfdir}/pki/tls/misc
%dir %{_sysconfdir}/pki/tls/private
%config(noreplace) %{_sysconfdir}/pki/tls/openssl.cnf
%config(noreplace) %{_sysconfdir}/pki/tls/ct_log_list.cnf
%attr(0755,root,root) %{_libdir}/libcrypto.so.%{version}
%{_libdir}/libcrypto.so.%{soversion}
%attr(0755,root,root) %{_libdir}/libssl.so.%{version}
@ -362,26 +382,17 @@ install -m644 %{SOURCE9} \
%files devel
%doc CHANGES.md doc/dir-locals.example.el doc/openssl-c-indent.el
%{_prefix}/include/openssl
%{_libdir}/*.so
%{_prefix}/include/%{name}
%{_libdir}/%{name}/*.so
%{_mandir}/man3/*
%{_libdir}/pkgconfig/*.pc
%files perl
%{_bindir}/c_rehash
%{_bindir}/*.pl
%{_bindir}/tsget
%{_mandir}/man1/*.pl*
%{_mandir}/man1/tsget*
%dir %{_sysconfdir}/pki/CA
%dir %{_sysconfdir}/pki/CA/private
%dir %{_sysconfdir}/pki/CA/certs
%dir %{_sysconfdir}/pki/CA/crl
%dir %{_sysconfdir}/pki/CA/newcerts
%ldconfig_scriptlets libs
%changelog
* Wed Nov 17 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 1:3.0.0-3.1
- Fork c9s' openssl to openssl3 for epel8 (and possibly Fedora <= 35)
* Thu Oct 07 2021 Dmitry Belyavskiy <dbelyavs@redhat.com> - 1:3.0.0-3
- Fix memory leak in s_client
- Related: rhbz#1996092
Loading…
Cancel
Save