#!/usr/bin/make -f

include /usr/share/dpkg/buildflags.mk

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_CXXFLAGS_MAINT_APPEND=$(CPPFLAGS) # Add -D_FORTIFY_SOURCE to CXXFLAGS

override_dh_auto_configure:
	# restore empty versions of some files that were removed for the dfsg tarball
	touch \
		sdrbase/resources/webapi/index.html \
		sdrbase/resources/webapi/doc/html2/index.html \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-initializer.js \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-bundle.js \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-bundle.js.map \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-es-bundle-core.js \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-es-bundle-core.js.map \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-es-bundle.js \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-es-bundle.js.map \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-standalone-preset.js \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-standalone-preset.js.map \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui.css \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui.css.map \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui.js \
		sdrbase/resources/webapi/doc/swagger-ui/swagger-ui.js.map
	dh_auto_configure -- \
		-DENABLE_QT6=ON \
		-DCMAKE_BUILD_TYPE=Release \
		-DDEBUG_OUTPUT=OFF \
		-DRX_SAMPLE_24BIT=ON \
		-DENABLE_PERSEUS=OFF \
		-DENABLE_SDRPLAY=OFF \
		-DENABLE_CHANNELRX_DEMODINMARSAT=OFF \
		-DENABLE_CHANNELRX_DEMODDAB=OFF \
		-DENABLE_CHANNELRX_DEMODAPT=OFF \
		-DENABLE_CHANNELRX_DEMODDSD=OFF \
		-DENABLE_CHANNELRX_REMOTESINK=OFF \
		-DENABLE_CHANNELRX_SIGMFFILESINK=OFF \
		-DENABLE_CHANNELTX_REMOTESOURCE=OFF \
		-DENABLE_FEATURE_SATELLITETRACKER=OFF \
		-DENABLE_FEATURE_MORSEDECODER=OFF \
		-DENABLE_FEATURE_DENOISER=OFF \
		-DENABLE_FEATURE_MAP=OFF

%:
	dh $@
