File: rules

package info (click to toggle)
ispellcat 0.6-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,480 kB
  • ctags: 5
  • sloc: makefile: 78; perl: 44; sed: 25; sh: 4
file content (128 lines) | stat: -rwxr-xr-x 4,221 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

ADICT_DIR=$(CURDIR)/debian/aspell-ca
IDICT_DIR=$(CURDIR)/debian/icatalan
MDICT_DIR=$(CURDIR)/debian/myspell-ca
WORDS_DIR=$(CURDIR)/debian/wcatalan

build: build-stamp
build-stamp:
	dh_testdir

	chmod +x debian/strip_mwl

        # Substitute UTF-8 encoded chars
	sed -f debian/utf-8.sed catalan-i.aff > catalan-i.debian.aff

#	This generates the icatalan hash file.
#	As of ispellcat 0.5-3, the ispell has is autogenerated at
#	install time. The .hash is still needed here for wcatalan.
	buildhash catalan-i.dic catalan-i.debian.aff catala.debian.hash
	gzip --best -c catalan-i.dic > catala.mwl.gz

#	This generates the wcatalan wordlist.
	debian/strip_mwl | ispell -d $(CURDIR)/catala.debian -e | \
		tr -s ' ' '\n' | grep -v ^[0-9] | sort -u > catala.words.debian

#	Filter extraneous U+0095 characters to U+00B7, which is the correct middle dot character.
	cat catalan-m.dic | tr '\225' '\267' > catalan-m.dic.fixed
	@if cmp catalan-m.dic catalan-m.dic.fixed 2>&1 > /dev/null; then \
		echo "  **WARNING**: catalan-m.dic and catalan-m.dic.fixed are already the same"; fi

#	Fix some buggy aspell flag entries
	perl -f debian/filter_aspell_aff < catalan-m.aff > catalan-m.aff.fixed

#	This generates aspell-ca stuff.
#	As of ispellcat 0.4-5, the aspell hash is autogenerated at
#	install time.
#	ln -s debian/ca.dat .
#	cat catala.words.debian | \
#		aspell --local-data-dir=$(CURDIR) --lang=ca \
#			create master ./ca.rws
#	prezip -c catalan-m.dic | gzip -c > ca.cwl.gz
	LANG=C sort catalan-m.dic.fixed | \
		grep -v -e ^[a-zA-Z]*[0-9] -e '\.' | \
		prezip -s -c | gzip --best -c > ca.cwl.gz

	echo "add ca.rws" > ca.multi
	echo "add ca.multi" > catalan.alias
	echo "add ca.multi" > catala.alias
	echo "add ca.multi" > català.alias

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	rm -f catalan-i.debian.aff
	rm -f catala.debian.hash catalan-i.dic.stat catalan-i.dic.cnt
	rm -f catalan-m.dic.fixed catalan-m.aff.fixed
	rm -f catala.words.debian
	rm -f ca.rws ca.dat
	rm -f ca.multi catalan.alias catala.alias català.alias
	rm -f ca.cwl.gz catala.mwl.gz

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# icatalan stuff
#	install -m 644 catala.debian.hash $(IDICT_DIR)/usr/lib/ispell/catala.hash
	install -m 644 catala.mwl.gz $(IDICT_DIR)/usr/share/ispell
	install -m 644 catalan-i.debian.aff $(IDICT_DIR)/usr/lib/ispell/catala.aff
	touch $(IDICT_DIR)/var/lib/ispell/catala.compat
	touch $(IDICT_DIR)/var/lib/ispell/catala.hash

	# wcatalan stuff
	install -m 644 catala.words.debian $(WORDS_DIR)/usr/share/dict/catala

	# aspell-ca stuff
	install -m 644 ca.cwl.gz $(ADICT_DIR)/usr/share/aspell
	install -m 644 debian/ca.dat $(ADICT_DIR)/usr/lib/aspell/ca.dat
	install -m 644 catalan-m.aff.fixed $(ADICT_DIR)/usr/lib/aspell/ca_affix.dat
	install -m 644 ca.multi $(ADICT_DIR)/usr/lib/aspell/ca.multi
	install -m 644 catalan.alias $(ADICT_DIR)/usr/lib/aspell/catalan.alias
	install -m 644 catala.alias $(ADICT_DIR)/usr/lib/aspell/catala.alias
	install -m 644 català.alias $(ADICT_DIR)/usr/lib/aspell/català.alias
	touch $(ADICT_DIR)/var/lib/aspell/ca.rws
	touch $(ADICT_DIR)/var/lib/aspell/ca.compat

#	install -m 644 ca_phonet.dat $(ADICT_DIR)/usr/lib/aspell/ca_phonet.dat

	# myspell-ca stuff
	install -m 644 catalan-m.dic.fixed $(MDICT_DIR)/usr/share/myspell/dicts/ca_ES.dic
	install -m 644 catalan-m.aff.fixed $(MDICT_DIR)/usr/share/myspell/dicts/ca_ES.aff
#	install -m 644 debian/myspell-ca.info-myspell $(MDICT_DIR)/usr/share/myspell/infos/ooo/myspell-ca

binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	installdeb-aspell -paspell-ca
	installdeb-ispell -picatalan
	installdeb-myspell -pmyspell-ca
	installdeb-wordlist -pwcatalan
	dh_installdebconf -paspell-ca
	dh_link -i
	dh_installchangelogs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i -Xvar/lib/aspell -Xvar/lib/ispell
	dh_builddeb -i

binary-arch: build install

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install