2 # - consider dropping last optflags.patch hunk and return to SOMAJOR (.so.1) sonames
3 # - find a way to simplify (drop) openssl-optflags.patch, it's pain to update here in pld
6 %bcond_without tests # don't perform "make tests"
7 %bcond_without zlib # zlib: note - enables CVE-2012-4929 vulnerability
8 %bcond_without sslv2 # SSLv2: note - many flaws http://en.wikipedia.org/wiki/Transport_Layer_Security#SSL_2.0
9 %bcond_without sslv3 # SSLv3: note - enables CVE-2014-3566 vulnerability
10 %bcond_with purify # Compile openssl with "-DPURIFY", useful when one wants to
11 # use valgrind debugger against openssl-linked programs
12 %bcond_with snap # use GitHub snapshot to build branch release
14 %include /usr/lib/rpm/macros.perl
15 Summary: OpenSSL Toolkit libraries for the "Secure Sockets Layer" (SSL v2/v3)
16 Summary(de.UTF-8): Secure Sockets Layer (SSL)-Kommunikationslibrary
17 Summary(es.UTF-8): Biblioteca C que suministra algoritmos y protocolos criptográficos
18 Summary(fr.UTF-8): Utilitaires de communication SSL (Secure Sockets Layer)
19 Summary(pl.UTF-8): Biblioteki OpenSSL (SSL v2/v3)
20 Summary(pt_BR.UTF-8): Uma biblioteca C que fornece vários algoritmos e protocolos criptográficos
21 Summary(ru.UTF-8): Библиотеки и утилиты для соединений через Secure Sockets Layer
22 Summary(uk.UTF-8): Бібліотеки та утиліти для з'єднань через Secure Sockets Layer
24 # 1.0.2 will be LTS release
25 # Version 1.0.2 will be supported until 2019-12-31.
26 # https://www.openssl.org/about/releasestrat.html
32 Source0: ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz
33 # Source0-md5: f3c710c045cdee5fd114feb69feba7aa
35 Source1: https://github.com/openssl/openssl/archive/OpenSSL_1_0_2-stable/%{name}-%{version}-dev.tar.gz
38 Source3: %{name}-ssl-certificate.sh
39 Source4: %{name}-c_rehash.sh
40 Patch0: %{name}-alpha-ccc.patch
41 Patch1: %{name}-optflags.patch
42 Patch2: %{name}-include.patch
43 Patch3: %{name}-man-namespace.patch
44 Patch4: %{name}-asflag.patch
45 Patch5: %{name}-ca-certificates.patch
46 Patch6: %{name}-ldflags.patch
47 Patch7: %{name}-find.patch
49 Patch10: %{name}_fix_for_x32.patch
50 URL: http://www.openssl.org/
52 BuildRequires: perl-devel >= 1:5.6.1
53 BuildRequires: rpm-perlprov >= 4.1-13
54 BuildRequires: rpmbuild(macros) >= 1.213
55 BuildRequires: sed >= 4.0
56 Requires: ca-certificates >= 20120623-1.1
57 Requires: rpm-whiteout >= 1.7
59 Obsoletes: SSLeay-devel
60 Obsoletes: SSLeay-perl
61 Obsoletes: libopenssl0
62 %if "%{pld_release}" == "ac"
63 Conflicts: neon < 0.26.3-3
64 Conflicts: ntpd < 4.2.4p8-10
65 Conflicts: openssh-clients < 2:5.8p1-9
66 Conflicts: openssh-server < 2:5.8p1-9
68 Conflicts: apache-mod_ssl < 1:2.2.31-4
69 Conflicts: neon < 0.29.6-8
70 Conflicts: openssh-clients < 2:6.2p2-3
71 Conflicts: openssh-server < 2:6.2p2-3
72 Conflicts: php52-common < 4:5.2.17-20130717.17
73 Conflicts: php53-common < 4:5.3.29-27
74 Conflicts: php54-common < 4:5.4.45-5
75 Conflicts: php55-common < 4:5.5.32-2
76 Conflicts: php56-common < 4:5.6.18-3
77 Conflicts: ruby-modules < 1:2.0.0.648-2
79 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82 The OpenSSL Project is a collaborative effort to develop a robust,
83 commercial-grade, full-featured, and Open Source toolkit implementing
84 the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
85 v1) protocols with full-strength cryptography world-wide. The project
86 is managed by a worldwide community of volunteers that use the
87 Internet to communicate, plan, and develop the OpenSSL tookit and its
88 related documentation.
90 OpenSSL is based on the excellent SSLeay library developed by Eric A.
91 Young and Tim J. Hudson. The OpenSSL toolkit is licensed under an
92 Apache-style licence, which basically means that you are free to get
93 and use it for commercial and non-commercial purposes subject to some
94 simple license conditions.
96 This package contains shared libraries only, install openssl-tools if
97 you want to use openssl cmdline tool.
99 %description -l de.UTF-8
100 Openssl enthält das OpenSSL Zertifikatsmanagementtool und shared
101 libraries, die verschiedene Verschlüsselungs- und
102 Entschlüsselungsalgorithmen und -protokolle, wie DES, RC4, RSA und SSL
103 zur Verfügung stellen.
105 %description -l es.UTF-8
106 Biblioteca C que suministra algoritmos y protocolos criptográficos.
108 %description -l fr.UTF-8
109 OpenSSL est un outiil de gestion des certificats et les librairies
110 partagees qui fournit plusieurs protocoles et algorithmes de
111 codage/decodage, incluant DES, RC4, RSA et SSL.
113 %description -l pl.UTF-8
114 Implementacja protokołów kryptograficznych Secure Socket Layer (SSL)
115 v2/v3 oraz Transport Layer Security (TLS v1).
117 %description -l pt_BR.UTF-8
118 Uma biblioteca C que fornece vários algoritmos e protocolos
119 criptográficos, incluindo DES, RC4, RSA e SSL. Inclui bibliotecas
120 compartilhadas e utilitários.
122 %description -l ru.UTF-8
123 Программа openssl для работы с сертификатами и разделяемые библиотеки,
124 которые реализуют множетсво криптографических алгоритмов, включая DES,
127 %description -l uk.UTF-8
128 Програма openssl для роботи з сертифікатами та бібліотеки спільного
129 користування, що реалізують велику кількість криптографічних
130 алгоритмів, включаючи DES, RC4, RSA та SSL.
133 Summary: OpenSSL optional crypto engines
134 Summary(pl.UTF-8): Opcjonalne silniki kryptograficzne dla OpenSSL-a
136 Requires: %{name} = %{version}-%{release}
139 With OpenSSL 0.9.6, a new component was added to support alternative
140 cryptography implementations, most commonly for interfacing with
141 external crypto devices (eg. accelerator cards). This component is
144 There are currently built-in ENGINE implementations for the following
153 In addition, dynamic binding to external ENGINE implementations is now
154 provided by a special ENGINE called "dynamic".
156 %description engines -l pl.UTF-8
157 Począwszy od OpenSSL-a 0.9.6 został dodany nowy komponent, mający
158 wspierać alternatywne implementacje kryptografii, przeważnie
159 współpracujące z zewnętrznymi urządzeniami kryptograficznymi (np.
160 kartami akceleratorów). Komponent ten jest nazywany SILNIKIEM (ang.
163 Obecnie istnieją wbudowane implementacje silników dla następujących
164 urządzeń kryptograficznych:
171 Ponadto zapewnione jest dynamiczne wiązanie dla zewnętrznych
172 implementacji silników poprzez specjalny silnik o nazwie "dynamic".
175 Summary: OpenSSL command line tool and utilities
176 Summary(pl.UTF-8): Zestaw narzędzi i skryptów
177 Group: Applications/Communications
178 Requires: %{name} = %{version}-%{release}
182 The OpenSSL Toolkit cmdline tool openssl and utility scripts.
184 %description tools -l pl.UTF-8
185 Zestaw narzędzi i skryptów wywoływanych z linii poleceń.
188 Summary: OpenSSL utilities written in Perl
189 Summary(pl.UTF-8): Narzędzia OpenSSL napisane w perlu
190 Group: Applications/Communications
191 Requires: %{name} = %{version}-%{release}
193 %description tools-perl
194 OpenSSL Toolkit tools written in Perl.
196 %description tools-perl -l pl.UTF-8
197 Narzędzia OpenSSL napisane w perlu.
200 Summary: Development part of OpenSSL Toolkit libraries
201 Summary(de.UTF-8): Secure Sockets Layer Kommunikationslibrary: statische libraries+header
202 Summary(es.UTF-8): Bibliotecas y archivos de inclusión para desarrollo OpenSSL
203 Summary(fr.UTF-8): Librairies statiques, headers et utilitaires pour communication SSL
204 Summary(pl.UTF-8): Część bibiloteki OpenSSL przeznaczona dla programistów
205 Summary(pt_BR.UTF-8): Bibliotecas e arquivos de inclusão para desenvolvimento OpenSSL
206 Summary(ru.UTF-8): Библиотеки, хедеры и утилиты для Secure Sockets Layer
207 Summary(uk.UTF-8): Бібліотеки, хедери та утиліти для Secure Sockets Layer
208 Group: Development/Libraries
209 Requires: %{name} = %{version}-%{release}
210 Obsoletes: libopenssl0-devel
213 Development part of OpenSSL library.
215 %description devel -l es.UTF-8
216 Bibliotecas y archivos de inclusión para desarrollo OpenSSL
218 %description devel -l pl.UTF-8
219 Część biblioteki OpenSSL przeznaczona dla programistów.
221 %description devel -l pt_BR.UTF-8
222 Uma biblioteca C que fornece vários algoritmos e protocolos
223 criptográficos, incluindo DES, RC4, RSA e SSL. Inclui bibliotecas e
224 arquivos de inclusão para desenvolvimento.
226 %description devel -l ru.UTF-8
227 Программа openssl для работы с сертификатами и разделяемые библиотеки,
228 которые реализуют множетсво криптографических алгоритмов, включая DES,
229 RC4, RSA и SSL. Включает библиотеки и хедеры для разработки приложений
230 с использованием SSL.
232 %description devel -l uk.UTF-8
233 Програма openssl для роботи з сертифікатами та бібліотеки спільного
234 користування, що реалізують велику кількість криптографічних
235 алгоритмів, включаючи DES, RC4, RSA та SSL. Містить бібліотеки та
236 хедери для розробки програм з використанням SSL.
239 Summary: Static OpenSSL libraries
240 Summary(pl.UTF-8): Statyczne wersje bibliotek z OpenSSL
241 Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento com openssl
242 Summary(ru.UTF-8): Статические библиотеки разработчика для OpenSSL
243 Summary(uk.UTF-8): Статичні бібліотеки програміста для OpenSSL
244 Group: Development/Libraries
245 Requires: %{name}-devel = %{version}-%{release}
248 Static OpenSSL Toolkit libraries.
250 %description static -l pl.UTF-8
251 Statyczne wersje bibliotek z OpenSSL.
253 %description static -l pt_BR.UTF-8
254 Bibliotecas estáticas para desenvolvimento com openssl.
256 %description static -l ru.UTF-8
257 Программа openssl для работы с сертификатами и разделяемые библиотеки,
258 которые реализуют множетсво криптографических алгоритмов, включая DES,
259 RC4, RSA и SSL. Включает статические библиотеки для разработки
260 приложений с использованием OpenSSL.
262 %description static -l uk.UTF-8
263 Програма openssl для роботи з сертифікатами та бібліотеки спільного
264 користування, що реалізують велику кількість криптографічних
265 алгоритмів, включаючи DES, RC4, RSA та SSL. Містить статичні
266 бібліотеки для розробки програм з використанням SSL.
271 mv %{name}-OpenSSL_1_0_2-stable/* .
288 sed -i -e 's|\$prefix/\$libdir/engines|/%{_lib}/engines|g' Configure
293 %{__perl} util/perlpath.pl %{__perl}
295 OPTFLAGS="%{rpmcflags} %{rpmcppflags} %{?with_purify:-DPURIFY}" \
297 %{__perl} ./Configure \
298 --openssldir=%{_sysconfdir}/%{name} \
302 %{!?with_sslv2:no-ssl2} \
303 %{!?with_sslv3:no-ssl3} \
304 %{!?with_zlib:no-}zlib \
315 enable-ec_nistp_64_gcc_128 \
320 # ^- allow running on 80386 (default code uses bswapl available on i486+)
352 %ifarch armv4 armv5 armv5t armv5te armv5tel
356 v=$(awk -F= '/^VERSION/{print $2}' Makefile)
357 test "$v" = %{version}%{?with_snap:-dev}
359 %{__make} -j1 all rehash %{?with_tests:tests} \
361 ASFLAG='$(CFLAG) -Wa,--noexecstack' \
362 INSTALLTOP=%{_prefix}
364 # Rename POD sources of man pages. "openssl_" prefix is added to each
365 # manpage to avoid potential conflicts with other packages.
367 for dir in doc/{apps,ssl,crypto}; do
369 %{__perl} -pi -e 's/(\W)((?<!openssl_)\w+)(\(\d\))/$1openssl_$2$3/g; s/openssl_openssl/openssl/g;' *.pod;
371 for pod in !(openssl*).pod; do
372 mv -f $pod openssl_$pod;
378 rm -rf $RPM_BUILD_ROOT
379 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_libdir}/%{name}} \
380 $RPM_BUILD_ROOT{%{_mandir}/{pl/man1,man{1,3,5,7}},%{_datadir}/ssl} \
381 $RPM_BUILD_ROOT/%{_lib}/engines \
382 $RPM_BUILD_ROOT%{_pkgconfigdir}
384 %{__make} -j1 install \
385 INSTALLTOP=%{_prefix} \
386 INSTALL_PREFIX=$RPM_BUILD_ROOT \
389 mv -f $RPM_BUILD_ROOT%{_libdir}/engines/* $RPM_BUILD_ROOT/%{_lib}/engines
390 mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib}
391 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcrypto.*.*) $RPM_BUILD_ROOT%{_libdir}/libcrypto.so
392 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libssl.*.*) $RPM_BUILD_ROOT%{_libdir}/libssl.so
394 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/misc/* $RPM_BUILD_ROOT%{_libdir}/%{name}
395 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/misc
397 # not installed as individual utilities (see openssl dgst instead)
398 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{dss1,md2,md4,md5,mdc2,ripemd160,sha,sha1,sha224,sha256,sha384,sha512}.1
400 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/pl/man1/openssl.1
401 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/ssl-certificate
402 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_bindir}/c_rehash.sh
405 rm -rf $RPM_BUILD_ROOT
407 %post -p /sbin/ldconfig
408 %postun -p /sbin/ldconfig
410 %triggerpostun -- %{name}-tools < 1.0.0-5
411 # the hashing format has changed in 1.0.0
412 [ ! -x %{_sbindir}/update-ca-certificates ] || %{_sbindir}/update-ca-certificates --fresh || :
414 %triggerpostun -- %{name} < 0.9.8i-2
415 # don't do anything on --downgrade
416 if [ $1 -le 1 ]; then
419 if [ -d /var/lib/openssl/certs ] ; then
420 mv /var/lib/openssl/certs/* %{_sysconfdir}/%{name}/certs 2>/dev/null || :
422 if [ -d /var/lib/openssl/private ] ; then
423 mv /var/lib/openssl/private/* %{_sysconfdir}/%{name}/private 2>/dev/null || :
425 if [ -d /var/lib/openssl ] ; then
426 for f in /var/lib/openssl/* ; do
427 [ -f "$f" ] && mv "$f" %{_sysconfdir}/%{name} 2>/dev/null || :
429 rmdir /var/lib/openssl/* 2>/dev/null || :
430 rmdir /var/lib/openssl 2>/dev/null || :
434 %defattr(644,root,root,755)
435 %doc CHANGES CHANGES.SSLeay LICENSE NEWS README doc/*.txt
436 %attr(755,root,root) /%{_lib}/libcrypto.so.*.*.*
437 %attr(755,root,root) /%{_lib}/libssl.so.*.*.*
438 %dir %{_sysconfdir}/%{name}
439 %dir %{_sysconfdir}/%{name}/certs
440 %dir %attr(700,root,root) %{_sysconfdir}/%{name}/private
444 %defattr(644,root,root,755)
445 %dir /%{_lib}/engines
446 %attr(755,root,root) /%{_lib}/engines/*.so
449 %defattr(644,root,root,755)
450 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/openssl.cnf
451 %attr(755,root,root) %{_bindir}/c_rehash.sh
452 %attr(755,root,root) %{_bindir}/openssl
453 %attr(754,root,root) %{_bindir}/ssl-certificate
455 %dir %{_libdir}/%{name}
456 %attr(755,root,root) %{_libdir}/%{name}/CA.sh
457 %attr(755,root,root) %{_libdir}/%{name}/c_hash
458 %attr(755,root,root) %{_libdir}/%{name}/c_info
459 %attr(755,root,root) %{_libdir}/%{name}/c_issuer
460 %attr(755,root,root) %{_libdir}/%{name}/c_name
462 %{_mandir}/man1/openssl.1*
463 %{_mandir}/man1/openssl_asn1parse.1*
464 %{_mandir}/man1/openssl_ca.1*
465 %{_mandir}/man1/openssl_ciphers.1*
466 %{_mandir}/man1/openssl_cms.1*
467 %{_mandir}/man1/openssl_crl.1*
468 %{_mandir}/man1/openssl_crl2pkcs7.1*
469 %{_mandir}/man1/openssl_dgst.1*
470 %{_mandir}/man1/openssl_dhparam.1*
471 %{_mandir}/man1/openssl_dsa.1*
472 %{_mandir}/man1/openssl_dsaparam.1*
473 %{_mandir}/man1/openssl_ec.1*
474 %{_mandir}/man1/openssl_ecparam.1*
475 %{_mandir}/man1/openssl_enc.1*
476 %{_mandir}/man1/openssl_errstr.1*
477 %{_mandir}/man1/openssl_gendsa.1*
478 %{_mandir}/man1/openssl_genpkey.1*
479 %{_mandir}/man1/openssl_genrsa.1*
480 %{_mandir}/man1/openssl_nseq.1*
481 %{_mandir}/man1/openssl_ocsp.1*
482 %{_mandir}/man1/openssl_passwd.1*
483 %{_mandir}/man1/openssl_pkcs12.1*
484 %{_mandir}/man1/openssl_pkcs7.1*
485 %{_mandir}/man1/openssl_pkcs8.1*
486 %{_mandir}/man1/openssl_pkey.1*
487 %{_mandir}/man1/openssl_pkeyparam.1*
488 %{_mandir}/man1/openssl_pkeyutl.1*
489 %{_mandir}/man1/openssl_rand.1*
490 %{_mandir}/man1/openssl_req.1*
491 %{_mandir}/man1/openssl_rsa.1*
492 %{_mandir}/man1/openssl_rsautl.1*
493 %{_mandir}/man1/openssl_s_client.1*
494 %{_mandir}/man1/openssl_s_server.1*
495 %{_mandir}/man1/openssl_s_time.1*
496 %{_mandir}/man1/openssl_sess_id.1*
497 %{_mandir}/man1/openssl_smime.1*
498 %{_mandir}/man1/openssl_speed.1*
499 %{_mandir}/man1/openssl_spkac.1*
500 %{_mandir}/man1/openssl_ts.1*
501 %{_mandir}/man1/openssl_tsget.1*
502 %{_mandir}/man1/openssl_verify.1*
503 %{_mandir}/man1/openssl_version.1*
504 %{_mandir}/man1/openssl_x509.1*
505 %{_mandir}/man5/openssl_config.5*
506 %{_mandir}/man5/openssl_x509v3_config.5*
507 %lang(pl) %{_mandir}/pl/man1/openssl.1*
510 %defattr(644,root,root,755)
511 %attr(755,root,root) %{_bindir}/c_rehash
512 %attr(755,root,root) %{_libdir}/%{name}/CA.pl
513 %attr(755,root,root) %{_libdir}/%{name}/tsget
514 %{_mandir}/man1/openssl_CA.pl.1*
515 %{_mandir}/man1/openssl_c_rehash.1*
518 %defattr(644,root,root,755)
519 %attr(755,root,root) %{_libdir}/libcrypto.so
520 %attr(755,root,root) %{_libdir}/libssl.so
521 %{_includedir}/%{name}
522 %{_pkgconfigdir}/libcrypto.pc
523 %{_pkgconfigdir}/libssl.pc
524 %{_pkgconfigdir}/openssl.pc
525 %{_mandir}/man3/openssl*.3*
526 %{_mandir}/man7/openssl_des_modes.7*
529 %defattr(644,root,root,755)
530 %{_libdir}/libcrypto.a