mbedtls/mbedtls.spec

156 lines
4.3 KiB
RPMSpec
Raw Permalink Normal View History

Name: mbedtls
Version: 2.25.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://tls.mbed.org/
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}
## note: you can add this requirement if .pc files are provided by this package
#Requires: pkg-config
%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
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall -C build
chmod +x %{buildroot}%{_libdir}/lib*.so*
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/aescrypt2
%{_bindir}/benchmark
%{_bindir}/cert_app
%{_bindir}/cert_req
%{_bindir}/cert_write
%{_bindir}/crl_app
%{_bindir}/crypt_and_hash
%{_bindir}/crypto_examples
%{_bindir}/dh_client
%{_bindir}/dh_genprime
%{_bindir}/dh_server
%{_bindir}/dtls_client
%{_bindir}/dtls_server
%{_bindir}/ecdh_curve25519
%{_bindir}/ecdsa
%{_bindir}/gen_entropy
%{_bindir}/gen_key
%{_bindir}/gen_random_ctr_drbg
%{_bindir}/gen_random_havege
%{_bindir}/generic_sum
%{_bindir}/hello
%{_bindir}/key_app
%{_bindir}/key_app_writer
%{_bindir}/key_ladder_demo
%{_bindir}/key_ladder_demo.sh
%{_bindir}/mini_client
%{_bindir}/mpi_demo
%{_bindir}/pem2der
%{_bindir}/pk_decrypt
%{_bindir}/pk_encrypt
%{_bindir}/pk_sign
%{_bindir}/pk_verify
%{_bindir}/psa_constant_names
%{_bindir}/query_compile_time_config
%{_bindir}/req_app
%{_bindir}/rsa_decrypt
%{_bindir}/rsa_encrypt
%{_bindir}/rsa_genkey
%{_bindir}/rsa_sign
%{_bindir}/rsa_sign_pss
%{_bindir}/rsa_verify
%{_bindir}/rsa_verify_pss
%{_bindir}/selftest
%{_bindir}/ssl_client1
%{_bindir}/ssl_client2
%{_bindir}/ssl_context_info
%{_bindir}/ssl_fork_server
%{_bindir}/ssl_mail_client
%{_bindir}/ssl_pthread_server
%{_bindir}/ssl_server
%{_bindir}/ssl_server2
%{_bindir}/strerror
%{_bindir}/udp_proxy
%{_bindir}/zeroize
%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}/mbedtls
%{_includedir}/mbedtls/*.h
%dir %{_includedir}/psa
%{_includedir}/psa/*.h
%{_libdir}/libmbedcrypto.a
%{_libdir}/libmbedcrypto.so
%{_libdir}/libmbedtls.a
%{_libdir}/libmbedtls.so
%{_libdir}/libmbedx509.a
%{_libdir}/libmbedx509.so
%doc ChangeLog README.md
%changelog
* Fri May 07 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.25.0-1mamba
- package created using the webbuild interface