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