# TODO
# - consider dropping last optflags.patch hunk and return to SOMAJOR (.so.1) sonames
+# - find a way to simplify (drop) openssl-optflags.patch, it's pain to update here in pld
#
# Conditional build:
%bcond_without tests # don't perform "make tests"
%bcond_without zlib # zlib: note - enables CVE-2012-4929 vulnerability
%bcond_without sslv2 # SSLv2: note - many flaws http://en.wikipedia.org/wiki/Transport_Layer_Security#SSL_2.0
%bcond_without sslv3 # SSLv3: note - enables CVE-2014-3566 vulnerability
-%bcond_with purify # Compile openssl with \-DPURIFY, useful when one wants to
+%bcond_with purify # Compile openssl with "-DPURIFY", useful when one wants to
# use valgrind debugger against openssl-linked programs
+%bcond_with snap # use GitHub snapshot to build branch release
%include /usr/lib/rpm/macros.perl
Summary: OpenSSL Toolkit libraries for the "Secure Sockets Layer" (SSL v2/v3)
Summary(ru.UTF-8): Библиотеки и утилиты для соединений через Secure Sockets Layer
Summary(uk.UTF-8): Бібліотеки та утиліти для з'єднань через Secure Sockets Layer
Name: openssl
-Version: 1.0.1j
-Release: 3
+# 1.0.2 will be LTS release
+# Version 1.0.2 will be supported until 2019-12-31.
+# https://www.openssl.org/about/releasestrat.html
+Version: 1.0.2j
+Release: 1
License: Apache-like
Group: Libraries
-Source0: ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz
-# Source0-md5: f7175c9cd3c39bb1907ac8bba9df8ed3
+%if %{without snap}
+Source0: https://www.openssl.org/source/%{name}-%{version}.tar.gz
+# Source0-md5: 96322138f0b69e61b7212bc53d5e912b
+%else
+Source1: https://github.com/openssl/openssl/archive/OpenSSL_1_0_2-stable/%{name}-%{version}-dev.tar.gz
+%endif
Source2: %{name}.1.pl
Source3: %{name}-ssl-certificate.sh
Source4: %{name}-c_rehash.sh
Patch0: %{name}-alpha-ccc.patch
Patch1: %{name}-optflags.patch
-Patch2: %{name}-globalCA.diff
-Patch3: %{name}-include.patch
-Patch4: %{name}-man-namespace.patch
-Patch5: %{name}-asflag.patch
-Patch6: %{name}-ca-certificates.patch
-Patch7: %{name}-ldflags.patch
-Patch8: %{name}-find.patch
-# from debian
-Patch10: default_bits.patch
-Patch11: pic.patch
-Patch12: stddef.patch
-Patch13: openssl_fix_for_x32.patch
+Patch2: %{name}-include.patch
+Patch3: %{name}-man-namespace.patch
+Patch4: %{name}-asflag.patch
+Patch5: %{name}-ca-certificates.patch
+Patch6: %{name}-ldflags.patch
+Patch7: %{name}-find.patch
+Patch8: pic.patch
+Patch10: %{name}_fix_for_x32.patch
URL: http://www.openssl.org/
BuildRequires: bc
BuildRequires: perl-devel >= 1:5.6.1
+BuildRequires: pkgconfig
BuildRequires: rpm-perlprov >= 4.1-13
BuildRequires: rpmbuild(macros) >= 1.213
BuildRequires: sed >= 4.0
-Requires: ca-certificates >= 20080809-4
+BuildRequires: zlib-devel
+Requires: ca-certificates >= 20120623-1.1
Requires: rpm-whiteout >= 1.7
Obsoletes: SSLeay
Obsoletes: SSLeay-devel
Obsoletes: SSLeay-perl
Obsoletes: libopenssl0
-%if "%{pld_release}" != "ac"
+%if "%{pld_release}" == "ac"
+Conflicts: neon < 0.26.3-3
+Conflicts: ntpd < 4.2.4p8-10
+Conflicts: openssh-clients < 2:5.8p1-9
+Conflicts: openssh-server < 2:5.8p1-9
+%else
Conflicts: neon < 0.29.6-8
Conflicts: openssh-clients < 2:6.2p2-3
Conflicts: openssh-server < 2:6.2p2-3
бібліотеки для розробки програм з використанням SSL.
%prep
+%if %{with snap}
+%setup -qcT -a1
+mv %{name}-OpenSSL_1_0_2-stable/* .
+%else
%setup -q
+%endif
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
+%ifarch x32
%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
+%endif
sed -i -e 's|\$prefix/\$libdir/engines|/%{_lib}/engines|g' Configure
--libdir=%{_lib} \
shared \
threads \
- %{!?with_sslv2:no-ssl2} \
- %{!?with_sslv3:no-ssl3} \
+ %{?with_sslv2:enable-ssl2}%{!?with_sslv2:no-ssl2} \
+ %{?with_sslv3:enable-ssl3}%{!?with_sslv3:no-ssl3} \
%{!?with_zlib:no-}zlib \
enable-camelia \
enable-cms \
linux-armv4
%endif
+v=$(awk -F= '/^VERSION/{print $2}' Makefile)
+test "$v" = %{version}%{?with_snap:-dev}
+
%{__make} -j1 all rehash %{?with_tests:tests} \
CC="%{__cc}" \
ASFLAG='$(CFLAG) -Wa,--noexecstack' \
%files
%defattr(644,root,root,755)
%doc CHANGES CHANGES.SSLeay LICENSE NEWS README doc/*.txt
-%doc doc/openssl_button.gif doc/openssl_button.html
%attr(755,root,root) /%{_lib}/libcrypto.so.*.*.*
%attr(755,root,root) /%{_lib}/libssl.so.*.*.*
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/certs
-%dir %{_sysconfdir}/%{name}/private
+%dir %attr(700,root,root) %{_sysconfdir}/%{name}/private
%dir %{_datadir}/ssl
%files engines