blob: 5634711aff763760388790e3b4a15dd4e1019dcb [file] [log] [blame]
Bram Moolenaare344bea2005-09-01 20:46:49 +00001# Aap recipe for Swedish Vim spell files.
Bram Moolenaara5792f52005-11-23 21:25:05 +00002#
3# Maintainer: Stefan Karlsson <stefan.74@comhem.se>
Bram Moolenaare344bea2005-09-01 20:46:49 +00004
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
10
11SPELLDIR = ..
12FILES = sv_SE.aff sv_SE.dic
13
14all: $SPELLDIR/sv.latin1.spl $SPELLDIR/sv.utf-8.spl ../README_sv.txt
15
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
19
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
23
24../README_sv.txt : README_sv_SE.txt
25 :copy $source $target
26
27#
28# Fetching the files from OpenOffice.org.
29#
30OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
31:attr {fetch = $OODIR/%file%} sv_SE.zip
32
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.
35sv_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
47
48
49# Generate diff files, so that others can get the OpenOffice files and apply
50# the diffs to get the Vim versions.
51
52diff:
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
56
57
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.
60
61check:
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
79
80
81# vim: set sts=4 sw=4 :