1 # Aap recipe for Bulgarian Vim spell files.
3 # Use a freshly compiled Vim if it exists.
4 @if os.path.exists('../../../src/vim'):
10 FILES = bg_BG.aff bg_BG.dic
12 all: $SPELLDIR/bg.cp1251.spl $SPELLDIR/bg.utf-8.spl ../README_bg.txt
14 $SPELLDIR/bg.cp1251.spl : $FILES
15 :sys env LANG=bg_BG.CP1251 $VIM -u NONE -e -c "mkspell! $SPELLDIR/bg bg_BG" -c q
17 $SPELLDIR/bg.utf-8.spl : $FILES
18 :sys env LANG=bg_BG.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/bg bg_BG" -c q
20 ../README_bg.txt: README_bg_BG.txt
24 # Fetching the files from OpenOffice.org.
26 OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
27 :attr {fetch = $OODIR/%file%} bg_BG.zip
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.
32 bg_BG.aff bg_BG.dic: {buildcheck=}
33 :assertpkg unzip patch
37 :sys $VIM bg_BG.aff -e -c "set ff=unix" -c update -c q
38 :sys $VIM bg_BG.dic -e -c "set ff=unix" -c update -c q
39 :sys $VIM README_bg_BG.txt -e -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
48 # Generate diff files, so that others can get the OpenOffice files and apply
49 # the diffs to get the Vim versions.
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
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.
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
80 # vim: set sts=4 sw=4 :