blob: a0cf374495040172c42051724fd7805e9415f047 [file] [log] [blame]
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001# Aap recipe for French Vim spell files.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00002
3# Use a freshly compiled Vim if it exists.
4@if os.path.exists('../../../src/vim'):
5 VIM = ../../../src/vim
6@else:
Bram Moolenaar34cf2f52005-08-01 07:04:56 +00007 :progsearch VIM vim
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00008
9SPELLDIR = ..
10FILES = fr_FR.aff fr_FR.dic
11
Bram Moolenaarae5bce12005-08-15 21:41:48 +000012all: $SPELLDIR/fr.latin1.spl $SPELLDIR/fr.utf-8.spl ../README_fr.txt
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000013
Bram Moolenaarf2330482008-06-24 20:19:36 +000014# The spell file is iso-8859-15, but Vim normally uses "latin1" for this.
15# This is OK for the utf-8 files, but for latin1 we need to avoid the "oe"
16# character. When unpacking we create four files:
17# fr_FR_latin1.aff modified file
18# fr_FR_latin1.dic modified file
19# fr_FR_iso15.aff original file (after applying diff)
20# fr_FR_iso15.dic original file (after applying diff)
21# Just before using the dictionary files, the right ones are copied to
22# fr_FR.aff
23# fr_FR.dic
24
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000025$SPELLDIR/fr.latin1.spl : $FILES
Bram Moolenaarf2330482008-06-24 20:19:36 +000026 :copy {force} fr_FR_latin1.aff fr_FR.aff
27 :copy {force} fr_FR_latin1.dic fr_FR.dic
Bram Moolenaar9c754c42010-07-10 15:52:35 +020028 :sys env LANG=fr_FR.ISO-8859-15@euro
Bram Moolenaarae5bce12005-08-15 21:41:48 +000029 $VIM -u NONE -e -c "mkspell! $SPELLDIR/fr fr_FR" -c q
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000030
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000031$SPELLDIR/fr.utf-8.spl : $FILES
Bram Moolenaarf2330482008-06-24 20:19:36 +000032 :copy {force} fr_FR_iso15.aff fr_FR.aff
33 :copy {force} fr_FR_iso15.dic fr_FR.dic
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000034 :sys env LANG=fr_FR.UTF-8
Bram Moolenaarae5bce12005-08-15 21:41:48 +000035 $VIM -u NONE -e -c "mkspell! $SPELLDIR/fr fr_FR" -c q
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000036
Bram Moolenaarbb15b652005-10-03 21:52:09 +000037../README_fr.txt : README_fr_FR.txt
Bram Moolenaare344bea2005-09-01 20:46:49 +000038 :cat $source >!$target
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000039
40#
Bram Moolenaarf2330482008-06-24 20:19:36 +000041# Used to fetch the files from OpenOffice.org. Those are old.
42# Later versions are elsewhere.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000043#
Bram Moolenaarf2330482008-06-24 20:19:36 +000044#OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
45ZIPFILE = http://dico.savant.free.fr/_download/fr_FR_1-1-6.zip
46
47:attr {fetch = $ZIPFILE} fr_FR.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000048
49# The files don't depend on the .zip file so that we can delete it.
50# Only download the zip file if the targets don't exist.
51fr_FR.aff fr_FR.dic: {buildcheck=}
52 :assertpkg unzip patch
53 :fetch fr_FR.zip
Bram Moolenaarae5bce12005-08-15 21:41:48 +000054 :sys $UNZIP fr_FR.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000055 :delete fr_FR.zip
56 @if not os.path.exists('fr_FR.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000057 :copy fr_FR.aff fr_FR.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000058 @if not os.path.exists('fr_FR.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000059 :copy fr_FR.dic fr_FR.orig.dic
Bram Moolenaar34cf2f52005-08-01 07:04:56 +000060 @if os.path.exists('fr_FR.diff'):
61 :sys patch <fr_FR.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000062
Bram Moolenaarf2330482008-06-24 20:19:36 +000063 # Keep the unmodified files (after diff) for ISO-8859-15.
64 :copy fr_FR.aff fr_FR_iso15.aff
65 :copy fr_FR.dic fr_FR_iso15.dic
66 # For the latin1 .dic file change all the "oe" characters to the two
67 # characters "oe".
68 :sys $VIM -u NONE -e -c "set enc=latin1"
69 -c "e fr_FR.dic"
70 -c "%s/½/oe/g"
71 -c "w! fr_FR_latin1.dic"
72 -c q
73 # For the latin1 .aff file delete all the "oe" and "OE" characters and
74 # delete the REP lines with those characters.
75 :sys $VIM -u NONE -e -c "set enc=latin1"
76 -c "e fr_FR.aff"
77 -c "%s/½//g"
78 -c "%s/¼//g"
79 -c "%g/REP.*oe/d"
80 -c "w! fr_FR_latin1.aff"
81 -c q
82
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000083
84# Generate diff files, so that others can get the OpenOffice files and apply
85# the diffs to get the Vim versions.
Bram Moolenaarf2330482008-06-24 20:19:36 +000086# This uses the iso-8859-15 files.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000087diff:
88 :assertpkg diff
Bram Moolenaarf2330482008-06-24 20:19:36 +000089 :copy {force} fr_FR_iso15.aff fr_FR.aff
90 :copy {force} fr_FR_iso15.dic fr_FR.dic
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000091 :sys {force} diff -a -C 1 fr_FR.orig.aff fr_FR.aff >fr_FR.diff
92 :sys {force} diff -a -C 1 fr_FR.orig.dic fr_FR.dic >>fr_FR.diff
93
Bram Moolenaarf2330482008-06-24 20:19:36 +000094# Delete all the unpacked and generated files, including the "orig" files.
95clean:
96 :delete {force} fr_FR.zip fr_FR.aff fr_FR.dic
97 fr_FR.aff.orig fr_FR.dic.orig
98 fr_FR.orig.aff fr_FR.orig.dic
99 fr_FR_latin1.aff fr_FR_latin1.dic
100 fr_FR_iso15.aff fr_FR_iso15.dic
101 README_fr_FR.txt
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000102
103# Check for updated OpenOffice spell files. When there are changes the
104# ".new.aff" and ".new.dic" files are left behind for manual inspection.
105
106check:
107 :assertpkg unzip diff
108 :fetch fr_FR.zip
109 :mkdir tmp
110 :cd tmp
111 @try:
112 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000113 :sys $UNZIP ../fr_FR.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000114 :sys {force} diff ../fr_FR.orig.aff fr_FR.aff >d
115 @if os.stat('d')[stat.ST_SIZE] > 0:
116 :copy fr_FR.aff ../fr_FR.new.aff
117 :sys {force} diff ../fr_FR.orig.dic fr_FR.dic >d
118 @if os.stat('d')[stat.ST_SIZE] > 0:
119 :copy fr_FR.dic ../fr_FR.new.dic
120 @finally:
121 :cd ..
122 :delete {r}{f}{q} tmp
123 :delete fr_FR.zip
124
125
126# vim: set sts=4 sw=4 :