blob: 92edad21d07db2d68855ed5eb1fa4c17428d7e7a [file] [log] [blame]
Bram Moolenaare344bea2005-09-01 20:46:49 +00001# Aap recipe for Lithuanian 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 = lt_LT.aff lt_LT.dic
11
12all: $SPELLDIR/lt.iso-8859-13.spl $SPELLDIR/lt.utf-8.spl \
13 ../README_lt.txt
14
15$SPELLDIR/lt.iso-8859-13.spl : $FILES
16 :sys env LANG=lt_LT.ISO8859-13 $VIM -u NONE -e -c "mkspell! $SPELLDIR/lt lt_LT" -c q
17
18$SPELLDIR/lt.utf-8.spl : $FILES
19 :sys env LANG=lt_LT.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/lt lt_LT" -c q
20
21../README_lt.txt: README_lt_LT.txt
22 :copy $source $target
23
24#
25# Fetching the files from OpenOffice.org.
26#
27OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
28:attr {fetch = $OODIR/%file%} lt_LT.zip
29
30# The files don't depend on the .zip file so that we can delete it.
31# Only download the zip file if the targets don't exist.
32# This is a bit tricky, since the file name includes the date.
33lt_LT.aff lt_LT.dic: {buildcheck=}
34 :assertpkg unzip patch
35 :fetch lt_LT.zip
36 :sys $UNZIP lt_LT.zip
37 :delete lt_LT.zip
38 @if not os.path.exists('lt_LT.orig.aff'):
39 :copy lt_LT.aff lt_LT.orig.aff
40 @if not os.path.exists('lt_LT.orig.dic'):
41 :copy lt_LT.dic lt_LT.orig.dic
42 @if os.path.exists('lt_LT.diff'):
43 :sys patch <lt_LT.diff
44
45
46# Generate diff files, so that others can get the OpenOffice files and apply
47# the diffs to get the Vim versions.
48
49diff:
50 :assertpkg diff
51 :sys {force} diff -a -C 1 lt_LT.orig.aff lt_LT.aff >lt_LT.diff
52 :sys {force} diff -a -C 1 lt_LT.orig.dic lt_LT.dic >>lt_LT.diff
53
54
55# Check for updated spell files. When there are changes the
56# ".new.aff" and ".new.dic" files are left behind for manual inspection.
57
58check:
59 :assertpkg unzip diff
60 :fetch lt_LT.zip
61 :mkdir tmp
62 :cd tmp
63 @try:
64 @import stat
65 :sys $UNZIP ../lt_LT.zip
66 :sys {force} diff ../lt_LT.orig.aff lt_LT.aff >d
67 @if os.stat('d')[stat.ST_SIZE] > 0:
68 :copy lt_LT.aff ../lt_LT.new.aff
69 :sys {force} diff ../lt_LT.orig.dic lt_LT.dic >d
70 @if os.stat('d')[stat.ST_SIZE] > 0:
71 :copy lt_LT.dic ../lt_LT.new.dic
72 @finally:
73 :cd ..
74 :delete {r}{f}{q} tmp
75 :delete lt_LT.zip
76
77
78# vim: set sts=4 sw=4 :