vim72-20100325-kaoriya-w64j.zip
[MacVim/KaoriYa.git] / runtime / spell / sv / main.aap
blob5634711aff763760388790e3b4a15dd4e1019dcb
1 # Aap recipe for Swedish Vim spell files.
3 # Maintainer: Stefan Karlsson <stefan.74@comhem.se>
5 # Use a freshly compiled Vim if it exists.
6 @if os.path.exists('../../../src/vim'):
7     VIM = ../../../src/vim
8 @else:
9     :progsearch VIM vim
11 SPELLDIR = ..
12 FILES    = sv_SE.aff sv_SE.dic
14 all: $SPELLDIR/sv.latin1.spl $SPELLDIR/sv.utf-8.spl ../README_sv.txt
16 $SPELLDIR/sv.latin1.spl : $FILES
17         :sys env LANG=sv_SE.ISO8859-1
18                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/sv sv_SE" -c q
20 $SPELLDIR/sv.utf-8.spl : $FILES
21         :sys env LANG=sv_SE.UTF-8
22                 $VIM -u NONE -e -c "mkspell! $SPELLDIR/sv sv_SE" -c q
24 ../README_sv.txt : README_sv_SE.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%} sv_SE.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 sv_SE.aff sv_SE.dic: {buildcheck=}
36         :assertpkg unzip patch
37         :fetch sv_SE.zip
38         :sys $UNZIP sv_SE.zip
39         :delete sv_SE.zip
40         :delete hyph_sv_SE.dic
41         @if not os.path.exists('sv_SE.orig.aff'):
42             :copy sv_SE.aff sv_SE.orig.aff
43         @if not os.path.exists('sv_SE.orig.dic'):
44             :copy sv_SE.dic sv_SE.orig.dic
45         @if os.path.exists('sv_SE.diff'):
46             :sys patch <sv_SE.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 sv_SE.orig.aff sv_SE.aff >sv_SE.diff
55         :sys {force} diff -a -C 1 sv_SE.orig.dic sv_SE.dic >>sv_SE.diff
58 # Check for updated OpenOffice 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 sv_SE.zip
64         :mkdir tmp
65         :cd tmp
66         @try:
67             @import stat
68             :sys $UNZIP ../sv_SE.zip
69             :sys {force} diff ../sv_SE.orig.aff sv_SE.aff >d
70             @if os.stat('d')[stat.ST_SIZE] > 0:
71                 :copy sv_SE.aff ../sv_SE.new.aff
72             :sys {force} diff ../sv_SE.orig.dic sv_SE.dic >d
73             @if os.stat('d')[stat.ST_SIZE] > 0:
74                 :copy sv_SE.dic ../sv_SE.new.dic
75         @finally:
76             :cd ..
77             :delete {r}{f}{q} tmp
78             :delete sv_SE.zip
81 # vim: set sts=4 sw=4 :