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'):
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
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
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.
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.
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
81 # vim: set sts=4 sw=4 :