502
|
1 # Aap recipe for Welsh 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
|
|
9 SPELLDIR = ..
|
|
10 FILES = cy_GB.aff cy_GB.dic
|
|
11
|
|
12 all: $SPELLDIR/cy.iso-8859-14.spl $SPELLDIR/cy.utf-8.spl \
|
|
13 ../README_cy.txt
|
|
14
|
|
15 $SPELLDIR/cy.iso-8859-14.spl : $FILES
|
|
16 :sys $VIM -u NONE -e -c "set enc=iso-8859-14"
|
|
17 -c "mkspell! $SPELLDIR/cy cy_GB" -c q
|
|
18
|
|
19 $SPELLDIR/cy.utf-8.spl : $FILES
|
|
20 :sys $VIM -u NONE -e -c "set enc=utf-8"
|
|
21 -c "mkspell! $SPELLDIR/cy cy_GB" -c q
|
|
22
|
|
23 ../README_cy.txt : README_cy_GB.txt
|
|
24 :copy $source $target
|
|
25
|
|
26 #
|
|
27 # Fetching the files from OpenOffice.org.
|
|
28 #
|
|
29 OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
|
|
30 :attr {fetch = $OODIR/%file%} cy_GB.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.
|
|
34 cy_GB.aff cy_GB.dic: {buildcheck=}
|
|
35 :assertpkg unzip patch
|
|
36 :fetch cy_GB.zip
|
|
37 :sys $UNZIP cy_GB.zip
|
|
38 :delete cy_GB.zip
|
|
39 :sys $VIM cy_GB.aff -e -c "set ff=unix" -c update -c q
|
|
40 :sys $VIM cy_GB.dic -e -c "set ff=unix" -c update -c q
|
|
41 :sys $VIM README_cy_GB.txt -e -c "set ff=unix" -c update -c q
|
|
42 @if not os.path.exists('cy_GB.orig.aff'):
|
|
43 :copy cy_GB.aff cy_GB.orig.aff
|
|
44 @if not os.path.exists('cy_GB.orig.dic'):
|
|
45 :copy cy_GB.dic cy_GB.orig.dic
|
|
46 @if os.path.exists('cy_GB.diff'):
|
|
47 :sys patch <cy_GB.diff
|
|
48
|
|
49
|
|
50 # Generate diff files, so that others can get the OpenOffice files and apply
|
|
51 # the diffs to get the Vim versions.
|
|
52
|
|
53 diff:
|
|
54 :assertpkg diff
|
|
55 :sys {force} diff -a -C 1 cy_GB.orig.aff cy_GB.aff >cy_GB.diff
|
|
56 :sys {force} diff -a -C 1 cy_GB.orig.dic cy_GB.dic >>cy_GB.diff
|
|
57
|
|
58
|
|
59 # Check for updated OpenOffice spell files. When there are changes the
|
|
60 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
|
|
61
|
|
62 check:
|
|
63 :assertpkg unzip diff
|
|
64 :fetch cy_GB.zip
|
|
65 :mkdir tmp
|
|
66 :cd tmp
|
|
67 @try:
|
|
68 @import stat
|
|
69 :sys $UNZIP ../cy_GB.zip
|
|
70 :sys {force} diff ../cy_GB.orig.aff cy_GB.aff >d
|
|
71 @if os.stat('d')[stat.ST_SIZE] > 0:
|
|
72 :copy cy_GB.aff ../cy_GB.new.aff
|
|
73 :sys {force} diff ../cy_GB.orig.dic cy_GB.dic >d
|
|
74 @if os.stat('d')[stat.ST_SIZE] > 0:
|
|
75 :copy cy_GB.dic ../cy_GB.new.dic
|
|
76 @finally:
|
|
77 :cd ..
|
|
78 :delete {r}{f}{q} tmp
|
|
79 :delete cy_GB.zip
|
|
80
|
|
81
|
|
82 # vim: set sts=4 sw=4 :
|