Upgrade to openssl 1.1.1w
[platform/upstream/openssl1.1.git] / packaging / openssl1.1.spec
1 %global OPENSSL_ASM_ENABLED %{?openssl_asm:%openssl_asm}%{!?openssl_asm:ON}
2 %define openssldir %{_sysconfdir}/ssl
3
4 Summary:    Secure Sockets Layer and cryptography libraries and tools
5 Name:       openssl1.1
6 Version:    1.1.1w
7 Release:    0
8 License:    OpenSSL and Apache-2.0
9 Group:      Security/Crypto Libraries
10 Url:        https://www.openssl.org/
11 Source0:    ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz
12 Source1:    %{name}.manifest
13 Requires:   openssl3
14
15 %description
16 The OpenSSL Project is a collaborative effort to develop a robust,
17 commercial-grade, full-featured, and open source toolkit implementing
18 the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
19 v1) protocols with full-strength cryptography. The project is managed
20 by a worldwide community of volunteers that use the Internet to
21 communicate, plan, and develop the OpenSSL toolkit and its related
22 documentation.
23
24 %package -n libopenssl11
25 Summary:    Secure Sockets Layer and cryptography libraries
26 Group:      Security/Crypto Libraries
27
28 %description -n libopenssl11
29 The OpenSSL Project is a collaborative effort to develop a robust,
30 commercial-grade, full-featured, and open source toolkit implementing
31 the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
32 v1) protocols with full-strength cryptography. The project is managed
33 by a worldwide community of volunteers that use the Internet to
34 communicate, plan, and develop the OpenSSL toolkit and its related
35 documentation.
36
37 %package -n lib%{name}-devel
38 Summary:    Secure Sockets Layer and cryptography libraries mandatory for Development
39 Group:      Development/Libraries
40 Requires:   libopenssl11 = %{version}-%{release}
41 Requires:   zlib-devel
42 Conflicts:  libopenssl3-devel
43
44 %description -n lib%{name}-devel
45 The OpenSSL Project is a collaborative effort to develop a robust,
46 commercial-grade, full-featured, and open source toolkit implementing
47 the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
48 v1) protocols with full-strength cryptography. The project is managed
49 by a worldwide community of volunteers that use the Internet to
50 communicate, plan, and develop the OpenSSL toolkit and its related
51 documentation.
52
53 %prep
54 %setup -q
55 cp %{SOURCE1} .
56
57 %build
58 %ifarch %{arm}
59 sslarch=linux-armv4
60 %endif
61 %ifarch aarch64
62 sslarch=linux-aarch64
63 %endif
64 %ifarch %{ix86}
65 sslarch=linux-elf
66 %endif
67 %ifarch x86_64
68 sslarch=linux-x86_64
69 %endif
70 %ifarch riscv64
71 sslarch=linux64-riscv64
72 %endif
73
74 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -s "s/--param=ssp-buffer-size=32//g")
75 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -s "s/-mcpu=cortex-a15.cortex-a7//g")
76 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -s "s/-march=armv7ve/-march=armv7-a/g")
77 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -std=gnu99 -fPIC -pie"
78
79 OPENSSL_CONFIG_ARGS+=" --prefix=%{_prefix} --openssldir=%{openssldir} --libdir=%{_lib} "
80 OPENSSL_CONFIG_ARGS+=" threads shared no-idea no-rc5 no-camellia no-ssl2 enable-md2 enable-weak-ssl-ciphers no-afalgeng "
81 %if %{OPENSSL_ASM_ENABLED} == OFF
82 OPENSSL_CONFIG_ARGS+=" no-asm "
83 %endif
84
85 ./Configure ${OPENSSL_CONFIG_ARGS} ${sslarch} $RPM_OPT_FLAGS
86 make %{?_smp_mflags} all
87
88 %check
89 make test
90
91 %install
92 rm -rf $RPM_BUILD_ROOT
93 make DESTDIR=$RPM_BUILD_ROOT install_sw install_ssldirs
94 mv $RPM_BUILD_ROOT%{openssldir}/openssl.cnf $RPM_BUILD_ROOT%{openssldir}/openssl1.1.cnf
95
96 %files
97 %manifest %{name}.manifest
98 %exclude %{_bindir}
99 %exclude %{openssldir}
100
101 %files -n libopenssl11
102 %manifest %{name}.manifest
103 %license LICENSE
104 %license LICENSE.Apache-2.0
105 %{_libdir}/*.so.*
106 %{_libdir}/engines-1.1/*.so
107 %{openssldir}/%{name}.cnf
108 %exclude %{openssldir}/ct_log_list.cnf
109 %exclude %{openssldir}/*.dist
110 %post -n libopenssl11 -p /sbin/ldconfig
111 %postun -n libopenssl11 -p /sbin/ldconfig
112
113 %files -n lib%{name}-devel
114 %manifest %{name}.manifest
115 %license LICENSE
116 %license LICENSE.Apache-2.0
117 %{_includedir}/openssl
118 %{_libdir}/*.so
119 %exclude %{_libdir}/*.a
120 %{_libdir}/pkgconfig/*.pc
121