blob: 9e4b98ea75aa4331154dab123565db3214b2d23a [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
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
48
49#
50# Fetching the files from OpenOffice.org.
51#
52OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
Bram Moolenaarae5bce12005-08-15 21:41:48 +000053:attr {fetch = $OODIR/%file%} en_US.zip en_CA.zip en_NZ.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000054 en_GB.zip en_AU.zip
55
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.
58en_US.aff en_US.dic: {buildcheck=}
59 :assertpkg unzip patch
60 :fetch en_US.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000061 :sys $UNZIP en_US.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000062 :delete en_US.zip
63 @if not os.path.exists('en_US.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000064 :copy en_US.aff en_US.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000065 @if not os.path.exists('en_US.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000066 :copy en_US.dic en_US.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000067 @if os.path.exists('en_US.diff'):
68 :sys patch <en_US.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000069
70en_AU.aff en_AU.dic: {buildcheck=}
71 :assertpkg unzip patch
72 :fetch en_AU.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000073 :sys $UNZIP en_AU.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000074 :delete en_AU.zip
75 @if not os.path.exists('en_AU.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000076 :copy en_AU.aff en_AU.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000077 @if not os.path.exists('en_AU.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000078 :copy en_AU.dic en_AU.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000079 @if os.path.exists('en_AU.diff'):
80 :sys patch <en_AU.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000081
82en_CA.aff en_CA.dic: {buildcheck=}
83 :assertpkg unzip patch
84 :fetch en_CA.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000085 :sys $UNZIP en_CA.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000086 :delete en_CA.zip
87 @if not os.path.exists('en_CA.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000088 :copy en_CA.aff en_CA.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000089 @if not os.path.exists('en_CA.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000090 :copy en_CA.dic en_CA.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000091 @if os.path.exists('en_CA.diff'):
92 :sys patch <en_CA.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000093
94en_GB.aff en_GB.dic: {buildcheck=}
95 :assertpkg unzip patch
96 :fetch en_GB.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000097 :sys $UNZIP en_GB.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000098 :delete en_GB.zip
99 :delete dictionary.lst.example
100 @if not os.path.exists('en_GB.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000101 :copy en_GB.aff en_GB.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000102 @if not os.path.exists('en_GB.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000103 :copy en_GB.dic en_GB.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +0000104 @if os.path.exists('en_GB.diff'):
105 :sys patch <en_GB.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000106
107en_NZ.aff en_NZ.dic: {buildcheck=}
108 :assertpkg unzip patch
109 :fetch en_NZ.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000110 :sys $UNZIP en_NZ.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000111 :delete en_NZ.zip
112 @if not os.path.exists('en_NZ.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000113 :copy en_NZ.aff en_NZ.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000114 @if not os.path.exists('en_NZ.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000115 :copy en_NZ.dic en_NZ.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +0000116 @if os.path.exists('en_NZ.diff'):
117 :sys patch <en_NZ.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000118
119
120# Generate diff files, so that others can get the OpenOffice files and apply
121# the diffs to get the Vim versions.
122
123diff:
124 :assertpkg diff
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
135
136
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.
139
140check: check-us check-au check-ca check-gb check-nz
141
142check-us:
143 :assertpkg unzip diff
144 :fetch en_US.zip
145 :mkdir tmp
146 :cd tmp
147 @try:
148 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000149 :sys $UNZIP ../en_US.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000150 :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
156 @finally:
157 :cd ..
158 :delete {r}{f}{q} tmp
159 :delete en_US.zip
160
161check-au:
162 :assertpkg unzip diff
163 :fetch en_AU.zip
164 :mkdir tmp
165 :cd tmp
166 @try:
167 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000168 :sys $UNZIP ../en_AU.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000169 :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
175 @finally:
176 :cd ..
177 :delete {r}{f}{q} tmp
178 :delete en_AU.zip
179
180check-ca:
181 :assertpkg unzip diff
182 :fetch en_CA.zip
183 :mkdir tmp
184 :cd tmp
185 @try:
186 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000187 :sys $UNZIP ../en_CA.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000188 :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
194 @finally:
195 :cd ..
196 :delete {r}{f}{q} tmp
197 :delete en_CA.zip
198
199check-gb:
200 :assertpkg unzip diff
201 :fetch en_GB.zip
202 :mkdir tmp
203 :cd tmp
204 @try:
205 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000206 :sys $UNZIP ../en_GB.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000207 :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
213 @finally:
214 :cd ..
215 :delete {r}{f}{q} tmp
216 :delete en_GB.zip
217
218check-nz:
219 :assertpkg unzip diff
220 :fetch en_NZ.zip
221 :mkdir tmp
222 :cd tmp
223 @try:
224 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000225 :sys $UNZIP ../en_NZ.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000226 :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
232 @finally:
233 :cd ..
234 :delete {r}{f}{q} tmp
235 :delete en_NZ.zip
236
237# vim: set sts=4 sw=4 :