blob: 09bb3d15c95ac75f1d8c8bfa02ed120d7b20e9b8 [file] [log] [blame]
Bram Moolenaare344bea2005-09-01 20:46:49 +00001# Aap recipe for Malay 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 = ms_MY.aff ms_MY.dic
11
12# I do not have a Malay locale, use the Dutch one instead.
13all: $SPELLDIR/ms.latin1.spl $SPELLDIR/ms.utf-8.spl ../README_ms.txt
14
15$SPELLDIR/ms.latin1.spl : $FILES
16 :sys env LANG=nl_NL.ISO8859-1
17 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ms ms_MY" -c q
18
19$SPELLDIR/ms.utf-8.spl : $FILES
20 :sys env LANG=nl_NL.UTF-8
21 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ms ms_MY" -c q
22
23../README_ms.txt : README_ms_MY.txt
24 :copy $source $target
25
26#
27# Fetching the files from OpenOffice.org.
28#
29OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
30:attr {fetch = $OODIR/%file%} ms_MY.zip
31
32# The files don't depend on the .zip file so that we can delete it.
33# Only download the zip file if the targets don't exist.
34ms_MY.aff ms_MY.dic: {buildcheck=}
35 :assertpkg unzip patch
36 :fetch ms_MY.zip
37 :sys $UNZIP ms_MY.zip
38 :delete ms_MY.zip
Bram Moolenaar00a927d2010-05-14 23:24:24 +020039 :sys $VIM ms_MY.aff -u NONE -e -c "set ff=unix" -c update -c q
40 :sys $VIM ms_MY.dic -u NONE -e -c "set ff=unix" -c update -c q
Bram Moolenaare344bea2005-09-01 20:46:49 +000041 @if not os.path.exists('ms_MY.orig.aff'):
42 :copy ms_MY.aff ms_MY.orig.aff
43 @if not os.path.exists('ms_MY.orig.dic'):
44 :copy ms_MY.dic ms_MY.orig.dic
45 @if os.path.exists('ms_MY.diff'):
46 :sys patch <ms_MY.diff
47
48
49# Generate diff files, so that others can get the OpenOffice files and apply
50# the diffs to get the Vim versions.
51
52diff:
53 :assertpkg diff
54 :sys {force} diff -a -C 1 ms_MY.orig.aff ms_MY.aff >ms_MY.diff
55 :sys {force} diff -a -C 1 ms_MY.orig.dic ms_MY.dic >>ms_MY.diff
56
57
58# Check for updated OpenOffice spell files. When there are changes the
59# ".new.aff" and ".new.dic" files are left behind for manual inspection.
60
61check:
62 :assertpkg unzip diff
63 :fetch ms_MY.zip
64 :mkdir tmp
65 :cd tmp
66 @try:
67 @import stat
68 :sys $UNZIP ../ms_MY.zip
69 :sys {force} diff ../ms_MY.orig.aff ms_MY.aff >d
70 @if os.stat('d')[stat.ST_SIZE] > 0:
71 :copy ms_MY.aff ../ms_MY.new.aff
72 :sys {force} diff ../ms_MY.orig.dic ms_MY.dic >d
73 @if os.stat('d')[stat.ST_SIZE] > 0:
74 :copy ms_MY.dic ../ms_MY.new.dic
75 @finally:
76 :cd ..
77 :delete {r}{f}{q} tmp
78 :delete ms_MY.zip
79
80
81# vim: set sts=4 sw=4 :