blob: 8ba8c1a043cc7512139f282654b735b54d38352b [file] [log] [blame]
Bram Moolenaarae5bce12005-08-15 21:41:48 +00001# Aap recipe for Catelan (Spain) 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 = ca_ES.aff ca_ES.dic
11
12all: $SPELLDIR/ca.latin1.spl $SPELLDIR/ca.utf-8.spl ../README_ca.txt
13
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000014$SPELLDIR/ca.latin1.spl : $FILES
Bram Moolenaarae5bce12005-08-15 21:41:48 +000015 :sys env LANG=ca_ES.ISO8859-1
16 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ca ca_ES" -c q
17
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000018$SPELLDIR/ca.utf-8.spl : $FILES
Bram Moolenaarae5bce12005-08-15 21:41:48 +000019 :sys env LANG=ca_ES.UTF-8
20 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ca ca_ES" -c q
21
22../README_ca.txt : README_ca_ES.txt
23 :copy $source $target
24
25#
26# Fetching the files from OpenOffice.org.
27#
28OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
29:attr {fetch = $OODIR/%file%} ca_ES.zip
30
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# Make sure the files are in Unix fileformat
34ca_ES.aff ca_ES.dic: {buildcheck=}
35 :assertpkg unzip patch
36 :fetch ca_ES.zip
37 :sys $UNZIP ca_ES.zip
38 :delete ca_ES.zip
Bram Moolenaar00a927d2010-05-14 23:24:24 +020039 :sys $VIM ca_ES.aff -u NONE -c "set ff=unix" -c "update" -c q
40 :sys $VIM ca_ES.dic -u NONE -c "set ff=unix" -c "update" -c q
Bram Moolenaarae5bce12005-08-15 21:41:48 +000041 @if not os.path.exists('ca_ES.orig.aff'):
42 :copy ca_ES.aff ca_ES.orig.aff
43 @if not os.path.exists('ca_ES.orig.dic'):
44 :copy ca_ES.dic ca_ES.orig.dic
45 @if os.path.exists('ca_ES.diff'):
46 :sys patch <ca_ES.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 ca_ES.orig.aff ca_ES.aff >ca_ES.diff
55 :sys {force} diff -a -C 1 ca_ES.orig.dic ca_ES.dic >>ca_ES.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 ca_ES.zip
64 :mkdir tmp
65 :cd tmp
66 @try:
67 @import stat
68 :sys $UNZIP ../ca_ES.zip
69 :sys {force} diff ../ca_ES.orig.aff ca_ES.aff >d
70 @if os.stat('d')[stat.ST_SIZE] > 0:
71 :copy ca_ES.aff ../ca_ES.new.aff
72 :sys {force} diff ../ca_ES.orig.dic ca_ES.dic >d
73 @if os.stat('d')[stat.ST_SIZE] > 0:
74 :copy ca_ES.dic ../ca_ES.new.dic
75 @finally:
76 :cd ..
77 :delete {r}{f}{q} tmp
78 :delete ca_ES.zip
79
80
81# vim: set sts=4 sw=4 :