xref: /vim-8.2.3635/runtime/spell/hu/main.aap (revision 30b65817)
1# 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 = ..
10VIMRC = ../spell.vim
11FILES    = 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
17        :sys env LANG=hu_HU.ISO8859-2 $VIM -u $VIMRC -e -c "mkspell! $SPELLDIR/hu hu_HU" -c q
18
19$SPELLDIR/hu.utf-8.spl : $FILES
20        :sys env LANG=hu_HU.UTF-8 $VIM -u $VIMRC -e -c "mkspell! $SPELLDIR/hu hu_HU" -c q
21
22$SPELLDIR/hu.cp1250.spl : $FILES
23        :sys $VIM -u $VIMRC -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/hu hu_HU" -c q
24
25../README_hu.txt: README_hu_HU.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%} hu_HU.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.
36# This is a bit tricky, since the file name includes the date.
37hu_HU.aff hu_HU.dic: {buildcheck=}
38        :assertpkg unzip patch
39        :fetch hu_HU.zip
40        :sys $UNZIP hu_HU.zip
41        :delete hu_HU.zip
42        @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
59# 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
81
82# vim: set sts=4 sw=4 :
83