Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 1 | # Aap recipe for German Vim spell files. |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 2 | |
| 3 | # Use a freshly compiled Vim if it exists. |
| 4 | @if os.path.exists('../../../src/vim'): |
| 5 | VIM = ../../../src/vim |
| 6 | @else: |
Bram Moolenaar | 78984f5 | 2005-08-01 07:19:10 +0000 | [diff] [blame] | 7 | :progsearch VIM vim |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 661b182 | 2005-07-28 22:36:45 +0000 | [diff] [blame] | 17 | $(VIM) -u NONE -e -c "mkspell! $(SPELLDIR)/de de_DE" -c q |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 18 | |
| 19 | $(SPELLDIR)/de.utf-8.spl : $(VIM) $(FILES) |
| 20 | :sys env LANG=de_DE.UTF-8 |
Bram Moolenaar | 661b182 | 2005-07-28 22:36:45 +0000 | [diff] [blame] | 21 | $(VIM) -u NONE -e -c "mkspell! $(SPELLDIR)/de de_DE" -c q |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 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'): |
Bram Moolenaar | 78984f5 | 2005-08-01 07:19:10 +0000 | [diff] [blame] | 44 | :copy de_DE.dic de_DE.orig.dic |
| 45 | @if os.path.exists('de_DE.diff'): |
| 46 | :sys patch <de_DE.diff |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 47 | |
| 48 | |
| 49 | # Generate diff files, so that others can get the OpenOffice files and apply |
| 50 | # the diffs to get the Vim versions. |
| 51 | |
| 52 | diff: |
| 53 | :assertpkg diff |
| 54 | :sys {force} diff -a -C 1 de_DE.orig.aff de_DE.aff >de_DE.diff |
| 55 | :sys {force} diff -a -C 1 de_DE.orig.dic de_DE.dic >>de_DE.diff |
| 56 | |
| 57 | |
| 58 | # Check for updated OpenOffice spell files. When there are changes the |
| 59 | # ".new.aff" and ".new.dic" files are left behind for manual inspection. |
| 60 | |
| 61 | check: |
| 62 | :assertpkg unzip diff |
| 63 | :fetch $(ZIPFILE) |
| 64 | :mkdir tmp |
| 65 | :cd tmp |
| 66 | @try: |
| 67 | @import stat |
| 68 | :sys $(UNZIP) ../$(ZIPFILE) |
| 69 | :move de_DE_comb.aff de_DE.aff |
| 70 | :move de_DE_comb.dic de_DE.dic |
| 71 | :sys {force} diff ../de_DE.orig.aff de_DE.aff >d |
| 72 | @if os.stat('d')[stat.ST_SIZE] > 0: |
| 73 | :copy de_DE.aff ../de_DE.new.aff |
| 74 | :sys {force} diff ../de_DE.orig.dic de_DE.dic >d |
| 75 | @if os.stat('d')[stat.ST_SIZE] > 0: |
| 76 | :copy de_DE.dic ../de_DE.new.dic |
| 77 | @finally: |
| 78 | :cd .. |
| 79 | :delete {r}{f}{q} tmp |
| 80 | :delete $(ZIPFILE) |
| 81 | |
| 82 | |
| 83 | # vim: set sts=4 sw=4 : |