blob: 91c689bf7b111ae300c0a47c44dad5da353594fb [file] [log] [blame]
Bram Moolenaare344bea2005-09-01 20:46:49 +00001# Aap recipe for Portuguese 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 = pt_PT.aff pt_PT.dic
11 pt_BR.aff pt_BR.dic
12
13all: $SPELLDIR/pt.latin1.spl $SPELLDIR/pt.utf-8.spl \
14 ../README_pt.txt
15
16$SPELLDIR/pt.latin1.spl : $FILES
17 :sys env LANG=pt_PT.ISO8859-1
18 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pt pt_PT pt_BR" -c q
19
20$SPELLDIR/pt.utf-8.spl : $FILES
21 :sys env LANG=pt_PT.UTF-8
22 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pt pt_PT pt_BR" -c q
23
24../README_pt.txt: README_pt_PT.txt README_pt_BR.txt
25 :print pt_PT >!$target
26 :cat README_pt_PT.txt | :eval re.sub('\r', '', stdin) >>$target
27 :print =================================================== >>$target
28 :print pt_BR: >>$target
29 :cat README_pt_BR.txt | :eval re.sub('\r', '', stdin) >>$target
30
31#
32# Fetching the files from OpenOffice.org.
33#
34OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
35:attr {fetch = $OODIR/%file%} pt_PT.zip pt_BR.zip
36
37# The files don't depend on the .zip file so that we can delete it.
38# Only download the zip file if the targets don't exist.
39pt_PT.aff pt_PT.dic: {buildcheck=}
40 :assertpkg unzip patch
41 :fetch pt_PT.zip
42 :sys $UNZIP pt_PT.zip
43 :delete pt_PT.zip
44 :sys $VIM pt_PT.dic -e -c "set ff=unix" -c update -c q
45 :sys $VIM README_pt_PT.txt -e -c "set ff=unix" -c update -c q
46 @if not os.path.exists('pt_PT.orig.aff'):
47 :copy pt_PT.aff pt_PT.orig.aff
48 @if not os.path.exists('pt_PT.orig.dic'):
49 :copy pt_PT.dic pt_PT.orig.dic
50 @if os.path.exists('pt_PT.diff'):
51 :sys patch <pt_PT.diff
52
53pt_BR.aff pt_BR.dic: {buildcheck=}
54 :assertpkg unzip patch
55 :fetch pt_BR.zip
56 :sys $UNZIP pt_BR.zip
57 :delete pt_BR.zip
58 :sys $VIM pt_BR.aff -e -c "set ff=unix" -c update -c q
59 :sys $VIM pt_BR.dic -e -c "set ff=unix" -c update -c q
60 :sys $VIM README_pt_BR.txt -e -c "set ff=unix" -c update -c q
61 @if not os.path.exists('pt_BR.orig.aff'):
62 :copy pt_BR.aff pt_BR.orig.aff
63 @if not os.path.exists('pt_BR.orig.dic'):
64 :copy pt_BR.dic pt_BR.orig.dic
65 @if os.path.exists('pt_BR.diff'):
66 :sys patch <pt_BR.diff
67
68
69# Generate diff files, so that others can get the OpenOffice files and apply
70# the diffs to get the Vim versions.
71
72diff:
73 :assertpkg diff
74 :sys {force} diff -a -C 1 pt_PT.orig.aff pt_PT.aff >pt_PT.diff
75 :sys {force} diff -a -C 1 pt_PT.orig.dic pt_PT.dic >>pt_PT.diff
76 :sys {force} diff -a -C 1 pt_BR.orig.aff pt_BR.aff >pt_BR.diff
77 :sys {force} diff -a -C 1 pt_BR.orig.dic pt_BR.dic >>pt_BR.diff
78
79
80# Check for updated OpenOffice spell files. When there are changes the
81# ".new.aff" and ".new.dic" files are left behind for manual inspection.
82
83check: check-us check-au
84
85check-us:
86 :assertpkg unzip diff
87 :fetch pt_PT.zip
88 :mkdir tmp
89 :cd tmp
90 @try:
91 @import stat
92 :sys $UNZIP ../pt_PT.zip
93 :sys {force} diff ../pt_PT.orig.aff pt_PT.aff >d
94 @if os.stat('d')[stat.ST_SIZE] > 0:
95 :copy pt_PT.aff ../pt_PT.new.aff
96 :sys {force} diff ../pt_PT.orig.dic pt_PT.dic >d
97 @if os.stat('d')[stat.ST_SIZE] > 0:
98 :copy pt_PT.dic ../pt_PT.new.dic
99 @finally:
100 :cd ..
101 :delete {r}{f}{q} tmp
102 :delete pt_PT.zip
103
104check-au:
105 :assertpkg unzip diff
106 :fetch pt_BR.zip
107 :mkdir tmp
108 :cd tmp
109 @try:
110 @import stat
111 :sys $UNZIP ../pt_BR.zip
112 :sys {force} diff ../pt_BR.orig.aff pt_BR.aff >d
113 @if os.stat('d')[stat.ST_SIZE] > 0:
114 :copy pt_BR.aff ../pt_BR.new.aff
115 :sys {force} diff ../pt_BR.orig.dic pt_BR.dic >d
116 @if os.stat('d')[stat.ST_SIZE] > 0:
117 :copy pt_BR.dic ../pt_BR.new.dic
118 @finally:
119 :cd ..
120 :delete {r}{f}{q} tmp
121 :delete pt_BR.zip
122
123# vim: set sts=4 sw=4 :