blob: 1b998ca0e9d1e67b9aab1f1bbb0cd9f60730b0c2 [file] [log] [blame]
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001# Aap recipe for Croatian Vim spell files.
Bram Moolenaarae5bce12005-08-15 21:41:48 +00002
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 = hr_HR.aff hr_HR.dic
11
Bram Moolenaare344bea2005-09-01 20:46:49 +000012all: $SPELLDIR/hr.iso-8859-2.spl $SPELLDIR/hr.utf-8.spl \
13 $SPELLDIR/hr.cp1250.spl ../README_hr.txt
Bram Moolenaarae5bce12005-08-15 21:41:48 +000014
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000015$SPELLDIR/hr.iso-8859-2.spl : $FILES
Bram Moolenaarae5bce12005-08-15 21:41:48 +000016 :sys env LANG=hr_HR.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/hr hr_HR" -c q
17
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000018$SPELLDIR/hr.utf-8.spl : $FILES
Bram Moolenaarae5bce12005-08-15 21:41:48 +000019 :sys env LANG=hr_HR.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/hr hr_HR" -c q
20
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000021$SPELLDIR/hr.cp1250.spl : $FILES
Bram Moolenaarae5bce12005-08-15 21:41:48 +000022 :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/hr hr_HR" -c q
23
24../README_hr.txt: README_hr_HR.txt
25 :copy $source $target
26
27#
28# Fetching the files from OpenOffice.org.
29#
30OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
31:attr {fetch = $OODIR/%file%} hr_HR.zip
32
33# The files don't depend on the .zip file so that we can delete it.
34# Only download the zip file if the targets don't exist.
35# This is a bit tricky, since the file name includes the date.
36hr_HR.aff hr_HR.dic: {buildcheck=}
37 :assertpkg unzip patch
38 :fetch hr_HR.zip
39 :sys $UNZIP hr_HR.zip
40 :delete hr_HR.zip
41 @if not os.path.exists('hr_HR.orig.aff'):
42 :copy hr_HR.aff hr_HR.orig.aff
43 @if not os.path.exists('hr_HR.orig.dic'):
44 :copy hr_HR.dic hr_HR.orig.dic
45 @if os.path.exists('hr_HR.diff'):
46 :sys patch <hr_HR.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 hr_HR.orig.aff hr_HR.aff >hr_HR.diff
55 :sys {force} diff -a -C 1 hr_HR.orig.dic hr_HR.dic >>hr_HR.diff
56
57
58# Check for updated 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 hr_HR.zip
64 :mkdir tmp
65 :cd tmp
66 @try:
67 @import stat
68 :sys $UNZIP ../hr_HR.zip
69 :sys {force} diff ../hr_HR.orig.aff hr_HR.aff >d
70 @if os.stat('d')[stat.ST_SIZE] > 0:
71 :copy hr_HR.aff ../hr_HR.new.aff
72 :sys {force} diff ../hr_HR.orig.dic hr_HR.dic >d
73 @if os.stat('d')[stat.ST_SIZE] > 0:
74 :copy hr_HR.dic ../hr_HR.new.dic
75 @finally:
76 :cd ..
77 :delete {r}{f}{q} tmp
78 :delete hr_HR.zip
79
80
81# vim: set sts=4 sw=4 :