vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / ms / main.aap
blob5716b3b69286a6cf3ac0c050cb9cc582f9d28532
1 # Aap recipe for Malay 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    = ms_MY.aff ms_MY.dic
12 # I do not have a Malay locale, use the Dutch one instead.
13 all: $SPELLDIR/ms.latin1.spl $SPELLDIR/ms.utf-8.spl ../README_ms.txt
15 $SPELLDIR/ms.latin1.spl : $FILES
16         :sys env LANG=nl_NL.ISO8859-1
17                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ms ms_MY" -c q
19 $SPELLDIR/ms.utf-8.spl : $FILES
20         :sys env LANG=nl_NL.UTF-8
21                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ms ms_MY" -c q
23 ../README_ms.txt : README_ms_MY.txt
24         :copy $source $target
27 # Fetching the files from OpenOffice.org.
29 OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
30 :attr {fetch = $OODIR/%file%} ms_MY.zip
32 # The files don't depend on the .zip file so that we can delete it.
33 # Only download the zip file if the targets don't exist.
34 ms_MY.aff ms_MY.dic: {buildcheck=}
35         :assertpkg unzip patch
36         :fetch ms_MY.zip
37         :sys $UNZIP ms_MY.zip
38         :delete ms_MY.zip
39         :sys $VIM ms_MY.aff -e -c "set ff=unix" -c update -c q
40         :sys $VIM ms_MY.dic -e -c "set ff=unix" -c update -c q
41         @if not os.path.exists('ms_MY.orig.aff'):
42             :copy ms_MY.aff ms_MY.orig.aff
43         @if not os.path.exists('ms_MY.orig.dic'):
44             :copy ms_MY.dic ms_MY.orig.dic
45         @if os.path.exists('ms_MY.diff'):
46             :sys patch <ms_MY.diff
49 # Generate diff files, so that others can get the OpenOffice files and apply
50 # the diffs to get the Vim versions.
52 diff:
53         :assertpkg diff
54         :sys {force} diff -a -C 1 ms_MY.orig.aff ms_MY.aff >ms_MY.diff
55         :sys {force} diff -a -C 1 ms_MY.orig.dic ms_MY.dic >>ms_MY.diff
58 # Check for updated OpenOffice spell files.  When there are changes the
59 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
61 check:
62         :assertpkg unzip diff
63         :fetch ms_MY.zip
64         :mkdir tmp
65         :cd tmp
66         @try:
67             @import stat
68             :sys $UNZIP ../ms_MY.zip
69             :sys {force} diff ../ms_MY.orig.aff ms_MY.aff >d
70             @if os.stat('d')[stat.ST_SIZE] > 0:
71                 :copy ms_MY.aff ../ms_MY.new.aff
72             :sys {force} diff ../ms_MY.orig.dic ms_MY.dic >d
73             @if os.stat('d')[stat.ST_SIZE] > 0:
74                 :copy ms_MY.dic ../ms_MY.new.dic
75         @finally:
76             :cd ..
77             :delete {r}{f}{q} tmp
78             :delete ms_MY.zip
81 # vim: set sts=4 sw=4 :