#!/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
	# Generate myspell dictionary
	i2myspell -d ./$(ILANGUAGE).dict > $(LANG_COUNTRY).dic
	ispellaff2myspell --charset=latin0 $(ILANGUAGE).aff > $(LANG_COUNTRY).aff
	# Generate aspell dictionary
	cp $(LANG_COUNTRY).aff $(DICT_LANG)_affix.dat
	#word-list-compress c < $(ILANGUAGE).dict > $(DICT_LANG).cwl
	aspell --lang=$(DICT_LANG) create master ./$(DICT_LANG).rws < $(LANG_COUNTRY).dic
	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
	rm -f $(LANG_COUNTRY).aff $(LANG_COUNTRY).dic
	# Clean aspell files
	rm -f *.alias *_affix.dat *.cwl *.multi *.rws

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
