File: rules

package info (click to toggle)
espa-nol 1.11-21
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,148 kB
  • sloc: makefile: 103; sh: 73; sed: 30; csh: 6; lisp: 3
file content (93 lines) | stat: -rwxr-xr-x 2,876 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
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
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# 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-es
ASPELL6DIR      = $(CURDIR)/debian/$(ASPELL6BASENAME)
ASPELLPROC      = /usr/share/aspell-lang/proc    # Location of proc script

TMP_BUILD       = tmp-build

LANGUAGE	= espa~nol
ISOLANG		= es
AFFIXES		= ./$(LANGUAGE).aff
OTHERDICTS	= debian/debian.words

%:
	dh $@


override_dh_auto_build:
	mkdir -p $(TMP_BUILD)

	# Create a latin1 version of affix file
	sh -e < debian/aff2latin1 > $(TMP_BUILD)/$(AFFIXES)
	# Munch extra debian words
	munchlist -v -l $(AFFIXES) $(OTHERDICTS) \
		> $(TMP_BUILD)/$(LANGUAGE).otherwords+
	# Merge munched debian words with upstream munched wordlist
	( cat $(LANGUAGE).words+ $(TMP_BUILD)/$(LANGUAGE).otherwords+ && \
		grep  -h -e ^.$$ -e ^./ $(LANGUAGE).words ) | \
		sort | \
		icombine $(AFFIXES) | \
		sed -f debian/orig2latin1.sed \
		> $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1

	gzip -9n -c $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1 \
		> $(TMP_BUILD)/$(LANGUAGE).mwl.gz

	# Create myspell dict
	( echo `cat $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1 | wc -l`; \
		cat $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1 ) \
		> $(TMP_BUILD)/es.dic
	ispellaff2myspell --charset=latin1 \
		--replacements=debian/es_ES.replaces \
		--myheader=debian/es_ES.myheader \
		$(TMP_BUILD)/$(LANGUAGE).aff \
		> $(TMP_BUILD)/es.aff

	# Create aspell compressed cwl file and affix file
	cat $(TMP_BUILD)/$(LANGUAGE).allwords+.latin1 \
		| prezip -s -c | gzip -9n -c \
		> $(TMP_BUILD)/$(ISOLANG).cwl.gz
	cp $(TMP_BUILD)/es.aff $(TMP_BUILD)/es_affix.dat
	echo "add es.rws"    > $(TMP_BUILD)/es.multi
	echo "add es.multi"  > $(TMP_BUILD)/spanish.alias

override_dh_auto_clean:
	rm -rf $(TMP_BUILD)
	rm -f core *.hash *.stat *.cnt *.latin1 *.otherwords+ *~
	if [ -d $(ASPELL6DIR) ]; then \
		rm $(ASPELL6DIR)/* && rmdir $(ASPELL6DIR); fi

	dh_auto_clean

override_dh_auto_install:
	installdeb-ispell   -pispanish
	installdeb-aspell   -paspell-es
	installdeb-hunspell -pmyspell-es
	installdeb-myspell  -pmyspell-es --bdic --srcdir=$(TMP_BUILD)
	dh_installdocs --all README LEAME

# 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 /usr/share/common-licenses/GPL $(ASPELL6DIR)/COPYING
	install -m 644 debian/aspell/es.dat $(ASPELL6DIR)
	install -m 644 $(TMP_BUILD)/es_affix.dat $(ASPELL6DIR)
	cat $(TMP_BUILD)/es.dic | sed 1d | LANG=C sort -u > $(ASPELL6DIR)/es.wl
	( cd $(ASPELL6DIR) && \
		ln -sf $(ASPELLPROC) && \
		perl proc && \
		./configure && \
		make dist )
	mv $(ASPELL6DIR)/$(ASPELL6BASENAME)*.tar.bz2 ..