blob: df608e1b7faa7dc70ecbf7281579fa6007948db5 [file] [log] [blame]
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001# Aap recipe for German Vim spell files.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00002#
3# Since there is a big discussion about whether to use the old or the new
4# spelling rules, both have been included.
5# "de": all possible words allowed
6# "de_de": old and new German spelling
7# "de_19": old German spelling
8# "de_20": new German spelling
9# "de_AT": Austrian spelling
10# "de_CH": Swiss spelling
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000011
12# Use a freshly compiled Vim if it exists.
13@if os.path.exists('../../../src/vim'):
14 VIM = ../../../src/vim
15@else:
Bram Moolenaar78984f52005-08-01 07:19:10 +000016 :progsearch VIM vim
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000017
Bram Moolenaarae5bce12005-08-15 21:41:48 +000018REGIONS = DE 19 20 AT CH
19DE_REGIONS = de_$*REGIONS
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000020
Bram Moolenaarae5bce12005-08-15 21:41:48 +000021SPELLDIR = ..
22FILES = de_$*(REGIONS).aff de_$*(REGIONS).dic
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000023
Bram Moolenaarae5bce12005-08-15 21:41:48 +000024ZIPFILE_DE = de_DE_comb.zip
25ZIPFILE_19 = de_DE.zip
26ZIPFILE_20 = de_DE_neu.zip
27ZIPFILE_AT = de_AT.zip
28ZIPFILE_CH = de_CH.zip
29ZIPFILES = $ZIPFILE_DE $ZIPFILE_19 $ZIPFILE_20 $ZIPFILE_AT $ZIPFILE_CH
30
31READMES = README_de_$*(REGIONS).txt
32
33all: $SPELLDIR/de.latin1.spl $SPELLDIR/de.utf-8.spl ../README_de.txt
34
35$SPELLDIR/de.latin1.spl : $VIM $FILES
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000036 :sys env LANG=de_DE.ISO8859-1
Bram Moolenaarae5bce12005-08-15 21:41:48 +000037 $VIM -u NONE -e -c "mkspell! $SPELLDIR/de $DE_REGIONS" -c q
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000038
Bram Moolenaarae5bce12005-08-15 21:41:48 +000039$SPELLDIR/de.utf-8.spl : $VIM $FILES
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000040 :sys env LANG=de_DE.UTF-8
Bram Moolenaarae5bce12005-08-15 21:41:48 +000041 $VIM -u NONE -e -c "mkspell! $SPELLDIR/de $DE_REGIONS" -c q
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000042
Bram Moolenaarae5bce12005-08-15 21:41:48 +000043../README_de.txt: $READMES
44 :print de_DE (combined) >! $target
45 :cat README_de_DE.txt >> $target
46 :print =================================================== >>$target
47 :print de_19 (old) >> $target
48 :cat README_de_19.txt >> $target
49 :print =================================================== >>$target
50 :print de_20 (new) >> $target
51 :cat README_de_20.txt >> $target
52 :print =================================================== >>$target
53 :print de_AT (Austria) >> $target
54 :cat README_de_AT.txt >> $target
55 :print =================================================== >>$target
56 :print de_CH (Swiss) >> $target
57 :cat README_de_CH.txt >> $target
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000058
59#
60# Fetching the files from OpenOffice.org.
61#
62OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
Bram Moolenaarae5bce12005-08-15 21:41:48 +000063:attr {fetch = $OODIR/%file%} $ZIPFILES
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000064
65# The files don't depend on the .zip file so that we can delete it.
66# Only download the zip file if the targets don't exist.
67de_DE.aff de_DE.dic: {buildcheck=}
68 :assertpkg unzip patch
Bram Moolenaarae5bce12005-08-15 21:41:48 +000069 :fetch $ZIPFILE_DE
70 :sys $UNZIP $ZIPFILE_DE
71 :delete $ZIPFILE_DE
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000072 :move de_DE_comb.aff de_DE.aff
73 :move de_DE_comb.dic de_DE.dic
Bram Moolenaarae5bce12005-08-15 21:41:48 +000074 :move README_de_DE_comb.txt README_de_DE.txt
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000075 @if not os.path.exists('de_DE.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000076 :copy de_DE.aff de_DE.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000077 @if not os.path.exists('de_DE.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000078 :copy de_DE.dic de_DE.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000079 @if os.path.exists('de_DE.diff'):
80 :sys patch <de_DE.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000081
Bram Moolenaarae5bce12005-08-15 21:41:48 +000082de_19.aff de_19.dic: {buildcheck=}
83 :assertpkg unzip patch
84 :fetch $ZIPFILE_19
85 # Move the other files out of the way.
86 @if os.path.exists("de_DE.aff"):
87 :move de_DE.aff de_DE_comb.aff
88 :move de_DE.dic de_DE_comb.dic
89 :move README_de_DE.txt README_de_DE_comb.txt
90
91 :sys $UNZIP $ZIPFILE_19
92 :delete $ZIPFILE_19
93 :delete {f} de_AT.dic
94 :move de_DE.aff de_19.aff
95 :move de_DE.dic de_19.dic
96 :move README_de_DE.txt README_de_19.txt
97
98 @if os.path.exists("de_DE_comb.aff"):
99 :move de_DE_comb.aff de_DE.aff
100 :move de_DE_comb.dic de_DE.dic
101 :move README_de_DE_comb.txt README_de_DE.txt
102 @if not os.path.exists('de_19.orig.aff'):
103 :copy de_19.aff de_19.orig.aff
104 @if not os.path.exists('de_19.orig.dic'):
105 :copy de_19.dic de_19.orig.dic
106 @if os.path.exists('de_19.diff'):
107 :sys patch <de_19.diff
108
109de_20.aff de_20.dic: {buildcheck=}
110 :assertpkg unzip patch
111 :fetch $ZIPFILE_20
112 :sys $UNZIP $ZIPFILE_20
113 :delete $ZIPFILE_20
114 :move de_DE_neu.aff de_20.aff
115 :move de_DE_neu.dic de_20.dic
116 :move README_de_DE_neu.txt README_de_20.txt
117 @if not os.path.exists('de_20.orig.aff'):
118 :copy de_20.aff de_20.orig.aff
119 @if not os.path.exists('de_20.orig.dic'):
120 :copy de_20.dic de_20.orig.dic
121 @if os.path.exists('de_20.diff'):
122 :sys patch <de_20.diff
123
124# It appears de_AT.dic is only an additional file for another word list. We
125# guess it's the old spelling one and concatenate them. Complication is that
126# de_AT.dic is missing a newline at the end.
127de_AT.aff de_AT.dic: {buildcheck=} de_19.dic
128 :assertpkg unzip patch
129 :fetch $ZIPFILE_AT
130 :sys $UNZIP $ZIPFILE_AT
131 :delete $ZIPFILE_AT
132 :print >>de_AT.dic
133 :cat de_19.dic >>de_AT.dic
134 @if not os.path.exists('de_AT.orig.aff'):
135 :copy de_AT.aff de_AT.orig.aff
136 @if not os.path.exists('de_AT.orig.dic'):
137 :copy de_AT.dic de_AT.orig.dic
138 @if os.path.exists('de_AT.diff'):
139 :sys patch <de_AT.diff
140
141de_CH.aff de_CH.dic: {buildcheck=}
142 :assertpkg unzip patch
143 :fetch $ZIPFILE_CH
144 :sys $UNZIP $ZIPFILE_CH
145 :delete $ZIPFILE_CH
146 @if not os.path.exists('de_CH.orig.aff'):
147 :copy de_CH.aff de_CH.orig.aff
148 @if not os.path.exists('de_CH.orig.dic'):
149 :copy de_CH.dic de_CH.orig.dic
150 @if os.path.exists('de_CH.diff'):
151 :sys patch <de_CH.diff
152
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000153
154# Generate diff files, so that others can get the OpenOffice files and apply
155# the diffs to get the Vim versions.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000156diff:
157 :assertpkg diff
158 :sys {force} diff -a -C 1 de_DE.orig.aff de_DE.aff >de_DE.diff
159 :sys {force} diff -a -C 1 de_DE.orig.dic de_DE.dic >>de_DE.diff
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000160 :sys {force} diff -a -C 1 de_19.orig.aff de_19.aff >de_19.diff
161 :sys {force} diff -a -C 1 de_19.orig.dic de_19.dic >>de_19.diff
162 :sys {force} diff -a -C 1 de_20.orig.aff de_20.aff >de_20.diff
163 :sys {force} diff -a -C 1 de_20.orig.dic de_20.dic >>de_20.diff
164 :sys {force} diff -a -C 1 de_AT.orig.aff de_AT.aff >de_AT.diff
165 :sys {force} diff -a -C 1 de_AT.orig.dic de_AT.dic >>de_AT.diff
166 :sys {force} diff -a -C 1 de_CH.orig.aff de_CH.aff >de_CH.diff
167 :sys {force} diff -a -C 1 de_CH.orig.dic de_CH.dic >>de_CH.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000168
169
170# Check for updated OpenOffice spell files. When there are changes the
171# ".new.aff" and ".new.dic" files are left behind for manual inspection.
172
173check:
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000174 :print TODO!!!!
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000175 :assertpkg unzip diff
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000176 :fetch $ZIPFILE_DE
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000177 :mkdir tmp
178 :cd tmp
179 @try:
180 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000181 :sys $UNZIP ../$ZIPFILE_DE
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000182 :move de_DE_comb.aff de_DE.aff
183 :move de_DE_comb.dic de_DE.dic
184 :sys {force} diff ../de_DE.orig.aff de_DE.aff >d
185 @if os.stat('d')[stat.ST_SIZE] > 0:
186 :copy de_DE.aff ../de_DE.new.aff
187 :sys {force} diff ../de_DE.orig.dic de_DE.dic >d
188 @if os.stat('d')[stat.ST_SIZE] > 0:
189 :copy de_DE.dic ../de_DE.new.dic
190 @finally:
191 :cd ..
192 :delete {r}{f}{q} tmp
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000193 :delete $ZIPFILE_DE
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000194
195
196# vim: set sts=4 sw=4 :