blob: 49ec2f25bfc60bd05420bde1422e087d858d0590 [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.
Bram Moolenaar2a953fc2019-01-26 17:41:47 +01005# "de": new German spelling
Bram Moolenaarae5bce12005-08-15 21:41:48 +00006# "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 Moolenaar2a953fc2019-01-26 17:41:47 +010024# The de_20 is the same as de_DE dictionary and only uses the
25# new revised orthography
26FILE_DE_AFF = de_DE_frami.aff
27FILE_DE_DIC = de_DE_frami.dic
28FILE_20_AFF = de_DE_frami.aff
29FILE_20_DIC = de_DE_frami.dic
30FILE_AT_AFF = de_AT_frami.aff
31FILE_AT_DIC = de_AT_frami.dic
32FILE_CH_AFF = de_CH_frami.aff
33FILE_CH_DIC = de_CH_frami.dic
34#ZIPFILES = $ZIPFILE_DE $ZIPFILE_20 $ZIPFILE_AT $ZIPFILE_CH
35ZIPFILE_19 = de_OLDSPELL.zip # unmaintained
36DICT_FILES = $FILE_20_AFF $FILE_20_DIC $FILE_AT_AFF $FILE_AT_DIC $FILE_CH_AFF $FILE_CH_DIC
Bram Moolenaarae5bce12005-08-15 21:41:48 +000037
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010038READMES = README_de_DE_frami.txt README_extension_owner.txt
Bram Moolenaarae5bce12005-08-15 21:41:48 +000039
40all: $SPELLDIR/de.latin1.spl $SPELLDIR/de.utf-8.spl ../README_de.txt
41
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000042$SPELLDIR/de.latin1.spl : $FILES
Bram Moolenaar9c754c42010-07-10 15:52:35 +020043 :sys env LANG=de_DE.ISO-8859-1
Bram Moolenaarae5bce12005-08-15 21:41:48 +000044 $VIM -u NONE -e -c "mkspell! $SPELLDIR/de $DE_REGIONS" -c q
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000045
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000046$SPELLDIR/de.utf-8.spl : $FILES
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000047 :sys env LANG=de_DE.UTF-8
Bram Moolenaarae5bce12005-08-15 21:41:48 +000048 $VIM -u NONE -e -c "mkspell! $SPELLDIR/de $DE_REGIONS" -c q
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000049
Bram Moolenaarae5bce12005-08-15 21:41:48 +000050../README_de.txt: $READMES
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010051 :fetch $READMES
52 :print de_DE_frami.txt >! $target
53 :cat README_de_DE_frami.txt >> $target
Bram Moolenaarae5bce12005-08-15 21:41:48 +000054 :print =================================================== >>$target
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010055 :print extension_owner >> $target
56 :cat README_extension_owner.txt >> $target
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000057
58#
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010059# Fetching the files from the LibreOffices github repository.
Bram Moolenaar81f1ecb2005-08-25 21:27:31 +000060# The OLDSPELL file comes from elsewhere
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000061#
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010062OODIR = https://github.com/LibreOffice/dictionaries/raw/master/de
Bram Moolenaar81f1ecb2005-08-25 21:27:31 +000063DEDIR = http://www.j3e.de/myspell
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010064:attr {fetch = $OODIR/%file%} $DICT_FILES
65:attr {fetch = $OODIR/%file%} $READMES
Bram Moolenaar81f1ecb2005-08-25 21:27:31 +000066:attr {fetch = $DEDIR/%file%} $ZIPFILE_19
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000067
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.
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010070de_DE.aff de_DE.dic de_20.aff de_20.dic: {buildcheck=}
71 :assertpkg patch
72 :fetch $FILE_DE_AFF
73 :fetch $FILE_DE_DIC
74 :move de_DE_frami.aff de_DE.aff
75 :move de_DE_frami.dic de_DE.dic
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000076 @if not os.path.exists('de_DE.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000077 :copy de_DE.aff de_DE.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000078 @if not os.path.exists('de_DE.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000079 :copy de_DE.dic de_DE.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000080 @if os.path.exists('de_DE.diff'):
81 :sys patch <de_DE.diff
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010082 :copy de_DE.aff de_20.aff
83 :copy de_DE.dic de_20.dic
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000084
Bram Moolenaarae5bce12005-08-15 21:41:48 +000085de_19.aff de_19.dic: {buildcheck=}
86 :assertpkg unzip patch
87 :fetch $ZIPFILE_19
Bram Moolenaarae5bce12005-08-15 21:41:48 +000088 :sys $UNZIP $ZIPFILE_19
89 :delete $ZIPFILE_19
Bram Moolenaar81f1ecb2005-08-25 21:27:31 +000090 :move de_OLDSPELL.aff de_19.aff
91 :move de_OLDSPELL.dic de_19.dic
Bram Moolenaarae5bce12005-08-15 21:41:48 +000092 @if not os.path.exists('de_19.orig.aff'):
93 :copy de_19.aff de_19.orig.aff
94 @if not os.path.exists('de_19.orig.dic'):
95 :copy de_19.dic de_19.orig.dic
96 @if os.path.exists('de_19.diff'):
97 :sys patch <de_19.diff
98
Bram Moolenaar81f1ecb2005-08-25 21:27:31 +000099de_AT.aff de_AT.dic: {buildcheck=}
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100100 :assertpkg patch
101 :fetch $FILE_AT_AFF
102 :fetch $FILE_AT_DIC
103 :move $FILE_AT_AFF de_AT.aff
104 :move $FILE_AT_DIC de_AT.dic
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000105 @if not os.path.exists('de_AT.orig.aff'):
106 :copy de_AT.aff de_AT.orig.aff
107 @if not os.path.exists('de_AT.orig.dic'):
108 :copy de_AT.dic de_AT.orig.dic
109 @if os.path.exists('de_AT.diff'):
110 :sys patch <de_AT.diff
111
112de_CH.aff de_CH.dic: {buildcheck=}
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100113 :assertpkg patch
114 :fetch $FILE_CH_AFF
115 :fetch $FILE_CH_DIC
116 :move $FILE_CH_AFF de_CH.aff
117 :move $FILE_CH_DIC de_CH.dic
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000118 @if not os.path.exists('de_CH.orig.aff'):
119 :copy de_CH.aff de_CH.orig.aff
120 @if not os.path.exists('de_CH.orig.dic'):
121 :copy de_CH.dic de_CH.orig.dic
122 @if os.path.exists('de_CH.diff'):
123 :sys patch <de_CH.diff
124
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000125
126# Generate diff files, so that others can get the OpenOffice files and apply
127# the diffs to get the Vim versions.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000128diff:
129 :assertpkg diff
130 :sys {force} diff -a -C 1 de_DE.orig.aff de_DE.aff >de_DE.diff
131 :sys {force} diff -a -C 1 de_DE.orig.dic de_DE.dic >>de_DE.diff
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000132 :sys {force} diff -a -C 1 de_19.orig.aff de_19.aff >de_19.diff
133 :sys {force} diff -a -C 1 de_19.orig.dic de_19.dic >>de_19.diff
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000134 :sys {force} diff -a -C 1 de_AT.orig.aff de_AT.aff >de_AT.diff
135 :sys {force} diff -a -C 1 de_AT.orig.dic de_AT.dic >>de_AT.diff
136 :sys {force} diff -a -C 1 de_CH.orig.aff de_CH.aff >de_CH.diff
137 :sys {force} diff -a -C 1 de_CH.orig.dic de_CH.dic >>de_CH.diff
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100138 :copy de_DE.diff de_20.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000139
140
141# Check for updated OpenOffice spell files. When there are changes the
142# ".new.aff" and ".new.dic" files are left behind for manual inspection.
143
144check:
Bram Moolenaarc64d13a2005-11-26 23:48:46 +0000145 :assertpkg unzip patch
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100146 :fetch $ZIPFILE_19
147 :fetch $DICT_FILES
Bram Moolenaarc64d13a2005-11-26 23:48:46 +0000148 @try:
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100149 :mkdir tmp
150 :cd tmp
Bram Moolenaarc64d13a2005-11-26 23:48:46 +0000151 :sys $UNZIP ../$ZIPFILE_19
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100152 :copy ../*.aff .
153 :copy ../*.dic .
Bram Moolenaarc64d13a2005-11-26 23:48:46 +0000154 :move de_OLDSPELL.aff de_19.aff
155 :move de_OLDSPELL.dic de_19.dic
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100156 :move de_DE_frami.aff de_DE.aff
157 :move de_DE_frami.dic de_DE.dic
158 :move de_AT_frami.dic de_AT.dic
159 :move de_AT_frami.aff de_AT.aff
160 :move de_CH_frami.dic de_CH.dic
161 :move de_CH_frami.aff de_CH.aff
162 :copy de_DE.dic de_20.dic
163 :copy de_DE.aff de_20.aff
Bram Moolenaarc64d13a2005-11-26 23:48:46 +0000164
165 @import stat
166 @for nm in ['de_DE', 'de_19', 'de_20', 'de_AT', 'de_CH']:
167 @for ext in ['aff', 'dic']:
168 :sys {force} diff ../$(nm).orig.$ext $(nm).$ext >d
169 @if os.stat('d')[stat.ST_SIZE] > 0:
170 :copy $(nm).$ext ../$(nm).new.$ext
171 :sys {force} diff ../README_$(nm).txt README_$(nm).txt >d
Bram Moolenaarc64d13a2005-11-26 23:48:46 +0000172 @finally:
173 :cd ..
174 :delete {r}{f}{q} tmp
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000175
176# vim: set sts=4 sw=4 :