Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 1 | # Aap recipe for German Vim spell files. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 2 | # |
| 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 Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 11 | |
| 12 | # Use a freshly compiled Vim if it exists. |
| 13 | @if os.path.exists('../../../src/vim'): |
| 14 | VIM = ../../../src/vim |
| 15 | @else: |
Bram Moolenaar | 78984f5 | 2005-08-01 07:19:10 +0000 | [diff] [blame] | 16 | :progsearch VIM vim |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 17 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 18 | REGIONS = DE 19 20 AT CH |
| 19 | DE_REGIONS = de_$*REGIONS |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 20 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 21 | SPELLDIR = .. |
| 22 | FILES = de_$*(REGIONS).aff de_$*(REGIONS).dic |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 23 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 24 | ZIPFILE_DE = de_DE_comb.zip |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 25 | ZIPFILE_19 = de_OLDSPELL.zip |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 26 | ZIPFILE_20 = de_DE_neu.zip |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 27 | ZIPFILE_AT = de_DE.zip |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 28 | ZIPFILE_CH = de_CH.zip |
| 29 | ZIPFILES = $ZIPFILE_DE $ZIPFILE_19 $ZIPFILE_20 $ZIPFILE_AT $ZIPFILE_CH |
| 30 | |
| 31 | READMES = README_de_$*(REGIONS).txt |
| 32 | |
| 33 | all: $SPELLDIR/de.latin1.spl $SPELLDIR/de.utf-8.spl ../README_de.txt |
| 34 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 35 | $SPELLDIR/de.latin1.spl : $FILES |
Bram Moolenaar | 9c754c4 | 2010-07-10 15:52:35 +0200 | [diff] [blame] | 36 | :sys env LANG=de_DE.ISO-8859-1 |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 37 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/de $DE_REGIONS" -c q |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 38 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 39 | $SPELLDIR/de.utf-8.spl : $FILES |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 40 | :sys env LANG=de_DE.UTF-8 |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 41 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/de $DE_REGIONS" -c q |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 42 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 43 | ../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 Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 58 | |
| 59 | # |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 60 | # Fetching the files from the OpenOffice.org site. |
| 61 | # The OLDSPELL file comes from elsewhere |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 62 | # |
| 63 | OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 64 | DEDIR = http://www.j3e.de/myspell |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 65 | :attr {fetch = $OODIR/%file%} $ZIPFILES |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 66 | :attr {fetch = $DEDIR/%file%} $ZIPFILE_19 |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 67 | |
| 68 | # The files don't depend on the .zip file so that we can delete it. |
| 69 | # Only download the zip file if the targets don't exist. |
| 70 | de_DE.aff de_DE.dic: {buildcheck=} |
| 71 | :assertpkg unzip patch |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 72 | :fetch $ZIPFILE_DE |
| 73 | :sys $UNZIP $ZIPFILE_DE |
| 74 | :delete $ZIPFILE_DE |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 75 | :move de_DE_comb.aff de_DE.aff |
| 76 | :move de_DE_comb.dic de_DE.dic |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 77 | :move README_de_DE_comb.txt README_de_DE.txt |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 78 | @if not os.path.exists('de_DE.orig.aff'): |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 79 | :copy de_DE.aff de_DE.orig.aff |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 80 | @if not os.path.exists('de_DE.orig.dic'): |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 81 | :copy de_DE.dic de_DE.orig.dic |
Bram Moolenaar | 78984f5 | 2005-08-01 07:19:10 +0000 | [diff] [blame] | 82 | @if os.path.exists('de_DE.diff'): |
| 83 | :sys patch <de_DE.diff |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 84 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 85 | de_19.aff de_19.dic: {buildcheck=} |
| 86 | :assertpkg unzip patch |
| 87 | :fetch $ZIPFILE_19 |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 88 | :sys $UNZIP $ZIPFILE_19 |
| 89 | :delete $ZIPFILE_19 |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 90 | :move de_OLDSPELL.aff de_19.aff |
| 91 | :move de_OLDSPELL.dic de_19.dic |
| 92 | # there is no README file |
| 93 | :print There is no README file for the old spelling >!README_de_19.txt |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 94 | @if not os.path.exists('de_19.orig.aff'): |
| 95 | :copy de_19.aff de_19.orig.aff |
| 96 | @if not os.path.exists('de_19.orig.dic'): |
| 97 | :copy de_19.dic de_19.orig.dic |
| 98 | @if os.path.exists('de_19.diff'): |
| 99 | :sys patch <de_19.diff |
| 100 | |
| 101 | de_20.aff de_20.dic: {buildcheck=} |
| 102 | :assertpkg unzip patch |
| 103 | :fetch $ZIPFILE_20 |
| 104 | :sys $UNZIP $ZIPFILE_20 |
| 105 | :delete $ZIPFILE_20 |
| 106 | :move de_DE_neu.aff de_20.aff |
| 107 | :move de_DE_neu.dic de_20.dic |
| 108 | :move README_de_DE_neu.txt README_de_20.txt |
| 109 | @if not os.path.exists('de_20.orig.aff'): |
| 110 | :copy de_20.aff de_20.orig.aff |
| 111 | @if not os.path.exists('de_20.orig.dic'): |
| 112 | :copy de_20.dic de_20.orig.dic |
| 113 | @if os.path.exists('de_20.diff'): |
| 114 | :sys patch <de_20.diff |
| 115 | |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 116 | # The de_AT.dic is included in de_DE.zip. We rename the files and concatenate |
| 117 | # them. Complication is that de_AT.dic is missing a newline at the end. |
| 118 | # And the de_DE.dic file is used for something else. |
| 119 | de_AT.aff de_AT.dic: {buildcheck=} |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 120 | :assertpkg unzip patch |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 121 | |
| 122 | # Move de_DE files out of the way. |
| 123 | @if os.path.exists('de_DE.aff'): |
| 124 | :move de_DE.aff de_DE.temp.aff |
| 125 | @if os.path.exists('de_DE.dic'): |
| 126 | :move de_DE.dic de_DE.temp.dic |
| 127 | @if os.path.exists('README_de_DE.txt'): |
| 128 | :move README_de_DE.txt README_de_DE.temp.txt |
| 129 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 130 | :fetch $ZIPFILE_AT |
| 131 | :sys $UNZIP $ZIPFILE_AT |
| 132 | :delete $ZIPFILE_AT |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 133 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 134 | :print >>de_AT.dic |
Bram Moolenaar | c64d13a | 2005-11-26 23:48:46 +0000 | [diff] [blame] | 135 | # delete the first line, the word count |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 136 | :sys $VIM -u NONE de_DE.dic -e -c 1delete -c wq |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 137 | :cat de_DE.dic >>de_AT.dic |
| 138 | :delete de_DE.dic |
| 139 | :move de_DE.aff de_AT.aff |
| 140 | :move README_de_DE.txt README_de_AT.txt |
| 141 | |
| 142 | @if os.path.exists('de_DE.temp.aff'): |
| 143 | :move de_DE.temp.aff de_DE.aff |
| 144 | @if os.path.exists('de_DE.temp.dic'): |
| 145 | :move de_DE.temp.dic de_DE.dic |
| 146 | @if os.path.exists('README_de_DE.temp.txt'): |
| 147 | :move README_de_DE.temp.txt README_de_DE.txt |
| 148 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 149 | @if not os.path.exists('de_AT.orig.aff'): |
| 150 | :copy de_AT.aff de_AT.orig.aff |
| 151 | @if not os.path.exists('de_AT.orig.dic'): |
| 152 | :copy de_AT.dic de_AT.orig.dic |
| 153 | @if os.path.exists('de_AT.diff'): |
| 154 | :sys patch <de_AT.diff |
| 155 | |
| 156 | de_CH.aff de_CH.dic: {buildcheck=} |
| 157 | :assertpkg unzip patch |
| 158 | :fetch $ZIPFILE_CH |
| 159 | :sys $UNZIP $ZIPFILE_CH |
| 160 | :delete $ZIPFILE_CH |
| 161 | @if not os.path.exists('de_CH.orig.aff'): |
| 162 | :copy de_CH.aff de_CH.orig.aff |
| 163 | @if not os.path.exists('de_CH.orig.dic'): |
| 164 | :copy de_CH.dic de_CH.orig.dic |
| 165 | @if os.path.exists('de_CH.diff'): |
| 166 | :sys patch <de_CH.diff |
| 167 | |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 168 | |
| 169 | # Generate diff files, so that others can get the OpenOffice files and apply |
| 170 | # the diffs to get the Vim versions. |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 171 | diff: |
| 172 | :assertpkg diff |
| 173 | :sys {force} diff -a -C 1 de_DE.orig.aff de_DE.aff >de_DE.diff |
| 174 | :sys {force} diff -a -C 1 de_DE.orig.dic de_DE.dic >>de_DE.diff |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 175 | :sys {force} diff -a -C 1 de_19.orig.aff de_19.aff >de_19.diff |
| 176 | :sys {force} diff -a -C 1 de_19.orig.dic de_19.dic >>de_19.diff |
| 177 | :sys {force} diff -a -C 1 de_20.orig.aff de_20.aff >de_20.diff |
| 178 | :sys {force} diff -a -C 1 de_20.orig.dic de_20.dic >>de_20.diff |
| 179 | :sys {force} diff -a -C 1 de_AT.orig.aff de_AT.aff >de_AT.diff |
| 180 | :sys {force} diff -a -C 1 de_AT.orig.dic de_AT.dic >>de_AT.diff |
| 181 | :sys {force} diff -a -C 1 de_CH.orig.aff de_CH.aff >de_CH.diff |
| 182 | :sys {force} diff -a -C 1 de_CH.orig.dic de_CH.dic >>de_CH.diff |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 183 | |
| 184 | |
| 185 | # Check for updated OpenOffice spell files. When there are changes the |
| 186 | # ".new.aff" and ".new.dic" files are left behind for manual inspection. |
| 187 | |
| 188 | check: |
Bram Moolenaar | c64d13a | 2005-11-26 23:48:46 +0000 | [diff] [blame] | 189 | :assertpkg unzip patch |
| 190 | :fetch $ZIPFILES |
| 191 | :mkdir tmp |
| 192 | :cd tmp |
| 193 | @try: |
| 194 | # Do the _AT one first, it overwrites the _DE files. |
| 195 | :sys $UNZIP ../$ZIPFILE_AT |
| 196 | :print >>de_AT.dic |
| 197 | # delete the first line, the word count |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 198 | :sys ../$VIM -u NONE de_DE.dic -e -c 1delete -c wq |
Bram Moolenaar | c64d13a | 2005-11-26 23:48:46 +0000 | [diff] [blame] | 199 | :cat de_DE.dic >>de_AT.dic |
| 200 | :delete de_DE.dic |
| 201 | :move de_DE.aff de_AT.aff |
| 202 | :move README_de_DE.txt README_de_AT.txt |
| 203 | |
| 204 | :sys $UNZIP ../$ZIPFILE_DE |
| 205 | :move de_DE_comb.aff de_DE.aff |
| 206 | :move de_DE_comb.dic de_DE.dic |
| 207 | :move README_de_DE_comb.txt README_de_DE.txt |
| 208 | |
| 209 | :sys $UNZIP ../$ZIPFILE_19 |
| 210 | :move de_OLDSPELL.aff de_19.aff |
| 211 | :move de_OLDSPELL.dic de_19.dic |
| 212 | # there is no README file |
| 213 | :print There is no README file for the old spelling >!README_de_19.txt |
| 214 | :sys $UNZIP ../$ZIPFILE_20 |
| 215 | :move de_DE_neu.aff de_20.aff |
| 216 | :move de_DE_neu.dic de_20.dic |
| 217 | :move README_de_DE_neu.txt README_de_20.txt |
| 218 | |
| 219 | :sys $UNZIP ../$ZIPFILE_CH |
| 220 | |
| 221 | @import stat |
| 222 | @for nm in ['de_DE', 'de_19', 'de_20', 'de_AT', 'de_CH']: |
| 223 | @for ext in ['aff', 'dic']: |
| 224 | :sys {force} diff ../$(nm).orig.$ext $(nm).$ext >d |
| 225 | @if os.stat('d')[stat.ST_SIZE] > 0: |
| 226 | :copy $(nm).$ext ../$(nm).new.$ext |
| 227 | :sys {force} diff ../README_$(nm).txt README_$(nm).txt >d |
| 228 | @if os.stat('d')[stat.ST_SIZE] > 0: |
| 229 | :copy README_$(nm).txt ../README_$(nm).new.txt |
| 230 | @finally: |
| 231 | :cd .. |
| 232 | :delete {r}{f}{q} tmp |
| 233 | :delete $ZIPFILES |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 234 | |
| 235 | |
| 236 | # vim: set sts=4 sw=4 : |