vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / ca / main.aap
blob2182f29164696563ea5d8704e03863bfbd2bd7f3
1 # Aap recipe for Catelan (Spain) 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    = ca_ES.aff ca_ES.dic
12 all: $SPELLDIR/ca.latin1.spl $SPELLDIR/ca.utf-8.spl ../README_ca.txt
14 $SPELLDIR/ca.latin1.spl : $FILES
15         :sys env LANG=ca_ES.ISO8859-1
16                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ca ca_ES" -c q
18 $SPELLDIR/ca.utf-8.spl : $FILES
19         :sys env LANG=ca_ES.UTF-8
20                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ca ca_ES" -c q
22 ../README_ca.txt : README_ca_ES.txt
23         :copy $source $target
26 # Fetching the files from OpenOffice.org.
28 OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
29 :attr {fetch = $OODIR/%file%} ca_ES.zip
31 # The files don't depend on the .zip file so that we can delete it.
32 # Only download the zip file if the targets don't exist.
33 # Make sure the files are in Unix fileformat
34 ca_ES.aff ca_ES.dic: {buildcheck=}
35         :assertpkg unzip patch
36         :fetch ca_ES.zip
37         :sys $UNZIP ca_ES.zip
38         :delete ca_ES.zip
39         :sys $VIM ca_ES.aff -c "set ff=unix" -c "update" -c q
40         :sys $VIM ca_ES.dic -c "set ff=unix" -c "update" -c q
41         @if not os.path.exists('ca_ES.orig.aff'):
42             :copy ca_ES.aff ca_ES.orig.aff
43         @if not os.path.exists('ca_ES.orig.dic'):
44             :copy ca_ES.dic ca_ES.orig.dic
45         @if os.path.exists('ca_ES.diff'):
46             :sys patch <ca_ES.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 ca_ES.orig.aff ca_ES.aff >ca_ES.diff
55         :sys {force} diff -a -C 1 ca_ES.orig.dic ca_ES.dic >>ca_ES.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 ca_ES.zip
64         :mkdir tmp
65         :cd tmp
66         @try:
67             @import stat
68             :sys $UNZIP ../ca_ES.zip
69             :sys {force} diff ../ca_ES.orig.aff ca_ES.aff >d
70             @if os.stat('d')[stat.ST_SIZE] > 0:
71                 :copy ca_ES.aff ../ca_ES.new.aff
72             :sys {force} diff ../ca_ES.orig.dic ca_ES.dic >d
73             @if os.stat('d')[stat.ST_SIZE] > 0:
74                 :copy ca_ES.dic ../ca_ES.new.dic
75         @finally:
76             :cd ..
77             :delete {r}{f}{q} tmp
78             :delete ca_ES.zip
81 # vim: set sts=4 sw=4 :