Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1 | # Aap recipe for Thai 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 = th.aff th.dic |
| 11 | |
| 12 | all: $SPELLDIR/th.utf-8.spl ../README_th.txt |
| 13 | |
| 14 | $SPELLDIR/th.utf-8.spl : $FILES |
| 15 | :sys $VIM -u NONE -e -c "set enc=utf-8" |
| 16 | -c "mkspell! $SPELLDIR/th th" -c q |
| 17 | |
| 18 | ../README_th.txt: README_th.txt |
| 19 | :copy $source $target |
| 20 | |
| 21 | # |
| 22 | # Fetching the files from http://sesrc.th.net |
| 23 | # |
| 24 | HTTPDIR = http://seasrc.th.net/dict |
| 25 | ZIPNAME = th_18057.zip |
| 26 | FNAME = TH_18057.TXT |
| 27 | |
| 28 | :attr {fetch = $HTTPDIR/%file%} $ZIPNAME |
| 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 | # This is a bit tricky, since the file name includes the date. |
| 33 | # |
| 34 | # We get a plain list of Thai words and make the .dic file from that. The .aff |
| 35 | # file is made from scratch. |
| 36 | th.aff th.dic: {buildcheck=} |
| 37 | :assertpkg unzip iconv |
| 38 | :fetch $ZIPNAME |
| 39 | :sys unzip $ZIPNAME |
| 40 | :sys {force} iconv -c -f TIS-620 -t UTF-8 <$FNAME >th.dic |
| 41 | :delete $ZIPNAME $FNAME |
| 42 | |
| 43 | :delete {force} th.aff |
| 44 | :touch {force} th.aff |
| 45 | @if not os.path.exists('th.orig.aff'): |
| 46 | :touch {force} th.orig.aff |
| 47 | @if not os.path.exists('th.orig.dic'): |
| 48 | :copy th.dic th.orig.dic |
| 49 | @if os.path.exists('th.diff'): |
| 50 | :sys patch <th.diff |
| 51 | |
| 52 | |
| 53 | # Generate diff files, so that others can get the OpenOffice files and apply |
| 54 | # the diffs to get the Vim versions. |
| 55 | |
| 56 | diff: |
| 57 | :assertpkg diff |
| 58 | :sys {force} diff -N -a -C 1 th.orig.aff th.aff >th.diff |
| 59 | :sys {force} diff -a -C 1 th.orig.dic th.dic >>th.diff |
| 60 | |
| 61 | |
| 62 | # Check for updated spell files. When there are changes the |
| 63 | # ".new.aff" and ".new.dic" files are left behind for manual inspection. |
| 64 | |
| 65 | check: |
| 66 | :print Sorry, not supported. |