3888f7a
%if 0%{?fedora} || 0%{?rhel} >= 7
5913974
%global _docdir_fmt %{name}
3888f7a
%endif
5913974
5913974
Name: mbedtls
5e7b557
Version: 1.3.11
5e7b557
Release: 1%{?dist}
5913974
Summary: Light-weight cryptographic and SSL/TLS library
5913974
Group: System Environment/Libraries
5913974
License: GPLv2+ with exceptions
5913974
URL: https://tls.mbed.org/
5913974
Source0: https://tls.mbed.org/download/%{name}-%{version}-gpl.tgz
5913974
5913974
BuildRequires: cmake
5913974
BuildRequires: doxygen
5913974
BuildRequires: graphviz
5913974
3888f7a
%if 0%{?rhel} == 5
3888f7a
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3888f7a
%endif
3888f7a
5913974
# replace polarssl with mbedtls
5913974
5913974
Obsoletes: polarssl < 1.3.10
5913974
Provides:  polarssl = %{version}-%{release}
5913974
5913974
%description
5913974
Mbed TLS is a light-weight open source cryptographic and SSL/TLS
5913974
library written in C. Mbed TLS makes it easy for developers to include
5913974
cryptographic and SSL/TLS capabilities in their (embedded)
5913974
applications with as little hassle as possible.
5913974
FOSS License Exception: https://tls.mbed.org/foss-license-exception
5913974
5913974
%package        utils
5913974
Summary:        Utilities for %{name}
5913974
Group:          Applications/System
5913974
Requires:       %{name}%{?_isa} = %{version}-%{release}
5913974
Obsoletes:      polarssl-utils < 1.3.10
5913974
Provides:       polarssl-utils = %{version}-%{release}
5913974
5913974
%description    utils
5913974
Cryptographic utilities based on %{name}. 
5913974
5913974
%package        devel
5913974
Summary:        Development files for %{name}
5913974
Group:          Development/Libraries
5913974
Requires:       %{name}%{?_isa} = %{version}-%{release}
5913974
Obsoletes:      polarssl-devel < 1.3.10
5913974
Provides:       polarssl-devel = %{version}-%{release}
5913974
5913974
%description    devel
5913974
The %{name}-devel package contains libraries and header files for
5913974
developing applications that use %{name}.
5913974
5913974
%package        static
5913974
Summary:        Static files for %{name}
5913974
Group:          Development/Libraries
5913974
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
5913974
5913974
%description    static
5913974
The %{name}-static package contains static files for
5913974
developing applications that use %{name}.
5913974
5913974
%package        doc
5913974
Summary:        Documentation files for %{name}
5913974
Group:          Documentation
3888f7a
%if 0%{?fedora} || 0%{?rhel} >= 6
5913974
BuildArch:      noarch
3888f7a
%endif
5913974
5913974
%description    doc
5913974
The %{name}-doc package contains documentation.
5913974
5913974
%prep
5913974
%setup -q
5913974
3888f7a
%if 0%{?rhel} == 5
3888f7a
sed -e 's/-Wlogical-op//' -i CMakeLists.txt
3888f7a
%endif
3888f7a
5913974
%build
5913974
%cmake -D CMAKE_BUILD_TYPE:String="Release" -D USE_SHARED_MBEDTLS_LIBRARY:BOOL=1 .
5913974
make %{?_smp_mflags} all apidoc
5913974
5913974
%install
3888f7a
%if 0%{?fedora} || 0%{?rhel} >= 6
5913974
%make_install
3888f7a
%else
3888f7a
make DESTDIR=$RPM_BUILD_ROOT install
3888f7a
%endif
5913974
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
5913974
mv $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_libexecdir}/mbedtls
5913974
5e7b557
%check
5e7b557
LD_LIBRARY_PATH=$PWD/library ctest --output-on-failure -V
5913974
5913974
%post -p /sbin/ldconfig
5913974
5913974
%postun -p /sbin/ldconfig
5913974
5913974
%files
5913974
%doc ChangeLog
3888f7a
%{!?_licensedir:%global license %%doc}
5913974
%license LICENSE
5913974
%{_libdir}/*.so.*
5913974
5913974
%files utils
5913974
%{_libexecdir}/%{name}/
5913974
5913974
%files devel
5913974
%{_includedir}/polarssl/
5913974
%{_libdir}/*.so
5913974
5913974
%files static
5913974
%{_libdir}/*.a
5913974
5913974
%files doc
5913974
%doc apidoc/*
5913974
5913974
%changelog
5e7b557
* Fri Jun 05 2015 Morten Stevens <mstevens@imt-systems.com> - 1.3.11-1
5e7b557
- Update to 1.3.11
5e7b557
3888f7a
* Mon Jun 01 2015 Robert Scheck <robert@fedoraproject.org> - 1.3.10-2
3888f7a
- Spec file changes to cover Red Hat Enterprise Linux 5 and 6
3888f7a
5913974
* Thu May 14 2015 Morten Stevens <mstevens@imt-systems.com> - 1.3.10-1
5913974
- Initial Fedora Package
5913974
- Added subpackage for documentation files
5913974
- Added subpackage for static files