1 # Aap recipe for English Vim spell files.
3 # Use a freshly compiled Vim if it exists.
4 @if os.path.exists('../../../src/vim'):
10 FILES = en_US.aff en_US.dic
16 all: $SPELLDIR/en.latin1.spl $SPELLDIR/en.utf-8.spl \
17 $SPELLDIR/en.ascii.spl ../README_en.txt
19 $SPELLDIR/en.latin1.spl : $FILES
20 :sys env LANG=en_US.ISO8859-1
21 $VIM -u NONE -e -c "mkspell! $SPELLDIR/en
22 en_US en_AU en_CA en_GB en_NZ" -c q
24 $SPELLDIR/en.utf-8.spl : $FILES
25 :sys env LANG=en_US.UTF-8
26 $VIM -u NONE -e -c "mkspell! $SPELLDIR/en
27 en_US en_AU en_CA en_GB en_NZ" -c q
29 $SPELLDIR/en.ascii.spl : $FILES
30 :sys $VIM -u NONE -e -c "mkspell! -ascii $SPELLDIR/en
31 en_US en_AU en_CA en_GB en_NZ" -c q
33 ../README_en.txt: README_en_US.txt README_en_AU.txt
34 :print en_US >!$target
35 :cat README_en_US.txt | :eval re.sub('\r', '', stdin) >>$target
36 :print =================================================== >>$target
37 :print en_AU: >>$target
38 :cat README_en_AU.txt | :eval re.sub('\r', '', stdin) >>$target
39 :print =================================================== >>$target
40 :print en_CA: >>$target
41 :cat README_en_CA.txt | :eval re.sub('\r', '', stdin) >>$target
42 :print =================================================== >>$target
43 :print en_GB: >>$target
44 :cat README_en_GB.txt | :eval re.sub('\r', '', stdin) >>$target
45 :print =================================================== >>$target
46 :print en_NZ: >>$target
47 :cat README_en_NZ.txt | :eval re.sub('\r', '', stdin) >>$target
50 # Fetching the files from OpenOffice.org.
52 OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
53 :attr {fetch = $OODIR/%file%} en_US.zip en_CA.zip en_NZ.zip
56 # The files don't depend on the .zip file so that we can delete it.
57 # Only download the zip file if the targets don't exist.
58 en_US.aff en_US.dic: {buildcheck=}
59 :assertpkg unzip patch
63 @if not os.path.exists('en_US.orig.aff'):
64 :copy en_US.aff en_US.orig.aff
65 @if not os.path.exists('en_US.orig.dic'):
66 :copy en_US.dic en_US.orig.dic
67 @if os.path.exists('en_US.diff'):
68 :sys patch <en_US.diff
70 en_AU.aff en_AU.dic: {buildcheck=}
71 :assertpkg unzip patch
75 @if not os.path.exists('en_AU.orig.aff'):
76 :copy en_AU.aff en_AU.orig.aff
77 @if not os.path.exists('en_AU.orig.dic'):
78 :copy en_AU.dic en_AU.orig.dic
79 @if os.path.exists('en_AU.diff'):
80 :sys patch <en_AU.diff
82 en_CA.aff en_CA.dic: {buildcheck=}
83 :assertpkg unzip patch
87 @if not os.path.exists('en_CA.orig.aff'):
88 :copy en_CA.aff en_CA.orig.aff
89 @if not os.path.exists('en_CA.orig.dic'):
90 :copy en_CA.dic en_CA.orig.dic
91 @if os.path.exists('en_CA.diff'):
92 :sys patch <en_CA.diff
94 en_GB.aff en_GB.dic: {buildcheck=}
95 :assertpkg unzip patch
99 :delete dictionary.lst.example
100 @if not os.path.exists('en_GB.orig.aff'):
101 :copy en_GB.aff en_GB.orig.aff
102 @if not os.path.exists('en_GB.orig.dic'):
103 :copy en_GB.dic en_GB.orig.dic
104 @if os.path.exists('en_GB.diff'):
105 :sys patch <en_GB.diff
107 en_NZ.aff en_NZ.dic: {buildcheck=}
108 :assertpkg unzip patch
110 :sys $UNZIP en_NZ.zip
112 @if not os.path.exists('en_NZ.orig.aff'):
113 :copy en_NZ.aff en_NZ.orig.aff
114 @if not os.path.exists('en_NZ.orig.dic'):
115 :copy en_NZ.dic en_NZ.orig.dic
116 @if os.path.exists('en_NZ.diff'):
117 :sys patch <en_NZ.diff
120 # Generate diff files, so that others can get the OpenOffice files and apply
121 # the diffs to get the Vim versions.
125 :sys {force} diff -a -C 1 en_US.orig.aff en_US.aff >en_US.diff
126 :sys {force} diff -a -C 1 en_US.orig.dic en_US.dic >>en_US.diff
127 :sys {force} diff -a -C 1 en_AU.orig.aff en_AU.aff >en_AU.diff
128 :sys {force} diff -a -C 1 en_AU.orig.dic en_AU.dic >>en_AU.diff
129 :sys {force} diff -a -C 1 en_CA.orig.aff en_CA.aff >en_CA.diff
130 :sys {force} diff -a -C 1 en_CA.orig.dic en_CA.dic >>en_CA.diff
131 :sys {force} diff -a -C 1 en_GB.orig.aff en_GB.aff >en_GB.diff
132 :sys {force} diff -a -C 1 en_GB.orig.dic en_GB.dic >>en_GB.diff
133 :sys {force} diff -a -C 1 en_NZ.orig.aff en_NZ.aff >en_NZ.diff
134 :sys {force} diff -a -C 1 en_NZ.orig.dic en_NZ.dic >>en_NZ.diff
137 # Check for updated OpenOffice spell files. When there are changes the
138 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
140 check: check-us check-au check-ca check-gb check-nz
143 :assertpkg unzip diff
149 :sys $UNZIP ../en_US.zip
150 :sys {force} diff ../en_US.orig.aff en_US.aff >d
151 @if os.stat('d')[stat.ST_SIZE] > 0:
152 :copy en_US.aff ../en_US.new.aff
153 :sys {force} diff ../en_US.orig.dic en_US.dic >d
154 @if os.stat('d')[stat.ST_SIZE] > 0:
155 :copy en_US.dic ../en_US.new.dic
158 :delete {r}{f}{q} tmp
162 :assertpkg unzip diff
168 :sys $UNZIP ../en_AU.zip
169 :sys {force} diff ../en_AU.orig.aff en_AU.aff >d
170 @if os.stat('d')[stat.ST_SIZE] > 0:
171 :copy en_AU.aff ../en_AU.new.aff
172 :sys {force} diff ../en_AU.orig.dic en_AU.dic >d
173 @if os.stat('d')[stat.ST_SIZE] > 0:
174 :copy en_AU.dic ../en_AU.new.dic
177 :delete {r}{f}{q} tmp
181 :assertpkg unzip diff
187 :sys $UNZIP ../en_CA.zip
188 :sys {force} diff ../en_CA.orig.aff en_CA.aff >d
189 @if os.stat('d')[stat.ST_SIZE] > 0:
190 :copy en_CA.aff ../en_CA.new.aff
191 :sys {force} diff ../en_CA.orig.dic en_CA.dic >d
192 @if os.stat('d')[stat.ST_SIZE] > 0:
193 :copy en_CA.dic ../en_CA.new.dic
196 :delete {r}{f}{q} tmp
200 :assertpkg unzip diff
206 :sys $UNZIP ../en_GB.zip
207 :sys {force} diff ../en_GB.orig.aff en_GB.aff >d
208 @if os.stat('d')[stat.ST_SIZE] > 0:
209 :copy en_GB.aff ../en_GB.new.aff
210 :sys {force} diff ../en_GB.orig.dic en_GB.dic >d
211 @if os.stat('d')[stat.ST_SIZE] > 0:
212 :copy en_GB.dic ../en_GB.new.dic
215 :delete {r}{f}{q} tmp
219 :assertpkg unzip diff
225 :sys $UNZIP ../en_NZ.zip
226 :sys {force} diff ../en_NZ.orig.aff en_NZ.aff >d
227 @if os.stat('d')[stat.ST_SIZE] > 0:
228 :copy en_NZ.aff ../en_NZ.new.aff
229 :sys {force} diff ../en_NZ.orig.dic en_NZ.dic >d
230 @if os.stat('d')[stat.ST_SIZE] > 0:
231 :copy en_NZ.dic ../en_NZ.new.dic
234 :delete {r}{f}{q} tmp
237 # vim: set sts=4 sw=4 :