#!/usr/bin/make -f

%:
	dh $@

execute_before_dh_auto_build:
	# Make a copy of the dictionary files.
	cp bo.aff bo-copy.aff
	cp bo.dic bo-copy.dic

	# Remove any instances of IGNORE from bo-copy.aff, as these are not
	# supported by .bdic.  <https://bugreports.qt.io/browse/QTBUG-107600>
	sed -i '/IGNORE/d' bo-copy.aff

	# Compile the .bdic binary dictionary.
	convert-bdic bo-copy.dic bo.bdic

	# Remove the copies of the dictionary files.
	rm bo-copy.aff
	rm bo-copy.dic

execute_after_dh_auto_install:
	# Install the info-hunspell file.
	installdeb-hunspell
