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