vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / lv / main.aap
blob10cacd82a68079deb810c840e82232c0681163aa
1 # Aap recipe for Latvian 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    = lv_LV.aff lv_LV.dic
12 # I don't have a Latvian locale, use Lithuanian instead.
13 all: $SPELLDIR/lv.iso-8859-13.spl $SPELLDIR/lv.utf-8.spl \
14          ../README_lv.txt
16 $SPELLDIR/lv.iso-8859-13.spl : $FILES
17         :sys env LANG=lt_LT.ISO8859-13 $VIM -u NONE -e -c "mkspell! $SPELLDIR/lv lv_LV" -c q
19 $SPELLDIR/lv.utf-8.spl : $FILES
20         :sys env LANG=lt_LT.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/lv lv_LV" -c q
22 ../README_lv.txt: README_lv_LV.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%} lv_LV.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 # This is a bit tricky, since the file name includes the date.
34 lv_LV.aff lv_LV.dic: {buildcheck=}
35         :assertpkg unzip patch
36         :fetch lv_LV.zip
37         :sys $UNZIP lv_LV.zip
38         :delete lv_LV.zip
39         :delete changelog.txt gpl.txt lin-lv_LV_add.sh win-lv_LV_add.bat
40         :sys $VIM lv_LV.aff -e -N -c "%s/\r//" -c update -c q
41         :sys $VIM lv_LV.dic -e -N -c "%s/\r//" -c update -c q
42         :sys $VIM README_lv_LV.txt -e -c "set ff=unix" -c update -c q
43         @if not os.path.exists('lv_LV.orig.aff'):
44             :copy lv_LV.aff lv_LV.orig.aff
45         @if not os.path.exists('lv_LV.orig.dic'):
46             :copy lv_LV.dic lv_LV.orig.dic
47         @if os.path.exists('lv_LV.diff'):
48             :sys patch <lv_LV.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 lv_LV.orig.aff lv_LV.aff >lv_LV.diff
57         :sys {force} diff -a -C 1 lv_LV.orig.dic lv_LV.dic >>lv_LV.diff
60 # Check for updated 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 lv_LV.zip
66         :mkdir tmp
67         :cd tmp
68         @try:
69             @import stat
70             :sys $UNZIP ../lv_LV.zip
71             :sys {force} diff ../lv_LV.orig.aff lv_LV.aff >d
72             @if os.stat('d')[stat.ST_SIZE] > 0:
73                 :copy lv_LV.aff ../lv_LV.new.aff
74             :sys {force} diff ../lv_LV.orig.dic lv_LV.dic >d
75             @if os.stat('d')[stat.ST_SIZE] > 0:
76                 :copy lv_LV.dic ../lv_LV.new.dic
77         @finally:
78             :cd ..
79             :delete {r}{f}{q} tmp
80             :delete lv_LV.zip
83 # vim: set sts=4 sw=4 :