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