File: rules

package info (click to toggle)
rus-ispell 0.99g5-30
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,088 kB
  • sloc: makefile: 107; ansic: 62; sh: 14
file content (64 lines) | stat: -rwxr-xr-x 2,261 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/make -f
# coding: koi8-r
# [debian/rules] for rus-ispell
#
# COPYRIGHT C 2005-2011 Martin-Eric Racine <martin-eric.racine@iki.fi>
# COPYRIGHT C 2011-2022 Agustin Martin Domingo <agmartin@debian.org>
#
# LICENSE
# This package is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License or (at
# your option) any later version.
#

%:
	dh $@

ILANGUAGE=russian
LANG_COUNTRY=ru_RU
DICT_LANG=ru
DICTIONARIES=base.koi abbrev.koi computer.koi for_name.koi geography.koi science.koi

# Explicitely declare the encoding to ensure that 'grep' and 'tr' work as expected.
LANG=C
LC_ALL=C
export LANG LC_ALL

override_dh_auto_build:
	# Generate ispell dictionary.
	grep -h '[]' $(DICTIONARIES) | tr '\243\263' '\305\345' > yo_subst.koi
	cat $(DICTIONARIES) yo_subst.koi |./sortkoi8 | uniq | LC_ALL=C grep -v ' ' > $(ILANGUAGE).dict
	sed -e "s/^\#[ye]//;s/^\#koi/wordchars/" $(ILANGUAGE).aff.koi > $(ILANGUAGE).aff
	# Generate traditional ispell hash needed by i2myspell.
	buildhash $(ILANGUAGE).dict $(ILANGUAGE).aff $(ILANGUAGE).hash
	# Generate gzipped munched wordlist for ispell 3.3 dictionary.
	gzip -nc --best $(ILANGUAGE).dict > $(ILANGUAGE).mwl.gz

	# Generate aspell dictionary; build-depends on aspell because of prezip.
	cat ./$(ILANGUAGE).dict | prezip -s -c | \
		gzip -9n -c > $(DICT_LANG).cwl.gz
	LC_ALL=ru_RU.KOI8-R ispellaff2myspell \
		--bylocale --myheader=./debian/ru_affix.header \
		./$(ILANGUAGE).aff > $(DICT_LANG)_affix.dat
	echo "add $(DICT_LANG).rws" > $(DICT_LANG).multi
	echo "add $(DICT_LANG).multi" > $(ILANGUAGE).alias

# Make sure dh_clean does not remove this upstream file
override_dh_clean:
	dh_clean -Xold/README.orig

override_dh_auto_clean:
	# Clean ispell files.
	rm -f *.cnt *.hash *.stat yo_subst.koi *.utf8
	# Also delete aff and dict, since we build them here.
	rm -f $(ILANGUAGE).aff $(ILANGUAGE).dict $(ILANGUAGE).mwl.gz
	# Clean myspell files.
	rm -f $(LANG_COUNTRY).aff $(LANG_COUNTRY).dic x
	# Clean aspell files.
	rm -f *.alias *_affix.dat *.multi *.*wl*

override_dh_auto_install:
	installdeb-ispell --package=i$(ILANGUAGE)
	installdeb-aspell --package=aspell-$(DICT_LANG)
#EOF