Mercurial > vim
annotate runtime/spell/pt/main.aap @ 8623:58e749232bd7 v7.4.1601
commit https://github.com/vim/vim/commit/818c9e7edfce339eff7cb357f2ec29a72afd1977
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 19 16:09:42 2016 +0100
patch 7.4.1601
Problem: README files take a lot of space in the top directory.
Solution: Move most of them to "READMEdir".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 19 Mar 2016 16:15:04 +0100 |
parents | 5e4b1f442057 |
children | 82a28df1e2d5 |
rev | line source |
---|---|
502 | 1 # Aap recipe for Portuguese Vim spell files. |
1698 | 2 # See ftp://ftp.vim.org/pub/vim/runtime/spell/README.txt |
502 | 3 |
4 # Use a freshly compiled Vim if it exists. | |
5 @if os.path.exists('../../../src/vim'): | |
6 VIM = ../../../src/vim | |
7 @else: | |
8 :progsearch VIM vim | |
9 | |
10 SPELLDIR = .. | |
11 FILES = pt_PT.aff pt_PT.dic | |
12 pt_BR.aff pt_BR.dic | |
13 | |
1125 | 14 # |
15 # Fetching the pt_PT files from the Natura project. | |
16 # | |
2537
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
17 PT_FNAME = oo3x-pt-PT.oxt |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
18 PT_DIR = http://extensions.services.openoffice.org/e-files/1196/5/$(PT_FNAME) |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
19 :attr {fetch = $PT_DIR} $PT_FNAME |
1125 | 20 |
21 # | |
1622 | 22 # Fetching the pt_BR files from BrOffice.org (Brazilian OOo). |
1125 | 23 # |
2537
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
24 BR_FNAME = Vero_pt_BR_V207AOC.oxt |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
25 BR_DIR = http://www.broffice.org/files/$(BR_FNAME) |
1125 | 26 :attr {fetch = $BR_DIR} $BR_FNAME |
27 | |
502 | 28 all: $SPELLDIR/pt.latin1.spl $SPELLDIR/pt.utf-8.spl \ |
29 ../README_pt.txt | |
30 | |
31 $SPELLDIR/pt.latin1.spl : $FILES | |
2292
ea3c3f13385c
Update spell files for Ubuntu locale names.
Bram Moolenaar <bram@vim.org>
parents:
2152
diff
changeset
|
32 :sys env LANG=pt_PT.ISO-8859-1 LC_ALL=pt_PT.ISO-8859-1 |
502 | 33 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pt pt_PT pt_BR" -c q |
34 | |
35 $SPELLDIR/pt.utf-8.spl : $FILES | |
1125 | 36 :sys env LANG=pt_PT.UTF-8 LC_ALL=pt_PT.UTF-8 |
502 | 37 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pt pt_PT pt_BR" -c q |
38 | |
39 ../README_pt.txt: README_pt_PT.txt README_pt_BR.txt | |
40 :print pt_PT >!$target | |
41 :cat README_pt_PT.txt | :eval re.sub('\r', '', stdin) >>$target | |
42 :print =================================================== >>$target | |
43 :print pt_BR: >>$target | |
1622 | 44 :cat README_pt_BR.txt | :eval re.sub('\r', '', stdin) >>$target |
502 | 45 |
46 # The files don't depend on the .zip file so that we can delete it. | |
47 # Only download the zip file if the targets don't exist. | |
48 pt_PT.aff pt_PT.dic: {buildcheck=} | |
49 :assertpkg unzip patch | |
1125 | 50 :fetch $PT_FNAME |
51 :sys $UNZIP $PT_FNAME | |
52 :delete $PT_FNAME | |
2537
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
53 :move dictionaries/pt_PT.dic . |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
54 :move dictionaries/pt_PT.aff . |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
55 :move dictionaries/README_pt_PT.txt . |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
56 :move dictionaries/COPYING COPYING_pt_PT.txt |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
57 :delete {r}{f} dictionaries |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
58 :delete {r}{f} META-INF |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
59 :delete {f} description.xml |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
60 :delete {f} dictionaries.xcu |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
61 :delete {f} LICENSES.txt |
2551 | 62 # Remove grammer items and the duplicates this causes |
63 :sys $VIM pt_PT.dic -u NONE -e -c "%s/\t.*//" -c "2,$$ sort u" -c update -c q | |
2537
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
64 :sys $VIM pt_PT.aff -u NONE -e -c "%s/\S\+=\S\+$$//" -c update -c q |
502 | 65 @if not os.path.exists('pt_PT.orig.aff'): |
66 :copy pt_PT.aff pt_PT.orig.aff | |
67 @if not os.path.exists('pt_PT.orig.dic'): | |
68 :copy pt_PT.dic pt_PT.orig.dic | |
69 @if os.path.exists('pt_PT.diff'): | |
70 :sys patch <pt_PT.diff | |
71 | |
72 pt_BR.aff pt_BR.dic: {buildcheck=} | |
73 :assertpkg unzip patch | |
1125 | 74 :fetch $BR_FNAME |
75 :sys $UNZIP $BR_FNAME | |
76 :delete $BR_FNAME | |
2539
4b51e4be14ab
Updated translations. Added Portuguese tutor.
Bram Moolenaar <bram@vim.org>
parents:
2537
diff
changeset
|
77 :delete {f} description.xml |
4b51e4be14ab
Updated translations. Added Portuguese tutor.
Bram Moolenaar <bram@vim.org>
parents:
2537
diff
changeset
|
78 :delete {f} dictionaries.xcu |
4b51e4be14ab
Updated translations. Added Portuguese tutor.
Bram Moolenaar <bram@vim.org>
parents:
2537
diff
changeset
|
79 :delete {f} hyph_pt_BR.dic |
4b51e4be14ab
Updated translations. Added Portuguese tutor.
Bram Moolenaar <bram@vim.org>
parents:
2537
diff
changeset
|
80 :delete {r}{f} META-INF |
4b51e4be14ab
Updated translations. Added Portuguese tutor.
Bram Moolenaar <bram@vim.org>
parents:
2537
diff
changeset
|
81 :delete {f} README_en.TXT |
4b51e4be14ab
Updated translations. Added Portuguese tutor.
Bram Moolenaar <bram@vim.org>
parents:
2537
diff
changeset
|
82 :delete {f} README_hyph_pt_BR.TXT |
2537
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
83 :sys $VIM README_pt_BR.TXT -u NONE -N -e -c "set ff=unix" -c update -c q |
1622 | 84 :move README_pt_BR.TXT README_pt_BR.txt |
1125 | 85 |
2537
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
86 :sys $VIM pt_BR.dic -u NONE -N -e -c "set ff=unix" -c update -c q |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
87 :sys $VIM pt_BR.aff -u NONE -N -e -c "set ff=unix" -c update -c q |
502 | 88 @if not os.path.exists('pt_BR.orig.aff'): |
89 :copy pt_BR.aff pt_BR.orig.aff | |
90 @if not os.path.exists('pt_BR.orig.dic'): | |
91 :copy pt_BR.dic pt_BR.orig.dic | |
92 @if os.path.exists('pt_BR.diff'): | |
93 :sys patch <pt_BR.diff | |
94 | |
95 | |
96 # Generate diff files, so that others can get the OpenOffice files and apply | |
97 # the diffs to get the Vim versions. | |
98 | |
99 diff: | |
100 :assertpkg diff | |
101 :sys {force} diff -a -C 1 pt_PT.orig.aff pt_PT.aff >pt_PT.diff | |
102 :sys {force} diff -a -C 1 pt_PT.orig.dic pt_PT.dic >>pt_PT.diff | |
103 :sys {force} diff -a -C 1 pt_BR.orig.aff pt_BR.aff >pt_BR.diff | |
104 :sys {force} diff -a -C 1 pt_BR.orig.dic pt_BR.dic >>pt_BR.diff | |
105 | |
2537
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
106 # Delete all downloaded and generated files. |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
107 clean: clean_pt_BR clean_pt_PT |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
108 |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
109 clean_pt_BR: |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
110 :delete {f} pt_BR.aff |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
111 :delete {f} pt_BR.dic |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
112 :delete {f} pt_BR.orig.aff |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
113 :delete {f} pt_BR.orig.dic |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
114 :delete {f} README_pt_BR.txt |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
115 |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
116 clean_pt_PT: |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
117 :delete {f} pt_PT.aff |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
118 :delete {f} pt_PT.dic |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
119 :delete {f} pt_PT.orig.aff |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
120 :delete {f} pt_PT.orig.dic |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
121 :delete {f} README_pt_PT.txt |
6efdc2e61533
Improved pt_PT spell file generation.
Bram Moolenaar <bram@vim.org>
parents:
2292
diff
changeset
|
122 :delete {f} COPYING_pt_PT.txt |
502 | 123 |
124 # Check for updated OpenOffice spell files. When there are changes the | |
125 # ".new.aff" and ".new.dic" files are left behind for manual inspection. | |
1125 | 126 # TO BE IMPLEMENTED |
502 | 127 |
1125 | 128 check: check-pt check-br |
502 | 129 |
1125 | 130 check-pt: |
502 | 131 :assertpkg unzip diff |
1622 | 132 :fetch $PT_FNAME |
502 | 133 :mkdir tmp |
134 :cd tmp | |
135 @try: | |
136 @import stat | |
1622 | 137 :sys $UNZIP ../$PT_FNAME |
502 | 138 :sys {force} diff ../pt_PT.orig.aff pt_PT.aff >d |
139 @if os.stat('d')[stat.ST_SIZE] > 0: | |
140 :copy pt_PT.aff ../pt_PT.new.aff | |
141 :sys {force} diff ../pt_PT.orig.dic pt_PT.dic >d | |
142 @if os.stat('d')[stat.ST_SIZE] > 0: | |
143 :copy pt_PT.dic ../pt_PT.new.dic | |
144 @finally: | |
145 :cd .. | |
146 :delete {r}{f}{q} tmp | |
1622 | 147 :delete $PT_FNAME |
502 | 148 |
1125 | 149 check-br: |
502 | 150 :assertpkg unzip diff |
1622 | 151 :fetch $BR_FNAME |
502 | 152 :mkdir tmp |
153 :cd tmp | |
154 @try: | |
155 @import stat | |
1622 | 156 :sys $UNZIP ../$BR_FNAME |
502 | 157 :sys {force} diff ../pt_BR.orig.aff pt_BR.aff >d |
158 @if os.stat('d')[stat.ST_SIZE] > 0: | |
159 :copy pt_BR.aff ../pt_BR.new.aff | |
160 :sys {force} diff ../pt_BR.orig.dic pt_BR.dic >d | |
161 @if os.stat('d')[stat.ST_SIZE] > 0: | |
162 :copy pt_BR.dic ../pt_BR.new.dic | |
163 @finally: | |
164 :cd .. | |
165 :delete {r}{f}{q} tmp | |
1622 | 166 :delete $BR_FNAME |
502 | 167 |
168 # vim: set sts=4 sw=4 : |