1 # Aap recipe for Swedish Vim spell files.
3 # Maintainer: Mattias Winther <vim@mattias.winthernet.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.ISO-8859-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.txt
28 # Fetching the files from OpenOffice.org.
30 OODIR = http://extensions.services.openoffice.org/e-files/1080/7
31 :attr {fetch = $OODIR/%file%} ooo_swedish_dict_1.43.oxt
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 ooo_swedish_dict_1.43.oxt
38 :sys $UNZIP ooo_swedish_dict_1.43.oxt
39 :delete ooo_swedish_dict_1.43.oxt
41 :copy dictionaries/sv_SE.aff sv_SE.aff
42 :copy dictionaries/sv_SE.dic sv_SE.dic
43 :delete {r} dictionaries dictionaries.xcu description.xml
44 :delete {f} README_sv.txt
45 :sys $VIM README_sv.txt -u NONE -N -e -c "0read LICENSE_en_US.txt" -c "read LICENSE_sv_SE.txt" -c "set ff=unix" -c write -c q
46 :delete LICENSE_en_US.txt LICENSE_sv_SE.txt
47 @if not os.path.exists('sv_SE.orig.aff'):
48 :copy sv_SE.aff sv_SE.orig.aff
49 @if not os.path.exists('sv_SE.orig.dic'):
50 :copy sv_SE.dic sv_SE.orig.dic
51 @if os.path.exists('sv_SE.diff'):
52 :sys patch <sv_SE.diff
54 # Delete all the generated files, start from scratch
56 :delete {f} sv_SE.aff sv_SE.dic
57 :delete {f} sv_SE.aff.orig sv_SE.dic.orig
58 :delete {f} sv_SE.orig.aff sv_SE.orig.dic
59 :delete {f} README_sv.txt
61 # Generate diff files, so that others can get the OpenOffice files and apply
62 # the diffs to get the Vim versions.
66 :sys {force} diff -a -C 1 sv_SE.orig.aff sv_SE.aff >sv_SE.diff
67 :sys {force} diff -a -C 1 sv_SE.orig.dic sv_SE.dic >>sv_SE.diff
70 # Check for updated OpenOffice spell files. When there are changes the
71 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
75 :fetch ooo_swedish_dict_1.43.oxt
80 :sys $UNZIP ../ooo_swedish_dict_1.43.oxt
81 :sys {force} diff ../sv_SE.orig.aff sv_SE.aff >d
82 @if os.stat('d')[stat.ST_SIZE] > 0:
83 :copy sv_SE.aff ../sv_SE.new.aff
84 :sys {force} diff ../sv_SE.orig.dic sv_SE.dic >d
85 @if os.stat('d')[stat.ST_SIZE] > 0:
86 :copy sv_SE.dic ../sv_SE.new.dic
90 :delete ooo_swedish_dict_1.43.oxt
93 # vim: set sts=4 sw=4 :