vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / bg / main.aap
blob2ccea86c68da255a576acba21402ac9a2fb3c1ce
1 # Aap recipe for Bulgarian 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    = bg_BG.aff bg_BG.dic
12 all: $SPELLDIR/bg.cp1251.spl $SPELLDIR/bg.utf-8.spl ../README_bg.txt
14 $SPELLDIR/bg.cp1251.spl : $FILES
15         :sys env LANG=bg_BG.CP1251 $VIM -u NONE -e -c "mkspell! $SPELLDIR/bg bg_BG" -c q
17 $SPELLDIR/bg.utf-8.spl : $FILES
18         :sys env LANG=bg_BG.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/bg bg_BG" -c q
20 ../README_bg.txt: README_bg_BG.txt
21         :copy $source $target
24 # Fetching the files from OpenOffice.org.
26 OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
27 :attr {fetch = $OODIR/%file%} bg_BG.zip
29 # The files don't depend on the .zip file so that we can delete it.
30 # Only download the zip file if the targets don't exist.
31 # This is a bit tricky, since the file name includes the date.
32 bg_BG.aff bg_BG.dic: {buildcheck=}
33         :assertpkg unzip patch
34         :fetch bg_BG.zip
35         :sys $UNZIP bg_BG.zip
36         :delete bg_BG.zip
37         :sys $VIM bg_BG.aff -e -c "set ff=unix" -c update -c q
38         :sys $VIM bg_BG.dic -e -c "set ff=unix" -c update -c q
39         :sys $VIM README_bg_BG.txt -e -c "set ff=unix" -c update -c q
40         @if not os.path.exists('bg_BG.orig.aff'):
41             :copy bg_BG.aff bg_BG.orig.aff
42         @if not os.path.exists('bg_BG.orig.dic'):
43             :copy bg_BG.dic bg_BG.orig.dic
44         @if os.path.exists('bg_BG.diff'):
45             :sys patch <bg_BG.diff
48 # Generate diff files, so that others can get the OpenOffice files and apply
49 # the diffs to get the Vim versions.
51 diff:
52         :assertpkg diff
53         :sys {force} diff -a -C 1 bg_BG.orig.aff bg_BG.aff >bg_BG.diff
54         :sys {force} diff -a -C 1 bg_BG.orig.dic bg_BG.dic >>bg_BG.diff
57 # Check for updated OpenOffice spell files.  When there are changes the
58 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
60 check:
61         :assertpkg unzip diff
62         :fetch bg_BG.zip
63         :mkdir tmp
64         :cd tmp
65         @try:
66             @import stat
67             :sys $UNZIP ../bg_BG.zip
68             :sys {force} diff ../bg_BG.orig.aff bg_BG.aff >d
69             @if os.stat('d')[stat.ST_SIZE] > 0:
70                 :copy bg_BG.aff ../bg_BG.new.aff
71             :sys {force} diff ../bg_BG.orig.dic bg_BG.dic >d
72             @if os.stat('d')[stat.ST_SIZE] > 0:
73                 :copy bg_BG.dic ../bg_BG.new.dic
74         @finally:
75             :cd ..
76             :delete {r}{f}{q} tmp
77             :delete bg_BG.zip
80 # vim: set sts=4 sw=4 :