mbedtls/mbedtls.spec

139 lines
4.4 KiB
RPMSpec

Name: mbedtls
Version: 3.6.0
Release: 1mamba
Summary: A C library that implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocols
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://www.trustedfirmware.org/projects/mbed-tls/
Source: https://github.com/ARMmbed/mbedtls.git/v%{version}/mbedtls-%{version}.tar.bz2
License: Apache License 2.0
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
## AUTOBUILDREQ-END
BuildRequires: cmake
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description
Mbed TLS is a C library that implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocols. Its small code footprint makes it suitable for embedded systems.
%package -n lib%{name}
Group: System/Libraries
Summary: Shared libraries for %{name}
%description -n lib%{name}
This package contains shared libraries for %{name}.
%package -n lib%{name}-devel
Group: Development/Libraries
Summary: Development files for %{name}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}-devel
This package contains libraries and header files for developing applications that use %{name}.
%debug_package
%prep
%setup -q
## enable flags for non-embedded systems
#sed -i 's|//\(#define MBEDTLS_THREADING_C\)|\1|' include/mbedtls/config.h
#sed -i 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' include/mbedtls/config.h
## broken in 2.25.0
#sed -i 's/thread_id, -ret/thread_id, (unsigned int)(-ret)/' programs/ssl/ssl_pthread_server.c
#sed -i 's/thread_id, ret/thread_id, (unsigned int)ret/' programs/ssl/ssl_pthread_server.c
#sed -i 's/ -ret );/ (unsigned int)(-ret) );/' programs/ssl/ssl_pthread_server.c
#sed -i 's/ -ret, error_buf/ (unsigned int)(-ret), error_buf/' programs/ssl/ssl_pthread_server.c
#sed -i 's/04x\\n", ret /04x\\n", (unsigned int)ret /' programs/ssl/ssl_pthread_server.c
%build
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
%cmake -d build \
-DUSE_SHARED_MBEDTLS_LIBRARY=ON \
%ifarch %{ix86}
-DCMAKE_C_FLAGS="%{optflags} -mpclmul -msse2 -maes" \
%endif
%ifnarch x86_64 aarch64
-DENABLE_TESTING=OFF
%endif
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall -C build
chmod +x %{buildroot}%{_libdir}/lib*.so*
#mv %{buildroot}%{_prefix}/cmake %{buildroot}%{_libdir}
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/*
%files -n lib%{name}
%defattr(-,root,root)
%{_libdir}/libmbedcrypto.so.*
%{_libdir}/libmbedtls.so.*
%{_libdir}/libmbedx509.so.*
%doc LICENSE
%files -n lib%{name}-devel
%defattr(-,root,root)
%dir %{_includedir}/everest
%{_includedir}/everest/*
%dir %{_includedir}/mbedtls
%{_includedir}/mbedtls/*.h
%dir %{_includedir}/psa
%{_includedir}/psa/*.h
%{_libdir}/libeverest.so
%{_libdir}/libp256m.so
%{_libdir}/libmbedcrypto.a
%{_libdir}/libmbedcrypto.so
%{_libdir}/libmbedtls.a
%{_libdir}/libmbedtls.so
%{_libdir}/libmbedx509.a
%{_libdir}/libmbedx509.so
%dir %{_libdir}/cmake/MbedTLS
%{_libdir}/cmake/MbedTLS/MbedTLS*.cmake
%{_libdir}/pkgconfig/mbed*.pc
%doc ChangeLog README.md
%changelog
* Mon Apr 01 2024 Automatic Build System <autodist@openmamba.org> 3.6.0-1mamba
- automatic version update by autodist
* Fri Jan 26 2024 Automatic Build System <autodist@openmamba.org> 3.5.2-1mamba
- automatic version update by autodist
* Fri Jan 12 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 3.5.1-2mamba
- added build flags for i586 arch
* Thu Nov 09 2023 Automatic Build System <autodist@mambasoft.it> 3.5.1-1mamba
- automatic version update by autodist
* Mon Oct 09 2023 Automatic Build System <autodist@mambasoft.it> 3.5.0-1mamba
- automatic version update by autodist
* Wed Jul 13 2022 Automatic Build System <autodist@mambasoft.it> 3.2.1-1mamba
- automatic version update by autodist
* Wed Jan 05 2022 Automatic Build System <autodist@mambasoft.it> 3.1.0-1mamba
- automatic version update by autodist
* Sat May 08 2021 Automatic Build System <autodist@mambasoft.it> 2.26.0-1mamba
- automatic version update by autodist
* Fri May 07 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.25.0-1mamba
- package created using the webbuild interface