blob: 7849526ed0065d2e49b4e52b27bda7e27877aefd [file] [log] [blame]
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001# Aap recipe for Czech Vim spell files.
2
3# Use a freshly compiled Vim if it exists.
4@if os.path.exists('../../../src/vim'):
5 VIM = ../../../src/vim
6@else:
7 :progsearch VIM vim
8
9SPELLDIR = ..
10FILES = bg_BG.aff bg_BG.dic
11
12all: $SPELLDIR/bg.cp1251.spl $SPELLDIR/bg.utf-8.spl ../README_bg.txt
13
14$SPELLDIR/bg.cp1251.spl : $VIM $FILES
15 :sys env LANG=bg_BG.CP1251 $VIM -u NONE -e -c "mkspell! $SPELLDIR/bg bg_BG" -c q
16
17$SPELLDIR/bg.utf-8.spl : $VIM $FILES
18 :sys env LANG=bg_BG.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/bg bg_BG" -c q
19
20../README_bg.txt: README_bg_BG.txt
21 :copy $source $target
22
23#
24# Fetching the files from OpenOffice.org.
25#
26OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
27:attr {fetch = $OODIR/%file%} bg_BG.zip
28
29# The files don't depend on the .zip file so that we can delete it.
30# Only download the zip file if the targets don't exist.
31# This is a bit tricky, since the file name includes the date.
32bg_BG.aff bg_BG.dic: {buildcheck=}
33 :assertpkg unzip patch
34 :fetch bg_BG.zip
35 :sys $UNZIP bg_BG.zip
36 :delete bg_BG.zip
37 :sys $VIM bg_BG.aff -c "set ff=unix" -c "update" -c q
38 :sys $VIM bg_BG.dic -c "set ff=unix" -c "update" -c q
39 @if not os.path.exists('bg_BG.orig.aff'):
40 :copy bg_BG.aff bg_BG.orig.aff
41 @if not os.path.exists('bg_BG.orig.dic'):
42 :copy bg_BG.dic bg_BG.orig.dic
43 @if os.path.exists('bg_BG.diff'):
44 :sys patch <bg_BG.diff
45
46
47# Generate diff files, so that others can get the OpenOffice files and apply
48# the diffs to get the Vim versions.
49
50diff:
51 :assertpkg diff
52 :sys {force} diff -a -C 1 bg_BG.orig.aff bg_BG.aff >bg_BG.diff
53 :sys {force} diff -a -C 1 bg_BG.orig.dic bg_BG.dic >>bg_BG.diff
54
55
56# Check for updated OpenOffice spell files. When there are changes the
57# ".new.aff" and ".new.dic" files are left behind for manual inspection.
58
59check:
60 :assertpkg unzip diff
61 :fetch bg_BG.zip
62 :mkdir tmp
63 :cd tmp
64 @try:
65 @import stat
66 :sys $UNZIP ../bg_BG.zip
67 :sys {force} diff ../bg_BG.orig.aff bg_BG.aff >d
68 @if os.stat('d')[stat.ST_SIZE] > 0:
69 :copy bg_BG.aff ../bg_BG.new.aff
70 :sys {force} diff ../bg_BG.orig.dic bg_BG.dic >d
71 @if os.stat('d')[stat.ST_SIZE] > 0:
72 :copy bg_BG.dic ../bg_BG.new.dic
73 @finally:
74 :cd ..
75 :delete {r}{f}{q} tmp
76 :delete bg_BG.zip
77
78
79# vim: set sts=4 sw=4 :