#!/usr/bin/make -f

%:
	dh $@

override_dh_install:
	# Create the hunspell-bdic directory.
	mkdir -p debian/tmp/usr/share/hunspell-bdic

	# Create a minimal .aff file necessary for the .bdic conversion.
	echo "SET UTF-8" > debian/tmp/usr/share/hunspell/de_med.aff

	# Create the .bdic binary dictionary.
	convert-bdic debian/tmp/usr/share/hunspell/de_med.dic debian/tmp/usr/share/hunspell-bdic/de_med.bdic

	# Remove the .aff.
	rm debian/tmp/usr/share/hunspell/de_med.aff

	dh_install -i --autodest
	installdeb-wordlist --no-package=hunspell-de-med
	installdeb-hunspell --no-package=wgerman-medical
	recode l1..u8 debian/*/usr/share/dict/german-medical
