1# Aap recipe for Latin 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 = la.aff la.dic 11 12all: $SPELLDIR/la.latin1.spl $SPELLDIR/la.utf-8.spl ../README_la.txt 13 14# NOTE: the la_LN.ISO-8859-1 locale is not available on Ubuntu. 15# Use the English one instead. 16 17$SPELLDIR/la.latin1.spl : $FILES 18 :sys env LANG=en_US.ISO-8859-1 19 $VIM -u NONE -e -c "mkspell! $SPELLDIR/la la" -c q 20 21$SPELLDIR/la.utf-8.spl : $FILES 22 :sys $VIM -u NONE -e -c "set enc=utf-8" 23 -c "mkspell! $SPELLDIR/la la" -c q 24 25../README_la.txt : README_la.txt 26 :copy $source $target 27 28# 29# Fetching the files from OpenOffice.org. 30# 31OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries 32:attr {fetch = $OODIR/%file%} la.zip 33 34# The files don't depend on the .zip file so that we can delete it. 35# Only download the zip file if the targets don't exist. 36la.aff la.dic: {buildcheck=} 37 :assertpkg unzip patch 38 :fetch la.zip 39 :sys $UNZIP la.zip 40 :delete la.zip 41 @if not os.path.exists('la.orig.aff'): 42 :copy la.aff la.orig.aff 43 @if not os.path.exists('la.orig.dic'): 44 :copy la.dic la.orig.dic 45 @if os.path.exists('la.diff'): 46 :sys patch <la.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 la.orig.aff la.aff >la.diff 55 :sys {force} diff -a -C 1 la.orig.dic la.dic >>la.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 la.zip 64 :mkdir tmp 65 :cd tmp 66 @try: 67 @import stat 68 :sys $UNZIP ../la.zip 69 :sys {force} diff ../la.orig.aff la.aff >d 70 @if os.stat('d')[stat.ST_SIZE] > 0: 71 :copy la.aff ../la.new.aff 72 :sys {force} diff ../la.orig.dic la.dic >d 73 @if os.stat('d')[stat.ST_SIZE] > 0: 74 :copy la.dic ../la.new.dic 75 @finally: 76 :cd .. 77 :delete {r}{f}{q} tmp 78 :delete la.zip 79 80 81# vim: set sts=4 sw=4 : 82