Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 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 | |
| 9 | SPELLDIR = .. |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 10 | VIMRC = ../spell.vim |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 11 | FILES = hu_HU.aff hu_HU.dic |
| 12 | |
| 13 | all: $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 Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 17 | :sys env LANG=hu_HU.ISO8859-2 $VIM -u $VIMRC -e -c "mkspell! $SPELLDIR/hu hu_HU" -c q |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 18 | |
| 19 | $SPELLDIR/hu.utf-8.spl : $FILES |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 20 | :sys env LANG=hu_HU.UTF-8 $VIM -u $VIMRC -e -c "mkspell! $SPELLDIR/hu hu_HU" -c q |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 21 | |
| 22 | $SPELLDIR/hu.cp1250.spl : $FILES |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 23 | :sys $VIM -u $VIMRC -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/hu hu_HU" -c q |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 24 | |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 25 | ../README_hu.txt: README_hu_HU.txt |
| 26 | :copy $source $target |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 27 | |
| 28 | # |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 29 | # Fetching the files from OpenOffice.org. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 30 | # |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 31 | OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries |
| 32 | :attr {fetch = $OODIR/%file%} hu_HU.zip |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 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. |
| 37 | hu_HU.aff hu_HU.dic: {buildcheck=} |
| 38 | :assertpkg unzip patch |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 39 | :fetch hu_HU.zip |
| 40 | :sys $UNZIP hu_HU.zip |
| 41 | :delete hu_HU.zip |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 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 | |
| 53 | diff: |
| 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 Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 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 | |
| 62 | check: |
| 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 Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 81 | |
| 82 | # vim: set sts=4 sw=4 : |