Name libmbedcrypto7t64
Description lightweight crypto and SSL/TLS library - crypto library
Version 2.28.8-1
Package Base mbedtls
Homepage https://www.trustedfirmware.org/projects/mbed-tls/
Maintainers ['Debian IoT Maintainers <debian-iot-maintainers@alioth-lists.debian.net>']
Contributors ['Andrea Pappacoda <andrea@pappacoda.it>']
Distro-repo https://git.launchpad.net/ubuntu/+source/mbedtls/tree/?h=ubuntu/noble
Sources ['https://git.launchpad.net/ubuntu/+source/libmbedcrypto7t64/plain/debian/watch?h=ubuntu/noble']
Dependencies ['libc6']
Optional-Dependencies []
Build-Dependencies ['dpkg-dev', 'cmake', 'debhelper-compat']
Provides []
Builddate
Architecture amd64
Distro-Version noble
Licenses []
Hash 1f0b795a2274f68edddaf2567d738fcee43383c2c4ba802d54ba3b710bbb3228
#!/usr/bin/make -f

# LTO is disabled until https://github.com/Mbed-TLS/mbedtls/issues/5906 is fixed
# optimize=-lto because I use CMake's LTO
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+all,-lto qa=+all
# Required as libmbedtls-dev ships .a files
#export DEB_CFLAGS_MAINT_APPEND   = -ffat-lto-objects
#export DEB_CXXFLAGS_MAINT_APPEND = -ffat-lto-objects

UPSTREAM_DATE = $(shell awk '/^= .* [0-9-]*$$/ { print $$NF; exit }' ChangeLog)

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
  test := true
else
  test := false
endif

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
  doc := true
else
  doc := false
endif

%:
	dh $@ --buildsystem=cmake

CONFIG_H = include/mbedtls/config.h

execute_after_dh_auto_clean:
	[ ! -e $(CONFIG_H).bak ] || mv $(CONFIG_H).bak $(CONFIG_H)

override_dh_auto_configure:
	cp $(CONFIG_H) $(CONFIG_H).bak
	scripts/config.py set MBEDTLS_DEPRECATED_WARNING
	scripts/config.py set MBEDTLS_HAVEGE_C
	scripts/config.py set MBEDTLS_MD2_C
	scripts/config.py set MBEDTLS_MD4_C
	scripts/config.py set MBEDTLS_THREADING_C
	scripts/config.py set MBEDTLS_THREADING_PTHREAD
	scripts/config.py set MBEDTLS_CMAC_C
	scripts/config.py set MBEDTLS_SSL_DTLS_SRTP
	dh_auto_configure -- \
		-DLIB_INSTALL_DIR="lib/$(DEB_HOST_MULTIARCH)" \
		-DUSE_STATIC_MBEDTLS_LIBRARY=ON \
		-DUSE_SHARED_MBEDTLS_LIBRARY=ON \
		-DENABLE_PROGRAMS=OFF \
		-DENABLE_TESTING=$(test) \
		-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON
#		-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
#		-DCMAKE_POLICY_DEFAULT_CMP0069=NEW

ifeq ($(doc),true)
override_dh_auto_build-indep:
	dh_auto_build --indep -- apidoc
endif

# Use faketime to prevent testsuite timebombing in the future
override_dh_auto_test-arch:
	faketime '$(UPSTREAM_DATE)' dh_auto_test --no-parallel

override_dh_auto_test-indep:
override_dh_auto_install-indep:

ifeq ($(doc),true)
execute_after_dh_installdocs-indep:
	dh_doxygen --indep
endif