blob: 09ae228be6449f6cea3d40218a11ba74147538ad [file] [log] [blame]
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001# Aap recipe for English Vim spell files.
2
3# Use a freshly compiled Vim if it exists.
4@if os.path.exists('../../../src/vim'):
5 VIM = ../../../src/vim
6@else:
Bram Moolenaar78984f52005-08-01 07:19:10 +00007 :progsearch VIM vim
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00008
9SPELLDIR = ..
10FILES = en_US.aff en_US.dic
11 en_AU.aff en_AU.dic
12 en_CA.aff en_CA.dic
13 en_GB.aff en_GB.dic
14 en_NZ.aff en_NZ.dic
15
Bram Moolenaarae5bce12005-08-15 21:41:48 +000016all: $SPELLDIR/en.latin1.spl $SPELLDIR/en.utf-8.spl \
17 $SPELLDIR/en.ascii.spl ../README_en.txt
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000018
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000019$SPELLDIR/en.latin1.spl : $FILES
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000020 :sys env LANG=en_US.ISO8859-1
Bram Moolenaarae5bce12005-08-15 21:41:48 +000021 $VIM -u NONE -e -c "mkspell! $SPELLDIR/en
Bram Moolenaar661b1822005-07-28 22:36:45 +000022 en_US en_AU en_CA en_GB en_NZ" -c q
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000023
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000024$SPELLDIR/en.utf-8.spl : $FILES
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000025 :sys env LANG=en_US.UTF-8
Bram Moolenaarae5bce12005-08-15 21:41:48 +000026 $VIM -u NONE -e -c "mkspell! $SPELLDIR/en
Bram Moolenaar661b1822005-07-28 22:36:45 +000027 en_US en_AU en_CA en_GB en_NZ" -c q
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000028
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000029$SPELLDIR/en.ascii.spl : $FILES
Bram Moolenaarae5bce12005-08-15 21:41:48 +000030 :sys $VIM -u NONE -e -c "mkspell! -ascii $SPELLDIR/en
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000031 en_US en_AU en_CA en_GB en_NZ" -c q
32
Bram Moolenaarcc7ff3f2015-12-30 19:13:24 +010033../README_en.txt: README_en_US.txt README_en_AU.txt README_en_CA.txt README_en_GB.txt README_en_NZ.txt
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000034 :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
48
49#
50# Fetching the files from OpenOffice.org.
Bram Moolenaarcc7ff3f2015-12-30 19:13:24 +010051# THIS URL NO LONGER WORKS.
52#
Bram Moolenaara61018d2016-01-07 16:19:13 +010053# Files for en_US, en_CA and en_GB can be obtained from:
Bram Moolenaarcc7ff3f2015-12-30 19:13:24 +010054# github.com/marcoagpinto/aoo-mozilla-en-dict
Bram Moolenaara61018d2016-01-07 16:19:13 +010055# Unfortunately, giving suggestions becomes terribly slow with these.
56# TODO: find out why suggestions are slow and fix that.
Bram Moolenaarcc7ff3f2015-12-30 19:13:24 +010057#
Bram Moolenaara61018d2016-01-07 16:19:13 +010058# For now we use the older libraries.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000059#
60OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
Bram Moolenaarae5bce12005-08-15 21:41:48 +000061:attr {fetch = $OODIR/%file%} en_US.zip en_CA.zip en_NZ.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000062 en_GB.zip en_AU.zip
63
64# The files don't depend on the .zip file so that we can delete it.
65# Only download the zip file if the targets don't exist.
66en_US.aff en_US.dic: {buildcheck=}
67 :assertpkg unzip patch
68 :fetch en_US.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000069 :sys $UNZIP en_US.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000070 :delete en_US.zip
71 @if not os.path.exists('en_US.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000072 :copy en_US.aff en_US.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000073 @if not os.path.exists('en_US.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000074 :copy en_US.dic en_US.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000075 @if os.path.exists('en_US.diff'):
76 :sys patch <en_US.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000077
78en_AU.aff en_AU.dic: {buildcheck=}
79 :assertpkg unzip patch
80 :fetch en_AU.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000081 :sys $UNZIP en_AU.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000082 :delete en_AU.zip
83 @if not os.path.exists('en_AU.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000084 :copy en_AU.aff en_AU.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000085 @if not os.path.exists('en_AU.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000086 :copy en_AU.dic en_AU.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000087 @if os.path.exists('en_AU.diff'):
88 :sys patch <en_AU.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000089
90en_CA.aff en_CA.dic: {buildcheck=}
91 :assertpkg unzip patch
92 :fetch en_CA.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000093 :sys $UNZIP en_CA.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000094 :delete en_CA.zip
95 @if not os.path.exists('en_CA.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000096 :copy en_CA.aff en_CA.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000097 @if not os.path.exists('en_CA.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000098 :copy en_CA.dic en_CA.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000099 @if os.path.exists('en_CA.diff'):
100 :sys patch <en_CA.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000101
102en_GB.aff en_GB.dic: {buildcheck=}
103 :assertpkg unzip patch
104 :fetch en_GB.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000105 :sys $UNZIP en_GB.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000106 :delete en_GB.zip
107 :delete dictionary.lst.example
108 @if not os.path.exists('en_GB.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000109 :copy en_GB.aff en_GB.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000110 @if not os.path.exists('en_GB.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000111 :copy en_GB.dic en_GB.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +0000112 @if os.path.exists('en_GB.diff'):
113 :sys patch <en_GB.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000114
115en_NZ.aff en_NZ.dic: {buildcheck=}
116 :assertpkg unzip patch
117 :fetch en_NZ.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000118 :sys $UNZIP en_NZ.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000119 :delete en_NZ.zip
120 @if not os.path.exists('en_NZ.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000121 :copy en_NZ.aff en_NZ.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000122 @if not os.path.exists('en_NZ.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000123 :copy en_NZ.dic en_NZ.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +0000124 @if os.path.exists('en_NZ.diff'):
125 :sys patch <en_NZ.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000126
127
Bram Moolenaarcc7ff3f2015-12-30 19:13:24 +0100128# Generate diff files, so that others can get the original files and apply
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000129# the diffs to get the Vim versions.
130
131diff:
132 :assertpkg diff
133 :sys {force} diff -a -C 1 en_US.orig.aff en_US.aff >en_US.diff
134 :sys {force} diff -a -C 1 en_US.orig.dic en_US.dic >>en_US.diff
135 :sys {force} diff -a -C 1 en_AU.orig.aff en_AU.aff >en_AU.diff
136 :sys {force} diff -a -C 1 en_AU.orig.dic en_AU.dic >>en_AU.diff
137 :sys {force} diff -a -C 1 en_CA.orig.aff en_CA.aff >en_CA.diff
138 :sys {force} diff -a -C 1 en_CA.orig.dic en_CA.dic >>en_CA.diff
139 :sys {force} diff -a -C 1 en_GB.orig.aff en_GB.aff >en_GB.diff
140 :sys {force} diff -a -C 1 en_GB.orig.dic en_GB.dic >>en_GB.diff
141 :sys {force} diff -a -C 1 en_NZ.orig.aff en_NZ.aff >en_NZ.diff
142 :sys {force} diff -a -C 1 en_NZ.orig.dic en_NZ.dic >>en_NZ.diff
143
144
145# Check for updated OpenOffice spell files. When there are changes the
146# ".new.aff" and ".new.dic" files are left behind for manual inspection.
147
148check: check-us check-au check-ca check-gb check-nz
149
150check-us:
151 :assertpkg unzip diff
152 :fetch en_US.zip
153 :mkdir tmp
154 :cd tmp
155 @try:
156 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000157 :sys $UNZIP ../en_US.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000158 :sys {force} diff ../en_US.orig.aff en_US.aff >d
159 @if os.stat('d')[stat.ST_SIZE] > 0:
160 :copy en_US.aff ../en_US.new.aff
161 :sys {force} diff ../en_US.orig.dic en_US.dic >d
162 @if os.stat('d')[stat.ST_SIZE] > 0:
163 :copy en_US.dic ../en_US.new.dic
164 @finally:
165 :cd ..
166 :delete {r}{f}{q} tmp
167 :delete en_US.zip
168
169check-au:
170 :assertpkg unzip diff
171 :fetch en_AU.zip
172 :mkdir tmp
173 :cd tmp
174 @try:
175 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000176 :sys $UNZIP ../en_AU.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000177 :sys {force} diff ../en_AU.orig.aff en_AU.aff >d
178 @if os.stat('d')[stat.ST_SIZE] > 0:
179 :copy en_AU.aff ../en_AU.new.aff
180 :sys {force} diff ../en_AU.orig.dic en_AU.dic >d
181 @if os.stat('d')[stat.ST_SIZE] > 0:
182 :copy en_AU.dic ../en_AU.new.dic
183 @finally:
184 :cd ..
185 :delete {r}{f}{q} tmp
186 :delete en_AU.zip
187
188check-ca:
189 :assertpkg unzip diff
190 :fetch en_CA.zip
191 :mkdir tmp
192 :cd tmp
193 @try:
194 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000195 :sys $UNZIP ../en_CA.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000196 :sys {force} diff ../en_CA.orig.aff en_CA.aff >d
197 @if os.stat('d')[stat.ST_SIZE] > 0:
198 :copy en_CA.aff ../en_CA.new.aff
199 :sys {force} diff ../en_CA.orig.dic en_CA.dic >d
200 @if os.stat('d')[stat.ST_SIZE] > 0:
201 :copy en_CA.dic ../en_CA.new.dic
202 @finally:
203 :cd ..
204 :delete {r}{f}{q} tmp
205 :delete en_CA.zip
206
207check-gb:
208 :assertpkg unzip diff
209 :fetch en_GB.zip
210 :mkdir tmp
211 :cd tmp
212 @try:
213 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000214 :sys $UNZIP ../en_GB.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000215 :sys {force} diff ../en_GB.orig.aff en_GB.aff >d
216 @if os.stat('d')[stat.ST_SIZE] > 0:
217 :copy en_GB.aff ../en_GB.new.aff
218 :sys {force} diff ../en_GB.orig.dic en_GB.dic >d
219 @if os.stat('d')[stat.ST_SIZE] > 0:
220 :copy en_GB.dic ../en_GB.new.dic
221 @finally:
222 :cd ..
223 :delete {r}{f}{q} tmp
224 :delete en_GB.zip
225
226check-nz:
227 :assertpkg unzip diff
228 :fetch en_NZ.zip
229 :mkdir tmp
230 :cd tmp
231 @try:
232 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000233 :sys $UNZIP ../en_NZ.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000234 :sys {force} diff ../en_NZ.orig.aff en_NZ.aff >d
235 @if os.stat('d')[stat.ST_SIZE] > 0:
236 :copy en_NZ.aff ../en_NZ.new.aff
237 :sys {force} diff ../en_NZ.orig.dic en_NZ.dic >d
238 @if os.stat('d')[stat.ST_SIZE] > 0:
239 :copy en_NZ.dic ../en_NZ.new.dic
240 @finally:
241 :cd ..
242 :delete {r}{f}{q} tmp
243 :delete en_NZ.zip
244
245# vim: set sts=4 sw=4 :