packaging: Build for riscv64
[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.1s
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 Requires:   libopenssl11 = %{version}-%{release}
13
14 %description
15 The OpenSSL Project is a collaborative effort to develop a robust,
16 commercial-grade, full-featured, and open source toolkit implementing
17 the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
18 v1) protocols with full-strength cryptography. The project is managed
19 by a worldwide community of volunteers that use the Internet to
20 communicate, plan, and develop the OpenSSL toolkit and its related
21 documentation.
22
23 %package -n libopenssl11
24 Summary:    Secure Sockets Layer and cryptography libraries
25 Group:      Security/Crypto Libraries
26
27 %description -n libopenssl11
28 The OpenSSL Project is a collaborative effort to develop a robust,
29 commercial-grade, full-featured, and open source toolkit implementing
30 the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
31 v1) protocols with full-strength cryptography. The project is managed
32 by a worldwide community of volunteers that use the Internet to
33 communicate, plan, and develop the OpenSSL toolkit and its related
34 documentation.
35
36 %package -n lib%{name}-devel
37 Summary:    Secure Sockets Layer and cryptography libraries mandatory for Development
38 Group:      Development/Libraries
39 Requires:   libopenssl11 = %{version}-%{release}
40 Requires:   zlib-devel
41 Conflicts:  libopenssl-devel
42
43 %description -n lib%{name}-devel
44 The OpenSSL Project is a collaborative effort to develop a robust,
45 commercial-grade, full-featured, and open source toolkit implementing
46 the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
47 v1) protocols with full-strength cryptography. The project is managed
48 by a worldwide community of volunteers that use the Internet to
49 communicate, plan, and develop the OpenSSL toolkit and its related
50 documentation.
51
52 %prep
53 %setup -q
54 cp %{SOURCE1} .
55
56 %build
57 %ifarch %{arm}
58 sslarch=linux-armv4
59 %endif
60 %ifarch aarch64
61 sslarch=linux-aarch64
62 %endif
63 %ifarch %{ix86}
64 sslarch=linux-elf
65 %endif
66 %ifarch x86_64
67 sslarch=linux-x86_64
68 %endif
69 %ifarch riscv64
70 sslarch=linux64-riscv64
71 %endif
72
73 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -s "s/--param=ssp-buffer-size=32//g")
74 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -s "s/-mcpu=cortex-a15.cortex-a7//g")
75 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -s "s/-march=armv7ve/-march=armv7-a/g")
76 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -std=gnu99 -fPIC -pie"
77
78 ./Configure \
79     --prefix=%{_prefix} --openssldir=%{openssldir} --libdir=%{_lib} \
80     threads shared no-idea no-rc5 no-camellia no-asm no-ssl2 enable-md2 enable-weak-ssl-ciphers \
81     ${sslarch} $RPM_OPT_FLAGS
82
83 make %{?_smp_mflags} all
84
85 %check
86 %ifarch riscv64
87 export TESTS="alltests -test_afalg"
88 %endif
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 %license LICENSE
99 %license LICENSE.Apache-2.0
100 %{_bindir}/openssl
101 %{_bindir}/c_rehash
102 %{openssldir}/*.cnf*
103 %{openssldir}/misc
104
105 %files -n libopenssl11
106 %manifest %{name}.manifest
107 %license LICENSE
108 %license LICENSE.Apache-2.0
109 %{_libdir}/*.so.*
110 %{_libdir}/engines-1.1/*.so
111 %post -n libopenssl11 -p /sbin/ldconfig
112 %postun -n libopenssl11 -p /sbin/ldconfig
113
114 %files -n lib%{name}-devel
115 %manifest %{name}.manifest
116 %license LICENSE
117 %license LICENSE.Apache-2.0
118 %{_includedir}/openssl
119 %{_libdir}/*.so
120 %exclude %{_libdir}/*.a
121 %{_libdir}/pkgconfig/*.pc
122