1 # Aap recipe for Maori Vim spell files.
3 # Use a freshly compiled Vim if it exists.
4 @if os.path.exists('../../../src/vim'):
10 FILES = mi_NZ.aff mi_NZ.dic
12 all: $SPELLDIR/mi.iso-8859-4.spl $SPELLDIR/mi.utf-8.spl ../README_mi.txt
14 $SPELLDIR/mi.iso-8859-4.spl : $FILES
15 :sys $VIM -u NONE -e -c "set enc=iso-8859-4"
16 -c "mkspell! $SPELLDIR/mi mi_NZ" -c q
18 $SPELLDIR/mi.utf-8.spl : $FILES
19 :sys $VIM -u NONE -e -c "set enc=utf-8"
20 -c "mkspell! $SPELLDIR/mi mi_NZ" -c q
22 ../README_mi.txt : README_mi_NZ.txt
26 # Fetching the files from OpenOffice.org.
28 OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
29 :attr {fetch = $OODIR/%file%} mi_NZ.zip
31 # The files don't depend on the .zip file so that we can delete it.
32 # Only download the zip file if the targets don't exist.
33 mi_NZ.aff mi_NZ.dic: {buildcheck=}
34 :assertpkg unzip patch
38 # Fix missing end of line.
40 @if not os.path.exists('mi_NZ.orig.aff'):
41 :copy mi_NZ.aff mi_NZ.orig.aff
42 @if not os.path.exists('mi_NZ.orig.dic'):
43 :copy mi_NZ.dic mi_NZ.orig.dic
44 @if os.path.exists('mi_NZ.diff'):
45 :sys patch <mi_NZ.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 mi_NZ.orig.aff mi_NZ.aff >mi_NZ.diff
54 :sys {force} diff -a -C 1 mi_NZ.orig.dic mi_NZ.dic >>mi_NZ.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 ../mi_NZ.zip
68 :sys {force} diff ../mi_NZ.orig.aff mi_NZ.aff >d
69 @if os.stat('d')[stat.ST_SIZE] > 0:
70 :copy mi_NZ.aff ../mi_NZ.new.aff
71 :sys {force} diff ../mi_NZ.orig.dic mi_NZ.dic >d
72 @if os.stat('d')[stat.ST_SIZE] > 0:
73 :copy mi_NZ.dic ../mi_NZ.new.dic
80 # vim: set sts=4 sw=4 :