# Makefile ispell-gaeilge
# INSTALLATION=gaeilgemor
# INSTALLATION=gaeilgelit
INSTALLATION=gaeilge
ISPELLDIR=/usr/lib/ispell
ISPELLBIN=/usr/bin
INSTALL=/usr/bin/install
SHELL=/bin/sh
MAKE=/usr/bin/make
GALLPERSONAL=aitiuil ceol eachtar gall giorr gno lit romhanach
GAELPERSONAL=bioblabeag daoine logainm miotas.txt stair.txt treise
PERSONAL=$(GALLPERSONAL) $(GAELPERSONAL)
# Shouldn't have to change anything below here
RELEASE=5.0
RAWWORDS= gaeilge.raw
LITWORDS= gaeilge.lit dinneenok.txt
ALTWORDS= gaeilge.mor
AFFIXFILE= gaeilge.aff
ALTAFFIXFILE=gaeilgemor.aff
INSTALL_DATA=$(INSTALL) -m 444
SORT=sort -u
all: ga_IE.dic
# grep -v filters out Malmö, São, LC_ALL=C needed!
ga_IE.dic: $(RAWWORDS) $(AFFIXFILE) $(PERSONAL)
LC_ALL=C $(SORT) $(RAWWORDS) $(PERSONAL) | LC_ALL=C grep -v "[^'a-zA-ZáéíóúÁÉÍÓÚ/-]" | iconv -f UTF-8 -t iso-8859-1 > gaeilge.focail
wc -l gaeilge.focail | cut -d ' ' -f 1 > ga_IE.dic
LC_ALL=C $(SORT) -f -t / --key 1,1 gaeilge.focail >> ga_IE.dic
rm -f gaeilge.focail tempaff.txt
gaeilgelit.hash: $(RAWWORDS) $(LITWORDS) gaeilgelit.aff $(PERSONAL)
LC_ALL=C $(SORT) $(RAWWORDS) $(LITWORDS) $(PERSONAL) | LC_ALL=C grep -v "[^'a-zA-ZáéíóúÁÉÍÓÚ/-]" | iconv -f UTF-8 -t iso-8859-1 > gaeilge.focail
iconv -f UTF-8 -t iso-8859-1 gaeilgelit.aff > tempaff.txt
$(ISPELLBIN)/buildhash gaeilge.focail tempaff.txt gaeilgelit.hash
rm -f gaeilge.focail tempaff.txt
gaeilgemor.hash: $(RAWWORDS) $(LITWORDS) $(ALTWORDS) $(ALTAFFIXFILE) $(PERSONAL)
LC_ALL=C $(SORT) $(RAWWORDS) $(LITWORDS) $(ALTWORDS) $(PERSONAL) | LC_ALL=C grep -v "[^'a-zA-ZáéíóúÁÉÍÓÚ/-]" | iconv -f UTF-8 -t iso-8859-1 > gaeilge.focail
iconv -f UTF-8 -t iso-8859-1 $(ALTAFFIXFILE) > tempaff.txt
$(ISPELLBIN)/buildhash gaeilge.focail tempaff.txt gaeilgemor.hash
rm -f gaeilge.focail tempaff.txt
$(ALTAFFIXFILE): $(AFFIXFILE) gaeilgemor.diff
patch -o gaeilgemor.aff gaeilge.aff < gaeilgemor.diff
# "personal" file used in gramadoir-ga "lexfromdb", that's all
personal: biobla $(PERSONAL)
sort -u $(PERSONAL) > ./personal
rm -f $(HOME)/.ispell_$(INSTALLATION)
LC_ALL=C sort -u biobla | iconv -f UTF-8 -t iso-8859-1 > $(HOME)/.ispell_$(INSTALLATION)
gaeilgelit.aff: $(AFFIXFILE)
cp $(AFFIXFILE) gaeilgelit.aff
install: $(INSTALLATION).hash $(INSTALLATION).aff
$(INSTALL_DATA) $(INSTALLATION).hash $(ISPELLDIR)
iconv -f UTF-8 -t iso-8859-1 $(INSTALLATION).aff > tempaff.txt
$(INSTALL_DATA) tempaff.txt $(ISPELLDIR)/$(INSTALLATION).aff
rm -f tempaff.txt
installall: gaeilge.hash gaeilgelit.hash gaeilgemor.hash gaeilgelit.aff
$(INSTALL_DATA) gaeilge.hash $(ISPELLDIR)
iconv -f UTF-8 -t iso-8859-1 $(AFFIXFILE) > tempaff.txt
$(INSTALL_DATA) tempaff.txt $(ISPELLDIR)/$(AFFIXFILE)
$(INSTALL_DATA) gaeilgelit.hash $(ISPELLDIR)
iconv -f UTF-8 -t iso-8859-1 gaeilgelit.aff > tempaff.txt
$(INSTALL_DATA) tempaff.txt $(ISPELLDIR)/gaeilgelit.aff
$(INSTALL_DATA) gaeilgemor.hash $(ISPELLDIR)
iconv -f UTF-8 -t iso-8859-1 $(ALTAFFIXFILE) > tempaff.txt
$(INSTALL_DATA) tempaff.txt $(ISPELLDIR)/$(ALTAFFIXFILE)
rm -f tempaff.txt
clean:
rm -f *.cnt *.stat *.bak *.tar *.tar.gz *.zip *.tar.bz2 gaeilge sounds.txt repl aspellrev.txt IG2.* EN.temp IG.missp IG.temp IG.temp2 personal accents.txt ga-*dictionary.xpi *.oxt mimetype SentenceExceptList.xml WordExceptList.xml DocumentList.xml acor_ga-IE.dat validalts.txt ga_inclusion.txt ga_corpus.txt a.tmp seanghaeilge.dic README_ga-Latg-IE.txt README_ga_IE.txt gaelspell.txt caighdean.txt gaeilge.dic ga-media-freq.txt ga_corpus-utf8.txt ga-word-freq.txt ga-freq.txt ga-phrases-freq.txt ga_inclusion-utf8.txt twitter-survey.txt gaelspellalt-ascii.txt gaelspell-anything.txt gaelspellalt.txt text-freq.txt ga-phrases.txt README_hyph_ga_IE.txt README_th_ga_IE_v2.txt hyph_ga_IE.dic th_ga_IE_v2.dat th_ga_IE_v2.idx
# Clean back to what gets packaged up in an ispell-gaeilge tarball
# So don't wipe out generated ChangeLog, giorr, romhanach, etc.
# See veryclean, maintainer-clean below
distclean:
$(MAKE) clean
rm -f *.hash aspell.txt aspelllit.txt aspellalt.txt ga_IE.dic gaeilgelit.aff $(ALTAFFIXFILE) ga_IE.aff gaelu ga-Latg-IE.dic ga-Latg-IE.aff
#############################################################################