blob: 536a0452ffd3ba8f532147238f416a9d4b0525d4 [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 Moolenaar607cc1e2010-07-18 18:47:44 +020024../README_sv.txt : README_sv.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 Moolenaar607cc1e2010-07-18 18:47:44 +020044 :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
Bram Moolenaare344bea2005-09-01 20:46:49 +000047 @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
53
Bram Moolenaar607cc1e2010-07-18 18:47:44 +020054# Delete all the generated files, start from scratch
55clean:
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
Bram Moolenaare344bea2005-09-01 20:46:49 +000060
61# Generate diff files, so that others can get the OpenOffice files and apply
62# the diffs to get the Vim versions.
63
64diff:
65 :assertpkg diff
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
68
69
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.
72
73check:
74 :assertpkg unzip diff
Bram Moolenaar7abcaab2010-07-12 23:05:41 +020075 :fetch ooo_swedish_dict_1.43.oxt
Bram Moolenaare344bea2005-09-01 20:46:49 +000076 :mkdir tmp
77 :cd tmp
78 @try:
79 @import stat
Bram Moolenaar7abcaab2010-07-12 23:05:41 +020080 :sys $UNZIP ../ooo_swedish_dict_1.43.oxt
Bram Moolenaare344bea2005-09-01 20:46:49 +000081 :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
87 @finally:
88 :cd ..
89 :delete {r}{f}{q} tmp
Bram Moolenaar7abcaab2010-07-12 23:05:41 +020090 :delete ooo_swedish_dict_1.43.oxt
Bram Moolenaare344bea2005-09-01 20:46:49 +000091
92
93# vim: set sts=4 sw=4 :