File: rules

package info (click to toggle)
eo-spell 3.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 952 kB
  • sloc: lisp: 2,789; sh: 179; makefile: 142; sed: 73; perl: 25; ansic: 16
file content (113 lines) | stat: -rwxr-xr-x 3,713 bytes parent folder | download
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Variant to build for the package,
#  EO_VARIANT=eo           strict
#  EO_VARIANT=esperanto    sloppy
EO_VARIANT=eo

# Make sure build is always done in a reproducible and working
# language environment
LC_ALL = C
export LC_ALL

# Useful only to build aspell official dir
ASPELL6BASENAME = aspell6-eo
ASPELL6DIR      = $(CURDIR)/debian/$(ASPELL6BASENAME)
ASPELLPROC      = /usr/share/aspell-lang/proc    # Location of proc script

TMP_BUILD       = tmp-build

%:
	dh $@


override_dh_auto_build:
	mkdir -p $(TMP_BUILD)
	make $(EO_VARIANT)

	# ispell stuff
	cp work/$(EO_VARIANT).aff $(TMP_BUILD)/esperanto.aff
	gzip -9n -c work/$(EO_VARIANT).asc > $(TMP_BUILD)/esperanto.mwl.gz

	# --------- myspell stuff for aspell benefit -------
	sed -f debian/hat2latin3.sed $(TMP_BUILD)/esperanto.aff > $(TMP_BUILD)/eo-ispell-l3.aff
	# Prefix used non-alphabetic flags by '\' to be later handled
	# by -e "\\\\" option to ispellaff2myspell.
	# "\" flag is not supported by aspell (triggers error) and so,
	# is replaced by "!" in .aff and .dic files.
	sed -i  -e 's/\\\\/\\!/g' \
		-e 's/_:/\\_:/g' \
		-e 's/`:/\\`/g' \
		-e 's/\^:/\\\^:/g' $(TMP_BUILD)/eo-ispell-l3.aff
	perl debian/process-eo-dic.pl < work/$(EO_VARIANT).asc \
		> $(TMP_BUILD)/eo-latin3.wl
	# header is utf8, but is simpler to convert affix file in
	# latin3 and later recode to utf8 and append to header.
	ispellaff2myspell --charset=latin3 \
		-e "\\\\" \
		--myheader=debian/eo_ALL.header \
		--replacements=debian/eo_ALL.replaces \
		$(TMP_BUILD)/eo-ispell-l3.aff > $(TMP_BUILD)/eo.aff
	( echo `cat $(TMP_BUILD)/eo-latin3.wl | wc -l`; cat $(TMP_BUILD)/eo-latin3.wl ) \
		> $(TMP_BUILD)/eo.dic

	# Copy aspell affix file with preferred name and prepare .cwl
	cat $(TMP_BUILD)/eo-latin3.wl \
		| prezip -s -c \
		| gzip -9n -c > $(TMP_BUILD)/eo.cwl.gz
	cp  $(TMP_BUILD)/eo.aff $(TMP_BUILD)/eo_affix.dat

	# Build esperanto wordlist
	cat work/$(EO_VARIANT).asc \
		| ispell -d ./work/$(EO_VARIANT) -e \
		| sed -f debian/hat2utf8.sed \
		| tr -s ' ' '\n' \
		| LC_ALL=C sort -uf  > $(TMP_BUILD)/esperanto
#	unmunch $(TMP_BUILD)/eo.dic $(TMP_BUILD)/eo.aff \
#		| iconv -f iso-8859-3 -t utf-8 \
#		| LC_ALL=C sort -uf  > $(TMP_BUILD)/esperanto

	# Build stuff for aspell cx pseudocharset
	sed -f debian/utf8-2-cx.sed $(TMP_BUILD)/esperanto \
		| sort -u > $(TMP_BUILD)/eo-cx.wl
	cat $(TMP_BUILD)/eo-cx.wl \
		| perl -ne 'print unless /[^[:ascii:]]/' \
		| grep -v -e "-'$$" \
		| prezip -s -c \
		| gzip -9n -c > $(TMP_BUILD)/eo-cx.cwl.gz

override_dh_auto_clean:
	rm -rf $(TMP_BUILD)
	rm -f eo.hash kune.txt.cnt kune.txt.stat
	if [ -d $(ASPELL6DIR) ]; then \
		rm $(ASPELL6DIR)/* && rmdir $(ASPELL6DIR); fi

	dh_auto_clean

override_dh_auto_install:
	installdeb-ispell   -piesperanto
	installdeb-aspell   -paspell-eo
	installdeb-aspell   -paspell-eo-cx7
	installdeb-wordlist -pwesperanto
	dh_install

# Useful only to build aspell official dir
aspelltgz: clean build
	mkdir -p $(ASPELL6DIR)
	install -m 644 debian/aspell/Copyright $(ASPELL6DIR)
	install -m 644 debian/aspell/info $(ASPELL6DIR)
	install -m 644 debian/aspell/eo.dat $(ASPELL6DIR)
	install -m 644 $(TMP_BUILD)/README.ispell $(TMP_BUILD)/legumin.l3.ispell $(ASPELL6DIR)
	install -m 644 debian/README.aspell $(ASPELL6DIR)/README
	install -m 644$(TMP_BUILD)/eo.aff $(ASPELL6DIR)/eo_affix.dat
	cat $(TMP_BUILD)/eo.dic | sed 1d | LC_COLLATE=C sort -u | \
		aspell --local-data-dir=$(ASPELL6DIR) --lang=eo  clean > $(ASPELL6DIR)/eo.wl
	( cd $(ASPELL6DIR) && \
		ln -sf $(ASPELLPROC) proc && \
		perl proc && \
		./configure && \
		make dist )
	mv $(ASPELL6DIR)/$(ASPELL6BASENAME)*.tar.bz2 ..