vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / th / main.aap
blobe2ec6606d88986f2ba692ff608cff27547cc12c6
1 # Aap recipe for Thai Vim spell files.
3 # Use a freshly compiled Vim if it exists.
4 @if os.path.exists('../../../src/vim'):
5     VIM = ../../../src/vim
6 @else:
7     :progsearch VIM vim
9 SPELLDIR = ..
10 FILES    = th.aff th.dic
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
19         :copy $source $target
22 # Fetching the files from http://sesrc.th.net
24 HTTPDIR = http://seasrc.th.net/dict
25 ZIPNAME = th_18057.zip
26 FNAME = TH_18057.TXT
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
38         :fetch $ZIPNAME
39         :sys unzip $ZIPNAME
40         :sys {force} iconv -c -f TIS-620 -t UTF-8 <$FNAME >th.dic
41         :delete $ZIPNAME $FNAME
43         :delete {force} th.aff
44         :touch {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'):
50             :sys patch <th.diff
53 # Generate diff files, so that others can get the OpenOffice files and apply
54 # the diffs to get the Vim versions.
56 diff:
57         :assertpkg diff
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.
65 check:
66         :print Sorry, not supported.