vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / ro / main.aap
blobc07e2712cf27f480df71d3ace6792feec3a0b54c
1 # Aap recipe for Romanian 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    = ro_RO.aff ro_RO.dic
12 all: $SPELLDIR/ro.iso-8859-2.spl $SPELLDIR/ro.utf-8.spl \
13         $SPELLDIR/ro.cp1250.spl ../README_ro.txt
15 $SPELLDIR/ro.iso-8859-2.spl : $FILES
16         :sys env LANG=ro_RO.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
18 $SPELLDIR/ro.utf-8.spl : $FILES
19         :sys env LANG=ro_RO.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
21 $SPELLDIR/ro.cp1250.spl : $FILES
22         :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/ro ro_RO" -c q
24 ../README_ro.txt: README_ro_RO.txt
25         :copy $source $target
28 # Fetching the files from OpenOffice.org.
30 OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
31 :attr {fetch = $OODIR/%file%} ro_RO.zip
33 # The files don't depend on the .zip file so that we can delete it.
34 # Only download the zip file if the targets don't exist.
35 # This is a bit tricky, since the file name includes the date.
36 ro_RO.aff ro_RO.dic: {buildcheck=}
37         :assertpkg unzip patch
38         :fetch ro_RO.zip
39         :sys $UNZIP ro_RO.zip
40         :delete ro_RO.zip
41         @if not os.path.exists('ro_RO.orig.aff'):
42             :copy ro_RO.aff ro_RO.orig.aff
43         @if not os.path.exists('ro_RO.orig.dic'):
44             :copy ro_RO.dic ro_RO.orig.dic
45         @if os.path.exists('ro_RO.diff'):
46             :sys patch <ro_RO.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 ro_RO.orig.aff ro_RO.aff >ro_RO.diff
55         :sys {force} diff -a -C 1 ro_RO.orig.dic ro_RO.dic >>ro_RO.diff
58 # Check for updated 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 ro_RO.zip
64         :mkdir tmp
65         :cd tmp
66         @try:
67             @import stat
68             :sys $UNZIP ../ro_RO.zip
69             :sys {force} diff ../ro_RO.orig.aff ro_RO.aff >d
70             @if os.stat('d')[stat.ST_SIZE] > 0:
71                 :copy ro_RO.aff ../ro_RO.new.aff
72             :sys {force} diff ../ro_RO.orig.dic ro_RO.dic >d
73             @if os.stat('d')[stat.ST_SIZE] > 0:
74                 :copy ro_RO.dic ../ro_RO.new.dic
75         @finally:
76             :cd ..
77             :delete {r}{f}{q} tmp
78             :delete ro_RO.zip
81 # vim: set sts=4 sw=4 :