#!/usr/bin/make -f
#
# CDBS debian/rules for ispell-et
# Martin-Eric Racine <q-funk@iki.fi>
#
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk

ILANGUAGE=estonian
LANG_COUNTRY=et_EE
DICT_LANG=et

build-arch:
	## Generate ispell dictionary.
	buildhash $(ILANGUAGE).dict $(ILANGUAGE).aff $(ILANGUAGE).hash
	## Keep upstream myspell dictionary as-is.
	## Generate aspell dictionary.
	# build-depends on aspell because of prezip.
	cp $(LANG_COUNTRY).aff $(DICT_LANG)_affix.dat
	cat $(LANG_COUNTRY).dic | sed 1d | prezip > $(DICT_LANG).cwl
	gzip $(DICT_LANG).cwl
	touch $(DICT_LANG).rws
	touch $(DICT_LANG).compat
	echo "add $(DICT_LANG).rws" > ./$(DICT_LANG).multi
	echo "add $(DICT_LANG).multi" > ./$(ILANGUAGE).alias

clean::
	# Clean ispell files.
	rm -f *.cnt *.hash *.stat
	# Clean myspell files (nothing to clean).
	# Clean aspell files.
	rm -f *.alias *_affix.dat *.compat *.multi *.rws *.*wl* 

install/i$(ILANGUAGE)::
	installdeb-ispell --package=i$(ILANGUAGE)

install/myspell-$(DICT_LANG)::
	installdeb-myspell --package=myspell-$(DICT_LANG)

install/aspell-$(DICT_LANG)::
	installdeb-aspell --package=aspell-$(DICT_LANG)

common-binary-post-install-arch common-binary-post-install-indep:: list-missing
#EOF
