1 # Aap recipe for Thai Vim spell files.
3 # Use a freshly compiled Vim if it exists.
4 @if os.path.exists('../../../src/vim'):
12 all: $SPELLDIR/th.utf-8.spl ../README_th.txt
14 $SPELLDIR/th.utf-8.spl : $FILES
15 :sys $VIM -u NONE -e -c "set enc=utf-8"
16 -c "mkspell! $SPELLDIR/th th" -c q
18 ../README_th.txt: README_th.txt
22 # Fetching the files from http://sesrc.th.net
24 HTTPDIR = http://seasrc.th.net/dict
25 ZIPNAME = th_18057.zip
28 :attr {fetch = $HTTPDIR/%file%} $ZIPNAME
30 # The files don't depend on the .zip file so that we can delete it.
31 # Only download the zip file if the targets don't exist.
32 # This is a bit tricky, since the file name includes the date.
34 # We get a plain list of Thai words and make the .dic file from that. The .aff
35 # file is made from scratch.
36 th.aff th.dic: {buildcheck=}
37 :assertpkg unzip iconv
40 :sys {force} iconv -c -f TIS-620 -t UTF-8 <$FNAME >th.dic
41 :delete $ZIPNAME $FNAME
43 :delete {force} th.aff
45 @if not os.path.exists('th.orig.aff'):
46 :touch {force} th.orig.aff
47 @if not os.path.exists('th.orig.dic'):
48 :copy th.dic th.orig.dic
49 @if os.path.exists('th.diff'):
53 # Generate diff files, so that others can get the OpenOffice files and apply
54 # the diffs to get the Vim versions.
58 :sys {force} diff -N -a -C 1 th.orig.aff th.aff >th.diff
59 :sys {force} diff -a -C 1 th.orig.dic th.dic >>th.diff
62 # Check for updated spell files. When there are changes the
63 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
66 :print Sorry, not supported.