blob: 1d9b428d259055549ab98543b8ae724ab31e59af [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#
Bram Moolenaar9c754c42010-07-10 15:52:35 +02003# Maintainer: Mattias Winther <vim@mattias.winthernet.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
Bram Moolenaar9c754c42010-07-10 15:52:35 +020017 :sys env LANG=sv_SE.ISO-8859-1
Bram Moolenaare344bea2005-09-01 20:46:49 +000018 $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
Bram Moolenaar9c754c42010-07-10 15:52:35 +020024../README_sv.txt : LICENSE_sv_SE.txt
Bram Moolenaare344bea2005-09-01 20:46:49 +000025 :copy $source $target
26
27#
28# Fetching the files from OpenOffice.org.
29#
Bram Moolenaar7abcaab2010-07-12 23:05:41 +020030OODIR = http://extensions.services.openoffice.org/e-files/1080/7
31:attr {fetch = $OODIR/%file%} ooo_swedish_dict_1.43.oxt
Bram Moolenaare344bea2005-09-01 20:46:49 +000032
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
Bram Moolenaar7abcaab2010-07-12 23:05:41 +020037 :fetch ooo_swedish_dict_1.43.oxt
38 :sys $UNZIP ooo_swedish_dict_1.43.oxt
39 :delete ooo_swedish_dict_1.43.oxt
Bram Moolenaar9c754c42010-07-10 15:52:35 +020040 :delete {r} META-INF
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
Bram Moolenaare344bea2005-09-01 20:46:49 +000044 @if not os.path.exists('sv_SE.orig.aff'):
45 :copy sv_SE.aff sv_SE.orig.aff
46 @if not os.path.exists('sv_SE.orig.dic'):
47 :copy sv_SE.dic sv_SE.orig.dic
48 @if os.path.exists('sv_SE.diff'):
49 :sys patch <sv_SE.diff
50
51
52# Generate diff files, so that others can get the OpenOffice files and apply
53# the diffs to get the Vim versions.
54
55diff:
56 :assertpkg diff
57 :sys {force} diff -a -C 1 sv_SE.orig.aff sv_SE.aff >sv_SE.diff
58 :sys {force} diff -a -C 1 sv_SE.orig.dic sv_SE.dic >>sv_SE.diff
59
60
61# Check for updated OpenOffice spell files. When there are changes the
62# ".new.aff" and ".new.dic" files are left behind for manual inspection.
63
64check:
65 :assertpkg unzip diff
Bram Moolenaar7abcaab2010-07-12 23:05:41 +020066 :fetch ooo_swedish_dict_1.43.oxt
Bram Moolenaare344bea2005-09-01 20:46:49 +000067 :mkdir tmp
68 :cd tmp
69 @try:
70 @import stat
Bram Moolenaar7abcaab2010-07-12 23:05:41 +020071 :sys $UNZIP ../ooo_swedish_dict_1.43.oxt
Bram Moolenaare344bea2005-09-01 20:46:49 +000072 :sys {force} diff ../sv_SE.orig.aff sv_SE.aff >d
73 @if os.stat('d')[stat.ST_SIZE] > 0:
74 :copy sv_SE.aff ../sv_SE.new.aff
75 :sys {force} diff ../sv_SE.orig.dic sv_SE.dic >d
76 @if os.stat('d')[stat.ST_SIZE] > 0:
77 :copy sv_SE.dic ../sv_SE.new.dic
78 @finally:
79 :cd ..
80 :delete {r}{f}{q} tmp
Bram Moolenaar7abcaab2010-07-12 23:05:41 +020081 :delete ooo_swedish_dict_1.43.oxt
Bram Moolenaare344bea2005-09-01 20:46:49 +000082
83
84# vim: set sts=4 sw=4 :