vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / ku / main.aap
blob200fb2f1e3ea9e177dec7e07bcd721c2356058fc
1 # Aap recipe for Kurdish 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    = ku_TR.aff ku_TR.dic
12 # I don't have a Kurdish locale, us the Turkish one.
13 all: $SPELLDIR/ku.iso-8859-9.spl $SPELLDIR/ku.utf-8.spl \
14         ../README_ku.txt
16 $SPELLDIR/ku.iso-8859-9.spl : $FILES
17         :sys env LANG=tr_TR.ISO8859-9 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ku ku_TR" -c q
19 $SPELLDIR/ku.utf-8.spl : $FILES
20         :sys env LANG=tr_TR.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ku ku_TR" -c q
22 ../README_ku.txt: README_ku_TR.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%} ku_TR.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 ku_TR.aff ku_TR.dic: {buildcheck=}
35         :assertpkg unzip patch
36         :fetch ku_TR.zip
37         :sys $UNZIP ku_TR.zip
38         :delete ku_TR.zip
39         :sys $VIM ku_TR.aff -e -c "set ff=unix" -c update -c q
40         :sys $VIM ku_TR.dic -e -c "set ff=unix" -c update -c q
41         :sys $VIM README_ku_TR.txt -e -c "set ff=unix" -c update -c q
42         @if not os.path.exists('ku_TR.orig.aff'):
43             :copy ku_TR.aff ku_TR.orig.aff
44         @if not os.path.exists('ku_TR.orig.dic'):
45             :copy ku_TR.dic ku_TR.orig.dic
46         @if os.path.exists('ku_TR.diff'):
47             :sys patch <ku_TR.diff
50 # Generate diff files, so that others can get the OpenOffice files and apply
51 # the diffs to get the Vim versions.
53 diff:
54         :assertpkg diff
55         :sys {force} diff -a -C 1 ku_TR.orig.aff ku_TR.aff >ku_TR.diff
56         :sys {force} diff -a -C 1 ku_TR.orig.dic ku_TR.dic >>ku_TR.diff
59 # Check for updated spell files.  When there are changes the
60 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
62 check:
63         :assertpkg unzip diff
64         :fetch ku_TR.zip
65         :mkdir tmp
66         :cd tmp
67         @try:
68             @import stat
69             :sys $UNZIP ../ku_TR.zip
70             :sys {force} diff ../ku_TR.orig.aff ku_TR.aff >d
71             @if os.stat('d')[stat.ST_SIZE] > 0:
72                 :copy ku_TR.aff ../ku_TR.new.aff
73             :sys {force} diff ../ku_TR.orig.dic ku_TR.dic >d
74             @if os.stat('d')[stat.ST_SIZE] > 0:
75                 :copy ku_TR.dic ../ku_TR.new.dic
76         @finally:
77             :cd ..
78             :delete {r}{f}{q} tmp
79             :delete ku_TR.zip
82 # vim: set sts=4 sw=4 :