0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00
vim/runtime/spell/fr/main.aap

127 lines
4.5 KiB
Plaintext
Raw Normal View History

2005-07-27 21:13:01 +00:00
# Aap recipe for French Vim spell files.
2005-07-03 21:39:27 +00:00
# Use a freshly compiled Vim if it exists.
@if os.path.exists('../../../src/vim'):
VIM = ../../../src/vim
@else:
2005-08-01 07:04:56 +00:00
:progsearch VIM vim
2005-07-03 21:39:27 +00:00
SPELLDIR = ..
FILES = fr_FR.aff fr_FR.dic
2005-08-15 21:41:48 +00:00
all: $SPELLDIR/fr.latin1.spl $SPELLDIR/fr.utf-8.spl ../README_fr.txt
2005-07-03 21:39:27 +00:00
2008-06-24 20:19:36 +00:00
# The spell file is iso-8859-15, but Vim normally uses "latin1" for this.
# This is OK for the utf-8 files, but for latin1 we need to avoid the "oe"
# character. When unpacking we create four files:
# fr_FR_latin1.aff modified file
# fr_FR_latin1.dic modified file
# fr_FR_iso15.aff original file (after applying diff)
# fr_FR_iso15.dic original file (after applying diff)
# Just before using the dictionary files, the right ones are copied to
# fr_FR.aff
# fr_FR.dic
2005-08-16 23:01:50 +00:00
$SPELLDIR/fr.latin1.spl : $FILES
2008-06-24 20:19:36 +00:00
:copy {force} fr_FR_latin1.aff fr_FR.aff
:copy {force} fr_FR_latin1.dic fr_FR.dic
:sys env LANG=fr_FR.ISO-8859-15@euro
2005-08-15 21:41:48 +00:00
$VIM -u NONE -e -c "mkspell! $SPELLDIR/fr fr_FR" -c q
2005-07-03 21:39:27 +00:00
2005-08-16 23:01:50 +00:00
$SPELLDIR/fr.utf-8.spl : $FILES
2008-06-24 20:19:36 +00:00
:copy {force} fr_FR_iso15.aff fr_FR.aff
:copy {force} fr_FR_iso15.dic fr_FR.dic
2005-07-03 21:39:27 +00:00
:sys env LANG=fr_FR.UTF-8
2005-08-15 21:41:48 +00:00
$VIM -u NONE -e -c "mkspell! $SPELLDIR/fr fr_FR" -c q
2005-07-03 21:39:27 +00:00
2005-10-03 21:52:09 +00:00
../README_fr.txt : README_fr_FR.txt
2005-09-01 20:46:49 +00:00
:cat $source >!$target
2005-07-03 21:39:27 +00:00
#
2008-06-24 20:19:36 +00:00
# Used to fetch the files from OpenOffice.org. Those are old.
# Later versions are elsewhere.
2005-07-03 21:39:27 +00:00
#
2008-06-24 20:19:36 +00:00
#OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
ZIPFILE = http://dico.savant.free.fr/_download/fr_FR_1-1-6.zip
:attr {fetch = $ZIPFILE} fr_FR.zip
2005-07-03 21:39:27 +00:00
# The files don't depend on the .zip file so that we can delete it.
# Only download the zip file if the targets don't exist.
fr_FR.aff fr_FR.dic: {buildcheck=}
:assertpkg unzip patch
:fetch fr_FR.zip
2005-08-15 21:41:48 +00:00
:sys $UNZIP fr_FR.zip
2005-07-03 21:39:27 +00:00
:delete fr_FR.zip
@if not os.path.exists('fr_FR.orig.aff'):
2005-08-15 21:41:48 +00:00
:copy fr_FR.aff fr_FR.orig.aff
2005-07-03 21:39:27 +00:00
@if not os.path.exists('fr_FR.orig.dic'):
2005-08-15 21:41:48 +00:00
:copy fr_FR.dic fr_FR.orig.dic
2005-08-01 07:04:56 +00:00
@if os.path.exists('fr_FR.diff'):
:sys patch <fr_FR.diff
2005-07-03 21:39:27 +00:00
2008-06-24 20:19:36 +00:00
# Keep the unmodified files (after diff) for ISO-8859-15.
:copy fr_FR.aff fr_FR_iso15.aff
:copy fr_FR.dic fr_FR_iso15.dic
# For the latin1 .dic file change all the "oe" characters to the two
# characters "oe".
:sys $VIM -u NONE -e -c "set enc=latin1"
-c "e fr_FR.dic"
-c "%s/<2F>/oe/g"
-c "w! fr_FR_latin1.dic"
-c q
# For the latin1 .aff file delete all the "oe" and "OE" characters and
# delete the REP lines with those characters.
:sys $VIM -u NONE -e -c "set enc=latin1"
-c "e fr_FR.aff"
-c "%s/<2F>//g"
-c "%s/<2F>//g"
-c "%g/REP.*oe/d"
-c "w! fr_FR_latin1.aff"
-c q
2005-07-03 21:39:27 +00:00
# Generate diff files, so that others can get the OpenOffice files and apply
# the diffs to get the Vim versions.
2008-06-24 20:19:36 +00:00
# This uses the iso-8859-15 files.
2005-07-03 21:39:27 +00:00
diff:
:assertpkg diff
2008-06-24 20:19:36 +00:00
:copy {force} fr_FR_iso15.aff fr_FR.aff
:copy {force} fr_FR_iso15.dic fr_FR.dic
2005-07-03 21:39:27 +00:00
:sys {force} diff -a -C 1 fr_FR.orig.aff fr_FR.aff >fr_FR.diff
:sys {force} diff -a -C 1 fr_FR.orig.dic fr_FR.dic >>fr_FR.diff
2008-06-24 20:19:36 +00:00
# Delete all the unpacked and generated files, including the "orig" files.
clean:
:delete {force} fr_FR.zip fr_FR.aff fr_FR.dic
fr_FR.aff.orig fr_FR.dic.orig
fr_FR.orig.aff fr_FR.orig.dic
fr_FR_latin1.aff fr_FR_latin1.dic
fr_FR_iso15.aff fr_FR_iso15.dic
README_fr_FR.txt
2005-07-03 21:39:27 +00:00
# Check for updated OpenOffice spell files. When there are changes the
# ".new.aff" and ".new.dic" files are left behind for manual inspection.
check:
:assertpkg unzip diff
:fetch fr_FR.zip
:mkdir tmp
:cd tmp
@try:
@import stat
2005-08-15 21:41:48 +00:00
:sys $UNZIP ../fr_FR.zip
2005-07-03 21:39:27 +00:00
:sys {force} diff ../fr_FR.orig.aff fr_FR.aff >d
@if os.stat('d')[stat.ST_SIZE] > 0:
:copy fr_FR.aff ../fr_FR.new.aff
:sys {force} diff ../fr_FR.orig.dic fr_FR.dic >d
@if os.stat('d')[stat.ST_SIZE] > 0:
:copy fr_FR.dic ../fr_FR.new.dic
@finally:
:cd ..
:delete {r}{f}{q} tmp
:delete fr_FR.zip
# vim: set sts=4 sw=4 :