vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / mg / main.aap
blob77860bf5f3a6a2afd89d1fc43cf293fddb581533
1 # Aap recipe for Malagasy 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    = mg_MG.aff mg_MG.dic
12 # I don't have a Malagasy locale, use the Dutch one instead.
13 all: $SPELLDIR/mg.latin1.spl $SPELLDIR/mg.utf-8.spl ../README_mg.txt
15 $SPELLDIR/mg.latin1.spl : $FILES
16         :sys env LANG=nl_NL.ISO8859-1
17                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/mg mg_MG" -c q
19 $SPELLDIR/mg.utf-8.spl : $FILES
20         :sys env LANG=nl_NL.UTF-8
21                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/mg mg_MG" -c q
23 ../README_mg.txt : README_mg_MG.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%} mg_MG.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 mg_MG.aff mg_MG.dic: {buildcheck=}
35         :assertpkg unzip patch
36         :fetch mg_MG.zip
37         :sys $UNZIP mg_MG.zip
38         :delete mg_MG.zip
39         @if not os.path.exists('mg_MG.orig.aff'):
40             :copy mg_MG.aff mg_MG.orig.aff
41         @if not os.path.exists('mg_MG.orig.dic'):
42             :copy mg_MG.dic mg_MG.orig.dic
43         @if os.path.exists('mg_MG.diff'):
44             :sys patch <mg_MG.diff
47 # Generate diff files, so that others can get the OpenOffice files and apply
48 # the diffs to get the Vim versions.
50 diff:
51         :assertpkg diff
52         :sys {force} diff -a -C 1 mg_MG.orig.aff mg_MG.aff >mg_MG.diff
53         :sys {force} diff -a -C 1 mg_MG.orig.dic mg_MG.dic >>mg_MG.diff
56 # Check for updated OpenOffice spell files.  When there are changes the
57 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
59 check:
60         :assertpkg unzip diff
61         :fetch mg_MG.zip
62         :mkdir tmp
63         :cd tmp
64         @try:
65             @import stat
66             :sys $UNZIP ../mg_MG.zip
67             :sys {force} diff ../mg_MG.orig.aff mg_MG.aff >d
68             @if os.stat('d')[stat.ST_SIZE] > 0:
69                 :copy mg_MG.aff ../mg_MG.new.aff
70             :sys {force} diff ../mg_MG.orig.dic mg_MG.dic >d
71             @if os.stat('d')[stat.ST_SIZE] > 0:
72                 :copy mg_MG.dic ../mg_MG.new.dic
73         @finally:
74             :cd ..
75             :delete {r}{f}{q} tmp
76             :delete mg_MG.zip
79 # vim: set sts=4 sw=4 :