Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 1 | # Aap recipe for Scottish Gaelic 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 = .. |
| 10 | FILES = gd_GB.aff gd_GB.dic |
| 11 | |
| 12 | all: $SPELLDIR/gd.latin1.spl $SPELLDIR/gd.utf-8.spl ../README_gd.txt |
| 13 | |
| 14 | $SPELLDIR/gd.latin1.spl : $FILES |
Bram Moolenaar | 9c754c4 | 2010-07-10 15:52:35 +0200 | [diff] [blame] | 15 | :sys env LANG=gd_GB.ISO8859-15 |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 16 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/gd gd_GB" -c q |
| 17 | |
| 18 | $SPELLDIR/gd.utf-8.spl : $FILES |
Bram Moolenaar | f4cd3e8 | 2005-12-22 22:47:02 +0000 | [diff] [blame] | 19 | :sys $VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/gd gd_GB" -c q |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 20 | |
| 21 | ../README_gd.txt : README_gd_GB.txt |
| 22 | :copy $source $target |
| 23 | |
| 24 | # |
| 25 | # Fetching the files from OpenOffice.org. |
| 26 | # |
| 27 | OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries |
| 28 | :attr {fetch = $OODIR/%file%} gd_GB.zip |
| 29 | |
| 30 | # The files don't depend on the .zip file so that we can delete it. |
| 31 | # Only download the zip file if the targets don't exist. |
| 32 | gd_GB.aff gd_GB.dic: {buildcheck=} |
| 33 | :assertpkg unzip patch |
| 34 | :fetch gd_GB.zip |
| 35 | :sys $UNZIP gd_GB.zip |
| 36 | :delete gd_GB.zip |
| 37 | @if not os.path.exists('gd_GB.orig.aff'): |
| 38 | :copy gd_GB.aff gd_GB.orig.aff |
| 39 | @if not os.path.exists('gd_GB.orig.dic'): |
| 40 | :copy gd_GB.dic gd_GB.orig.dic |
| 41 | @if os.path.exists('gd_GB.diff'): |
| 42 | :sys patch <gd_GB.diff |
| 43 | |
| 44 | |
| 45 | # Generate diff files, so that others can get the OpenOffice files and apply |
| 46 | # the diffs to get the Vim versions. |
| 47 | |
| 48 | diff: |
| 49 | :assertpkg diff |
| 50 | :sys {force} diff -a -C 1 gd_GB.orig.aff gd_GB.aff >gd_GB.diff |
| 51 | :sys {force} diff -a -C 1 gd_GB.orig.dic gd_GB.dic >>gd_GB.diff |
| 52 | |
| 53 | |
| 54 | # Check for updated OpenOffice spell files. When there are changes the |
| 55 | # ".new.aff" and ".new.dic" files are left behind for manual inspection. |
| 56 | |
| 57 | check: |
| 58 | :assertpkg unzip diff |
| 59 | :fetch gd_GB.zip |
| 60 | :mkdir tmp |
| 61 | :cd tmp |
| 62 | @try: |
| 63 | @import stat |
| 64 | :sys $UNZIP ../gd_GB.zip |
| 65 | :sys {force} diff ../gd_GB.orig.aff gd_GB.aff >d |
| 66 | @if os.stat('d')[stat.ST_SIZE] > 0: |
| 67 | :copy gd_GB.aff ../gd_GB.new.aff |
| 68 | :sys {force} diff ../gd_GB.orig.dic gd_GB.dic >d |
| 69 | @if os.stat('d')[stat.ST_SIZE] > 0: |
| 70 | :copy gd_GB.dic ../gd_GB.new.dic |
| 71 | @finally: |
| 72 | :cd .. |
| 73 | :delete {r}{f}{q} tmp |
| 74 | :delete gd_GB.zip |
| 75 | |
| 76 | |
| 77 | # vim: set sts=4 sw=4 : |