1 # Aap recipe for French Vim spell files.
3 # Use a freshly compiled Vim if it exists.
4 @if os.path.exists('../../../src/vim'):
10 FILES = fr_FR.aff fr_FR.dic
12 all: $SPELLDIR/fr.latin1.spl $SPELLDIR/fr.utf-8.spl ../README_fr.txt
14 # 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
25 $SPELLDIR/fr.latin1.spl : $FILES
26 :copy {force} fr_FR_latin1.aff fr_FR.aff
27 :copy {force} fr_FR_latin1.dic fr_FR.dic
28 :sys env LANG=fr_FR.ISO-8859-15@euro
29 $VIM -u NONE -e -c "mkspell! $SPELLDIR/fr fr_FR" -c q
31 $SPELLDIR/fr.utf-8.spl : $FILES
32 :copy {force} fr_FR_iso15.aff fr_FR.aff
33 :copy {force} fr_FR_iso15.dic fr_FR.dic
34 :sys env LANG=fr_FR.UTF-8
35 $VIM -u NONE -e -c "mkspell! $SPELLDIR/fr fr_FR" -c q
37 ../README_fr.txt : README_fr_FR.txt
38 :cat $source >!$target
41 # Used to fetch the files from OpenOffice.org. Those are old.
42 # Later versions are elsewhere.
44 #OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
45 ZIPFILE = http://dico.savant.free.fr/_download/fr_FR_1-1-6.zip
47 :attr {fetch = $ZIPFILE} fr_FR.zip
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.
51 fr_FR.aff fr_FR.dic: {buildcheck=}
52 :assertpkg unzip patch
56 @if not os.path.exists('fr_FR.orig.aff'):
57 :copy fr_FR.aff fr_FR.orig.aff
58 @if not os.path.exists('fr_FR.orig.dic'):
59 :copy fr_FR.dic fr_FR.orig.dic
60 @if os.path.exists('fr_FR.diff'):
61 :sys patch <fr_FR.diff
63 # 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
68 :sys $VIM -u NONE -e -c "set enc=latin1"
71 -c "w! fr_FR_latin1.dic"
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"
80 -c "w! fr_FR_latin1.aff"
84 # Generate diff files, so that others can get the OpenOffice files and apply
85 # the diffs to get the Vim versions.
86 # This uses the iso-8859-15 files.
89 :copy {force} fr_FR_iso15.aff fr_FR.aff
90 :copy {force} fr_FR_iso15.dic fr_FR.dic
91 :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
94 # Delete all the unpacked and generated files, including the "orig" files.
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
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.
107 :assertpkg unzip diff
113 :sys $UNZIP ../fr_FR.zip
114 :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
122 :delete {r}{f}{q} tmp
126 # vim: set sts=4 sw=4 :