#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@

execute_before_dh_auto_build:
	# Make temporary copies of the ar files.
	cp ar.aff ar-temp.aff
	cp ar.dic ar-temp.dic

	# Remove the IGNORE command from the temp files because it is not supported by convert-bdic.
	# See more about this at https://bugreports.qt.io/browse/QTBUG-107600
	sed -i 's/^IGNORE/#IGNORE/' ar-temp.aff

	# Build the .bidc binary dictionary.
	convert-bdic ar-temp.dic ar.bdic

	# Remove the temporary ar files.
	rm ar-temp.aff
	rm ar-temp.dic

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog-ar
