vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / pl / main.aap
blob74cd1d58bdcdeba5652ca73e0643873c03c563c1
1 # Aap recipe for Polish 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    = pl_PL.aff pl_PL.dic
12 all: $SPELLDIR/pl.iso-8859-2.spl $SPELLDIR/pl.utf-8.spl \
13         $SPELLDIR/pl.cp1250.spl ../README_pl.txt
15 $SPELLDIR/pl.iso-8859-2.spl : $FILES
16         :sys env LANG=pl_PL.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pl pl_PL" -c q
18 $SPELLDIR/pl.utf-8.spl : $FILES
19         :sys env LANG=pl_PL.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pl pl_PL" -c q
21 $SPELLDIR/pl.cp1250.spl : $FILES
22         :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/pl pl_PL" -c q
24 ../README_pl.txt: README_pl_PL.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%} pl_PL.zip
34 # Fetching the files from
36 HTTPDIR = http://www.kurnik.pl/dictionary
38 # The files don't depend on the .zip file so that we can delete it.
39 # Only download the zip file if the targets don't exist.
40 # This is a bit tricky, since the file name includes the date.
41 pl_PL.aff pl_PL.dic: {buildcheck=}
42         :assertpkg tar bunzip2
43         fname = alt-myspell-pl.tar.bz2
44         :attr {fetch = $HTTPDIR/%file%} $fname
45         :fetch $fname
46         :sys bunzip2 -c $fname | tar xf -
47         :move alt-myspell-pl-20[0-9]*/* .
48         :deldir alt-myspell-pl-20[0-9]*
49         :delete $fname
50         @if not os.path.exists('pl_PL.orig.aff'):
51             :copy pl_PL.aff pl_PL.orig.aff
52         @if not os.path.exists('pl_PL.orig.dic'):
53             :copy pl_PL.dic pl_PL.orig.dic
54         @if os.path.exists('pl_PL.diff'):
55             :sys patch <pl_PL.diff
58 # Generate diff files, so that others can get the OpenOffice files and apply
59 # the diffs to get the Vim versions.
61 diff:
62         :assertpkg diff
63         :sys {force} diff -a -C 1 pl_PL.orig.aff pl_PL.aff >pl_PL.diff
64         :sys {force} diff -a -C 1 pl_PL.orig.dic pl_PL.dic >>pl_PL.diff
67 # Check for updated spell files.  When there are changes the
68 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
70 check:
71         :assertpkg tar bunzip2 diff
72         fname = alt-myspell-pl.tar.bz2
73         :attr {fetch = $HTTPDIR/%file%} $fname
74         :fetch $fname
75         :sys bunzip2 -c $fname | tar xf -
76         :cd alt-myspell-pl-20[0-9]*
77         @try:
78             @import stat
79             :sys $UNZIP ../pl_PL.zip
80             :sys {force} diff ../pl_PL.orig.aff pl_PL.aff >d
81             @if os.stat('d')[stat.ST_SIZE] > 0:
82                 :copy pl_PL.aff ../pl_PL.new.aff
83             :sys {force} diff ../pl_PL.orig.dic pl_PL.dic >d
84             @if os.stat('d')[stat.ST_SIZE] > 0:
85                 :copy pl_PL.dic ../pl_PL.new.dic
86         @finally:
87             :cd ..
88             :delete {r}{f}{q} $base
89             :delete $fname
92 # vim: set sts=4 sw=4 :