blob: c60a2c4363684b517e6e64c96998669c4a52c4ad [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#
53# Files for en_US, en_CA and en_GB obtaind from
54# github.com/marcoagpinto/aoo-mozilla-en-dict
55#
56# NOTE: en_AU and en_NZ use older libraries.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000057#
58OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
Bram Moolenaarae5bce12005-08-15 21:41:48 +000059:attr {fetch = $OODIR/%file%} en_US.zip en_CA.zip en_NZ.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000060 en_GB.zip en_AU.zip
61
62# The files don't depend on the .zip file so that we can delete it.
63# Only download the zip file if the targets don't exist.
64en_US.aff en_US.dic: {buildcheck=}
65 :assertpkg unzip patch
66 :fetch en_US.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000067 :sys $UNZIP en_US.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000068 :delete en_US.zip
69 @if not os.path.exists('en_US.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000070 :copy en_US.aff en_US.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000071 @if not os.path.exists('en_US.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000072 :copy en_US.dic en_US.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000073 @if os.path.exists('en_US.diff'):
74 :sys patch <en_US.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000075
76en_AU.aff en_AU.dic: {buildcheck=}
77 :assertpkg unzip patch
78 :fetch en_AU.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000079 :sys $UNZIP en_AU.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000080 :delete en_AU.zip
81 @if not os.path.exists('en_AU.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000082 :copy en_AU.aff en_AU.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000083 @if not os.path.exists('en_AU.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000084 :copy en_AU.dic en_AU.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000085 @if os.path.exists('en_AU.diff'):
86 :sys patch <en_AU.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000087
88en_CA.aff en_CA.dic: {buildcheck=}
89 :assertpkg unzip patch
90 :fetch en_CA.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000091 :sys $UNZIP en_CA.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000092 :delete en_CA.zip
93 @if not os.path.exists('en_CA.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000094 :copy en_CA.aff en_CA.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000095 @if not os.path.exists('en_CA.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000096 :copy en_CA.dic en_CA.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000097 @if os.path.exists('en_CA.diff'):
98 :sys patch <en_CA.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000099
100en_GB.aff en_GB.dic: {buildcheck=}
101 :assertpkg unzip patch
102 :fetch en_GB.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000103 :sys $UNZIP en_GB.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000104 :delete en_GB.zip
105 :delete dictionary.lst.example
106 @if not os.path.exists('en_GB.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000107 :copy en_GB.aff en_GB.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000108 @if not os.path.exists('en_GB.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000109 :copy en_GB.dic en_GB.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +0000110 @if os.path.exists('en_GB.diff'):
111 :sys patch <en_GB.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000112
113en_NZ.aff en_NZ.dic: {buildcheck=}
114 :assertpkg unzip patch
115 :fetch en_NZ.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000116 :sys $UNZIP en_NZ.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000117 :delete en_NZ.zip
118 @if not os.path.exists('en_NZ.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000119 :copy en_NZ.aff en_NZ.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000120 @if not os.path.exists('en_NZ.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000121 :copy en_NZ.dic en_NZ.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +0000122 @if os.path.exists('en_NZ.diff'):
123 :sys patch <en_NZ.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000124
125
Bram Moolenaarcc7ff3f2015-12-30 19:13:24 +0100126# Generate diff files, so that others can get the original files and apply
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000127# the diffs to get the Vim versions.
128
129diff:
130 :assertpkg diff
131 :sys {force} diff -a -C 1 en_US.orig.aff en_US.aff >en_US.diff
132 :sys {force} diff -a -C 1 en_US.orig.dic en_US.dic >>en_US.diff
133 :sys {force} diff -a -C 1 en_AU.orig.aff en_AU.aff >en_AU.diff
134 :sys {force} diff -a -C 1 en_AU.orig.dic en_AU.dic >>en_AU.diff
135 :sys {force} diff -a -C 1 en_CA.orig.aff en_CA.aff >en_CA.diff
136 :sys {force} diff -a -C 1 en_CA.orig.dic en_CA.dic >>en_CA.diff
137 :sys {force} diff -a -C 1 en_GB.orig.aff en_GB.aff >en_GB.diff
138 :sys {force} diff -a -C 1 en_GB.orig.dic en_GB.dic >>en_GB.diff
139 :sys {force} diff -a -C 1 en_NZ.orig.aff en_NZ.aff >en_NZ.diff
140 :sys {force} diff -a -C 1 en_NZ.orig.dic en_NZ.dic >>en_NZ.diff
141
142
143# Check for updated OpenOffice spell files. When there are changes the
144# ".new.aff" and ".new.dic" files are left behind for manual inspection.
145
146check: check-us check-au check-ca check-gb check-nz
147
148check-us:
149 :assertpkg unzip diff
150 :fetch en_US.zip
151 :mkdir tmp
152 :cd tmp
153 @try:
154 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000155 :sys $UNZIP ../en_US.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000156 :sys {force} diff ../en_US.orig.aff en_US.aff >d
157 @if os.stat('d')[stat.ST_SIZE] > 0:
158 :copy en_US.aff ../en_US.new.aff
159 :sys {force} diff ../en_US.orig.dic en_US.dic >d
160 @if os.stat('d')[stat.ST_SIZE] > 0:
161 :copy en_US.dic ../en_US.new.dic
162 @finally:
163 :cd ..
164 :delete {r}{f}{q} tmp
165 :delete en_US.zip
166
167check-au:
168 :assertpkg unzip diff
169 :fetch en_AU.zip
170 :mkdir tmp
171 :cd tmp
172 @try:
173 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000174 :sys $UNZIP ../en_AU.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000175 :sys {force} diff ../en_AU.orig.aff en_AU.aff >d
176 @if os.stat('d')[stat.ST_SIZE] > 0:
177 :copy en_AU.aff ../en_AU.new.aff
178 :sys {force} diff ../en_AU.orig.dic en_AU.dic >d
179 @if os.stat('d')[stat.ST_SIZE] > 0:
180 :copy en_AU.dic ../en_AU.new.dic
181 @finally:
182 :cd ..
183 :delete {r}{f}{q} tmp
184 :delete en_AU.zip
185
186check-ca:
187 :assertpkg unzip diff
188 :fetch en_CA.zip
189 :mkdir tmp
190 :cd tmp
191 @try:
192 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000193 :sys $UNZIP ../en_CA.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000194 :sys {force} diff ../en_CA.orig.aff en_CA.aff >d
195 @if os.stat('d')[stat.ST_SIZE] > 0:
196 :copy en_CA.aff ../en_CA.new.aff
197 :sys {force} diff ../en_CA.orig.dic en_CA.dic >d
198 @if os.stat('d')[stat.ST_SIZE] > 0:
199 :copy en_CA.dic ../en_CA.new.dic
200 @finally:
201 :cd ..
202 :delete {r}{f}{q} tmp
203 :delete en_CA.zip
204
205check-gb:
206 :assertpkg unzip diff
207 :fetch en_GB.zip
208 :mkdir tmp
209 :cd tmp
210 @try:
211 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000212 :sys $UNZIP ../en_GB.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000213 :sys {force} diff ../en_GB.orig.aff en_GB.aff >d
214 @if os.stat('d')[stat.ST_SIZE] > 0:
215 :copy en_GB.aff ../en_GB.new.aff
216 :sys {force} diff ../en_GB.orig.dic en_GB.dic >d
217 @if os.stat('d')[stat.ST_SIZE] > 0:
218 :copy en_GB.dic ../en_GB.new.dic
219 @finally:
220 :cd ..
221 :delete {r}{f}{q} tmp
222 :delete en_GB.zip
223
224check-nz:
225 :assertpkg unzip diff
226 :fetch en_NZ.zip
227 :mkdir tmp
228 :cd tmp
229 @try:
230 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000231 :sys $UNZIP ../en_NZ.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000232 :sys {force} diff ../en_NZ.orig.aff en_NZ.aff >d
233 @if os.stat('d')[stat.ST_SIZE] > 0:
234 :copy en_NZ.aff ../en_NZ.new.aff
235 :sys {force} diff ../en_NZ.orig.dic en_NZ.dic >d
236 @if os.stat('d')[stat.ST_SIZE] > 0:
237 :copy en_NZ.dic ../en_NZ.new.dic
238 @finally:
239 :cd ..
240 :delete {r}{f}{q} tmp
241 :delete en_NZ.zip
242
243# vim: set sts=4 sw=4 :