blob: 629a4eca891b6afad7ae361232f5d04db3048db8 [file] [log] [blame]
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001# Aap recipe for Hungarian 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 = ..
Bram Moolenaar30b65812012-07-12 22:01:11 +020010VIMRC = ../spell.vim
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000011FILES = hu_HU.aff hu_HU.dic
12
13all: $SPELLDIR/hu.iso-8859-2.spl $SPELLDIR/hu.utf-8.spl \
14 $SPELLDIR/hu.cp1250.spl ../README_hu.txt
15
16$SPELLDIR/hu.iso-8859-2.spl : $FILES
Bram Moolenaar30b65812012-07-12 22:01:11 +020017 :sys env LANG=hu_HU.ISO8859-2 $VIM -u $VIMRC -e -c "mkspell! $SPELLDIR/hu hu_HU" -c q
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000018
19$SPELLDIR/hu.utf-8.spl : $FILES
Bram Moolenaar30b65812012-07-12 22:01:11 +020020 :sys env LANG=hu_HU.UTF-8 $VIM -u $VIMRC -e -c "mkspell! $SPELLDIR/hu hu_HU" -c q
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000021
22$SPELLDIR/hu.cp1250.spl : $FILES
Bram Moolenaar30b65812012-07-12 22:01:11 +020023 :sys $VIM -u $VIMRC -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/hu hu_HU" -c q
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000024
Bram Moolenaar18144c82006-04-12 21:52:12 +000025../README_hu.txt: README_hu_HU.txt
26 :copy $source $target
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000027
28#
Bram Moolenaar18144c82006-04-12 21:52:12 +000029# Fetching the files from OpenOffice.org.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000030#
Bram Moolenaar18144c82006-04-12 21:52:12 +000031OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
32:attr {fetch = $OODIR/%file%} hu_HU.zip
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000033
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.
36# This is a bit tricky, since the file name includes the date.
37hu_HU.aff hu_HU.dic: {buildcheck=}
38 :assertpkg unzip patch
Bram Moolenaar18144c82006-04-12 21:52:12 +000039 :fetch hu_HU.zip
40 :sys $UNZIP hu_HU.zip
41 :delete hu_HU.zip
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000042 @if not os.path.exists('hu_HU.orig.aff'):
43 :copy hu_HU.aff hu_HU.orig.aff
44 @if not os.path.exists('hu_HU.orig.dic'):
45 :copy hu_HU.dic hu_HU.orig.dic
46 @if os.path.exists('hu_HU.diff'):
47 :sys patch <hu_HU.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 hu_HU.orig.aff hu_HU.aff >hu_HU.diff
56 :sys {force} diff -a -C 1 hu_HU.orig.dic hu_HU.dic >>hu_HU.diff
57
58
Bram Moolenaar18144c82006-04-12 21:52:12 +000059# Check for updated OpenOffice 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 hu_HU.zip
65 :mkdir tmp
66 :cd tmp
67 @try:
68 @import stat
69 :sys $UNZIP ../hu_HU.zip
70 :sys {force} diff ../hu_HU.orig.aff hu_HU.aff >d
71 @if os.stat('d')[stat.ST_SIZE] > 0:
72 :copy hu_HU.aff ../hu_HU.new.aff
73 :sys {force} diff ../hu_HU.orig.dic hu_HU.dic >d
74 @if os.stat('d')[stat.ST_SIZE] > 0:
75 :copy hu_HU.dic ../hu_HU.new.dic
76 @finally:
77 :cd ..
78 :delete {r}{f}{q} tmp
79 :delete hu_HU.zip
80
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000081
82# vim: set sts=4 sw=4 :