File polarssl.spec of Package polarssl.openSUSE_13.2_Update
#
# spec file for package polarssl
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define _soname 7
Name: polarssl
Version: 1.3.9
Release: 0
Summary: Open Source embedded SSL/TLS cryptographic library
License: GPL-2.0+
Group: Development/Libraries/C and C++
Url: http://polarssl.org/
Source: https://polarssl.org/download/%{name}-%{version}-gpl.tgz
# PATCH-FIX-UPSTREAM -- polarssl-CVE-2015-1182.patch -- Remote attack using crafted certificates CVE-2015-1182
Patch0: polarssl-CVE-2015-1182.patch
# PATCH-FIX-UPSTREAM -- polarssl-CVE-2015-5291.patch -- Remote code execution via session tickets or SNI
Patch1: polarssl-CVE-2015-5291.patch
# PATCH-FIX-UPSTREAM -- polarssl-CVE-2015-7575.patch -- CVE-2015-7575
# boo#961284 boo#961290
Patch2: polarssl-CVE-2015-7575.patch
BuildRequires: cmake
%if 0%{?suse_version} < 1200
BuildRequires: zlib-devel
%else
BuildRequires: pkgconfig(zlib)
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A portable, easy to use, readable and flexible SSL library.
%package -n libpolarssl%{_soname}
Summary: Open Source embedded SSL/TLS cryptographic library
Group: Development/Libraries/C and C++
%description -n libpolarssl%{_soname}
A portable, easy to use, readable and flexible SSL library.
%package -n polarssl-devel
Summary: Open Source embedded SSL/TLS cryptographic library
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libpolarssl%{_soname} = %{version}
Provides: libpolarssl-devel = %{version}
Obsoletes: libpolarssl-devel < %{version}
%description -n polarssl-devel
A portable, easy to use, readable and flexible SSL library.
%prep
%setup -q
%patch0 -p0
%patch1 -p0
%patch2 -p1
sed -i 's|//\(#define POLARSSL_THREADING_C\)|\1|' include/polarssl/config.h
sed -i 's|//\(#define POLARSSL_THREADING_PTHREAD\)|\1|' include/polarssl/config.h
%build
export CFLAGS="%{optflags}"
cmake \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DLIB_INSTALL_DIR=%{_libdir} \
-DUSE_SHARED_POLARSSL_LIBRARY=ON \
-DUSE_STATIC_POLARSSL_LIBRARY=OFF \
-DENABLE_ZLIB_SUPPORT=ON \
-DENABLE_PROGRAMS=OFF
make VERBOSE=1 %{?_smp_mflags}
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
%check
make test %{?_smp_mflags}
%post -n libpolarssl%{_soname} -p /sbin/ldconfig
%postun -n libpolarssl%{_soname} -p /sbin/ldconfig
%files -n polarssl-devel
%defattr(-,root,root)
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*.h
%{_libdir}/libpolarssl.so
%files -n libpolarssl%{_soname}
%defattr(-,root,root)
%doc ChangeLog README.rst LICENSE
%{_libdir}/libpolarssl.so.*
%changelog