vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / zu / main.aap
blob7805d76781cd52dfe7a5a77402e26fcfc46e9662
1 # Aap recipe for Zulu 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    = zu_ZA.aff zu_ZA.dic
12 # There is no Zulu locale, use the Dutch one instead.
13 all: $SPELLDIR/zu.latin1.spl $SPELLDIR/zu.utf-8.spl \
14         $SPELLDIR/zu.ascii.spl ../README_zu.txt
16 $SPELLDIR/zu.latin1.spl : $FILES
17         :sys env LANG=nl_NL.ISO8859-1
18                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/zu zu_ZA" -c q
20 $SPELLDIR/zu.utf-8.spl : $FILES
21         :sys env LANG=nl_NL.UTF-8
22                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/zu zu_ZA" -c q
24 $SPELLDIR/zu.ascii.spl : $FILES
25         :sys $VIM -u NONE -e -c "mkspell! -ascii $SPELLDIR/zu zu_ZA" -c q
27 ../README_zu.txt : README_zu_ZA.txt
28         :copy $source $target
31 # Fetching the files from OpenOffice.org.
33 OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
34 :attr {fetch = $OODIR/%file%} zu_ZA.zip
36 # The files don't depend on the .zip file so that we can delete it.
37 # Only download the zip file if the targets don't exist.
38 zu_ZA.aff zu_ZA.dic: {buildcheck=}
39         :assertpkg unzip patch
40         :fetch zu_ZA.zip
41         :sys $UNZIP zu_ZA.zip
42         :delete zu_ZA.zip
43         @if not os.path.exists('zu_ZA.orig.aff'):
44             :copy zu_ZA.aff zu_ZA.orig.aff
45         @if not os.path.exists('zu_ZA.orig.dic'):
46             :copy zu_ZA.dic zu_ZA.orig.dic
47         @if os.path.exists('zu_ZA.diff'):
48             :sys patch <zu_ZA.diff
51 # Generate diff files, so that others can get the OpenOffice files and apply
52 # the diffs to get the Vim versions.
54 diff:
55         :assertpkg diff
56         :sys {force} diff -a -C 1 zu_ZA.orig.aff zu_ZA.aff >zu_ZA.diff
57         :sys {force} diff -a -C 1 zu_ZA.orig.dic zu_ZA.dic >>zu_ZA.diff
60 # Check for updated OpenOffice spell files.  When there are changes the
61 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
63 check:
64         :assertpkg unzip diff
65         :fetch zu_ZA.zip
66         :mkdir tmp
67         :cd tmp
68         @try:
69             @import stat
70             :sys $UNZIP ../zu_ZA.zip
71             :sys {force} diff ../zu_ZA.orig.aff zu_ZA.aff >d
72             @if os.stat('d')[stat.ST_SIZE] > 0:
73                 :copy zu_ZA.aff ../zu_ZA.new.aff
74             :sys {force} diff ../zu_ZA.orig.dic zu_ZA.dic >d
75             @if os.stat('d')[stat.ST_SIZE] > 0:
76                 :copy zu_ZA.dic ../zu_ZA.new.dic
77         @finally:
78             :cd ..
79             :delete {r}{f}{q} tmp
80             :delete zu_ZA.zip
83 # vim: set sts=4 sw=4 :