Bram Moolenaar | ac6e65f | 2005-08-29 22:25:38 +0000 | [diff] [blame] | 1 | # Aap recipe for Russian 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 | REGIONS = RU IE YO |
| 10 | SPELLDIR = .. |
| 11 | FILES = ru_$*(REGIONS).aff ru_$*(REGIONS).dic |
| 12 | |
| 13 | all: $SPELLDIR/ru.koi8-r.spl $SPELLDIR/ru.utf-8.spl \ |
| 14 | $SPELLDIR/ru.cp1251.spl ../README_ru.txt |
| 15 | |
| 16 | $SPELLDIR/ru.koi8-r.spl : $FILES |
| 17 | :sys env LANG=ru_RU.KOI8-R $VIM -u NONE -e -c "mkspell! $SPELLDIR/ru ru_RU ru_IE ru_YO" -c q |
| 18 | |
| 19 | $SPELLDIR/ru.utf-8.spl : $FILES |
| 20 | :sys env LANG=ru_RU.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ru ru_RU ru_IE ru_YO" -c q |
| 21 | |
| 22 | $SPELLDIR/ru.cp1251.spl : $FILES |
| 23 | :sys env LANG=ru_RU.CP1251 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ru ru_RU ru_IE ru_YO" -c q |
| 24 | |
| 25 | ../README_ru.txt: README_ru_$*(REGIONS).txt |
| 26 | :print ru_RU >! $target |
| 27 | :cat README_ru_RU.txt >> $target |
| 28 | :print =================================================== >>$target |
| 29 | :print ru_IE >> $target |
| 30 | :cat README_ru_IE.txt >> $target |
| 31 | :print =================================================== >>$target |
| 32 | :print ru_YO >> $target |
| 33 | :cat README_ru_YO.txt >> $target |
| 34 | |
| 35 | # |
| 36 | # Fetching the files from OpenOffice.org. |
| 37 | # |
| 38 | OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries |
| 39 | :attr {fetch = $OODIR/%file%} ru_RU.zip ru_RU_ye.zip ru_RU_yo.zip |
| 40 | |
| 41 | # The files don't depend on the .zip file so that we can delete it. |
| 42 | # Only download the zip file if the targets don't exist. |
| 43 | # This is a bit tricky, since the file name includes the date. |
| 44 | ru_RU.aff ru_RU.dic: {buildcheck=} |
| 45 | :assertpkg unzip |
| 46 | :fetch ru_RU.zip |
| 47 | :sys unzip ru_RU.zip |
| 48 | :delete ru_RU.zip |
| 49 | @if not os.path.exists('ru_RU.orig.aff'): |
| 50 | :copy ru_RU.aff ru_RU.orig.aff |
| 51 | @if not os.path.exists('ru_RU.orig.dic'): |
| 52 | :copy ru_RU.dic ru_RU.orig.dic |
| 53 | @if os.path.exists('ru_RU.diff'): |
| 54 | :sys patch <ru_RU.diff |
| 55 | |
| 56 | ru_IE.aff ru_IE.dic: {buildcheck=} |
| 57 | :assertpkg unzip |
| 58 | :fetch ru_RU_ye.zip |
| 59 | :sys unzip ru_RU_ye.zip |
| 60 | :delete ru_RU_ye.zip |
| 61 | :move ru_RU_ie.aff ru_IE.aff |
| 62 | :move ru_RU_ie.dic ru_IE.dic |
| 63 | :move README_ru_RU_ie.txt README_ru_IE.txt |
| 64 | @if not os.path.exists('ru_IE.orig.aff'): |
| 65 | :copy ru_IE.aff ru_IE.orig.aff |
| 66 | @if not os.path.exists('ru_IE.orig.dic'): |
| 67 | :copy ru_IE.dic ru_IE.orig.dic |
| 68 | @if os.path.exists('ru_IE.diff'): |
| 69 | :sys patch <ru_IE.diff |
| 70 | |
| 71 | ru_YO.aff ru_YO.dic: {buildcheck=} |
| 72 | :assertpkg unzip |
| 73 | :fetch ru_RU_yo.zip |
| 74 | :sys unzip ru_RU_yo.zip |
| 75 | :delete ru_RU_yo.zip |
| 76 | :move ru_RU_yo.aff ru_YO.aff |
| 77 | :move ru_RU_yo.dic ru_YO.dic |
| 78 | :move README_ru_RU_yo.txt README_ru_YO.txt |
| 79 | @if not os.path.exists('ru_YO.orig.aff'): |
| 80 | :copy ru_YO.aff ru_YO.orig.aff |
| 81 | @if not os.path.exists('ru_YO.orig.dic'): |
| 82 | :copy ru_YO.dic ru_YO.orig.dic |
| 83 | @if os.path.exists('ru_YO.diff'): |
| 84 | :sys patch <ru_YO.diff |
| 85 | |
| 86 | |
| 87 | # Generate diff files, so that others can get the OpenOffice files and apply |
| 88 | # the diffs to get the Vim versions. |
| 89 | |
| 90 | diff: |
| 91 | :assertpkg diff |
| 92 | :sys {force} diff -a -C 1 ru_RU.orig.aff ru_RU.aff >ru_RU.diff |
| 93 | :sys {force} diff -a -C 1 ru_RU.orig.dic ru_RU.dic >>ru_RU.diff |
| 94 | :sys {force} diff -a -C 1 ru_IE.orig.aff ru_IE.aff >ru_IE.diff |
| 95 | :sys {force} diff -a -C 1 ru_IE.orig.dic ru_IE.dic >>ru_IE.diff |
| 96 | :sys {force} diff -a -C 1 ru_YO.orig.aff ru_YO.aff >ru_YO.diff |
| 97 | :sys {force} diff -a -C 1 ru_YO.orig.dic ru_YO.dic >>ru_YO.diff |
| 98 | |
| 99 | |
| 100 | # Check for updated spell files. When there are changes the |
| 101 | # ".new.aff" and ".new.dic" files are left behind for manual inspection. |
| 102 | |
| 103 | check: |
| 104 | :print Doesn't work yet. |