1 |
%define major 9 |
2 |
%define libname %mklibname %{name} %{major} |
3 |
%define develname %mklibname %{name} -d |
4 |
|
5 |
Summary: An SSL library |
6 |
Name: mbedtls |
7 |
Version: 1.3.19 |
8 |
Release: %mkrel 1 |
9 |
License: GPLv2+ |
10 |
Group: System/Libraries |
11 |
URL: https://tls.mbed.org/ |
12 |
Source0: https://tls.mbed.org/code/releases/mbedtls-%{version}-gpl.tgz |
13 |
%rename polarssl |
14 |
BuildRequires: cmake |
15 |
BuildRequires: doxygen |
16 |
BuildRequires: graphviz |
17 |
BuildRequires: pkgconfig(libpkcs11-helper-1) |
18 |
BuildRequires: pkgconfig(zlib) |
19 |
BuildRequires: pkgconfig(openssl) |
20 |
|
21 |
%description |
22 |
mbed TLS (formerly known as PolarSSL) is an SSL library written in ANSI C. |
23 |
mbed TLS makes it easy for developers to include cryptographic and SSL/TLS |
24 |
capabilities in their (embedded) products with as little hassle as possible. |
25 |
It is designed to be readable, documented, tested, loosely coupled and |
26 |
portable. |
27 |
|
28 |
This package contains mbed TLS programs. |
29 |
|
30 |
%package -n %{libname} |
31 |
Summary: mbed TLS library |
32 |
Group: System/Libraries |
33 |
|
34 |
%description -n %{libname} |
35 |
mbed TLS (formerly known as PolarSSL) is an SSL library written in ANSI C. |
36 |
mbed TLS makes it easy for developers to include cryptographic and SSL/TLS |
37 |
capabilities in their (embedded) products with as little hassle as possible. |
38 |
It is designed to be readable, documented, tested, loosely coupled and |
39 |
portable. |
40 |
|
41 |
This package contains the library itself. |
42 |
|
43 |
%package -n %{develname} |
44 |
Summary: mbed TLS development files |
45 |
Group: Development/C |
46 |
Requires: %{libname} = %{version} |
47 |
Provides: mbedtls-devel = %{version} |
48 |
Provides: polarssl-devel = %{version} |
49 |
Obsoletes: %{mklibname polarssl -d} |
50 |
|
51 |
%description -n %{develname} |
52 |
mbed TLS (formerly known as PolarSSL) is an SSL library written in ANSI C. |
53 |
mbed TLS makes it easy for developers to include cryptographic and SSL/TLS |
54 |
capabilities in their (embedded) products with as little hassle as possible. |
55 |
It is designed to be readable, documented, tested, loosely coupled and |
56 |
portable. |
57 |
|
58 |
This package contains development files. |
59 |
|
60 |
%prep |
61 |
|
62 |
%setup -q |
63 |
|
64 |
# Enable POLARSSL_THREADING_PTHREAD and POLARSSL_THREADING_C flags |
65 |
# https://bugs.mageia.org/show_bug.cgi?id=15391#c4 |
66 |
sed -i -e 's|.*\(#define POLARSSL_THREADING_C\)|\1|' \ |
67 |
-e 's|.*\(#define POLARSSL_THREADING_PTHREAD\)|\1|' \ |
68 |
include/polarssl/config.h |
69 |
|
70 |
%build |
71 |
%cmake \ |
72 |
-DUSE_SHARED_MBEDTLS_LIBRARY:BOOL=ON \ |
73 |
-DUSE_PKCS11_HELPER_LIBRARY:BOOL=ON |
74 |
%make |
75 |
%make apidoc |
76 |
|
77 |
%check |
78 |
%make check |
79 |
|
80 |
%install |
81 |
|
82 |
%make_install -C build |
83 |
|
84 |
# prevent possible file clashes |
85 |
pushd %{buildroot}%{_bindir} |
86 |
for i in * ; do mv ${i} mbedtls-${i}; done |
87 |
popd |
88 |
|
89 |
rm -f %{buildroot}%{_libdir}/*.a |
90 |
|
91 |
%files |
92 |
%doc ChangeLog README* |
93 |
%{_bindir}/mbedtls-* |
94 |
|
95 |
%files -n %{libname} |
96 |
%{_libdir}/*.so.%{major}* |
97 |
%{_libdir}/*.so.%{version} |
98 |
|
99 |
%files -n %{develname} |
100 |
%doc apidoc/* |
101 |
%{_libdir}/*.so |
102 |
%{_includedir}/polarssl |