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