Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 1 | # Aap recipe for Swedish Vim spell files. |
Bram Moolenaar | a5792f5 | 2005-11-23 21:25:05 +0000 | [diff] [blame] | 2 | # |
Bram Moolenaar | 9c754c4 | 2010-07-10 15:52:35 +0200 | [diff] [blame] | 3 | # Maintainer: Mattias Winther <vim@mattias.winthernet.se> |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 4 | |
| 5 | # Use a freshly compiled Vim if it exists. |
| 6 | @if os.path.exists('../../../src/vim'): |
| 7 | VIM = ../../../src/vim |
| 8 | @else: |
| 9 | :progsearch VIM vim |
| 10 | |
| 11 | SPELLDIR = .. |
| 12 | FILES = sv_SE.aff sv_SE.dic |
| 13 | |
| 14 | all: $SPELLDIR/sv.latin1.spl $SPELLDIR/sv.utf-8.spl ../README_sv.txt |
| 15 | |
| 16 | $SPELLDIR/sv.latin1.spl : $FILES |
Bram Moolenaar | 9c754c4 | 2010-07-10 15:52:35 +0200 | [diff] [blame] | 17 | :sys env LANG=sv_SE.ISO-8859-1 |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 18 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/sv sv_SE" -c q |
| 19 | |
| 20 | $SPELLDIR/sv.utf-8.spl : $FILES |
| 21 | :sys env LANG=sv_SE.UTF-8 |
| 22 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/sv sv_SE" -c q |
| 23 | |
Bram Moolenaar | 607cc1e | 2010-07-18 18:47:44 +0200 | [diff] [blame] | 24 | ../README_sv.txt : README_sv.txt |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 25 | :copy $source $target |
| 26 | |
| 27 | # |
| 28 | # Fetching the files from OpenOffice.org. |
| 29 | # |
Bram Moolenaar | 7abcaab | 2010-07-12 23:05:41 +0200 | [diff] [blame] | 30 | OODIR = http://extensions.services.openoffice.org/e-files/1080/7 |
| 31 | :attr {fetch = $OODIR/%file%} ooo_swedish_dict_1.43.oxt |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 32 | |
| 33 | # The files don't depend on the .zip file so that we can delete it. |
| 34 | # Only download the zip file if the targets don't exist. |
| 35 | sv_SE.aff sv_SE.dic: {buildcheck=} |
| 36 | :assertpkg unzip patch |
Bram Moolenaar | 7abcaab | 2010-07-12 23:05:41 +0200 | [diff] [blame] | 37 | :fetch ooo_swedish_dict_1.43.oxt |
| 38 | :sys $UNZIP ooo_swedish_dict_1.43.oxt |
| 39 | :delete ooo_swedish_dict_1.43.oxt |
Bram Moolenaar | 9c754c4 | 2010-07-10 15:52:35 +0200 | [diff] [blame] | 40 | :delete {r} META-INF |
| 41 | :copy dictionaries/sv_SE.aff sv_SE.aff |
| 42 | :copy dictionaries/sv_SE.dic sv_SE.dic |
| 43 | :delete {r} dictionaries dictionaries.xcu description.xml |
Bram Moolenaar | 607cc1e | 2010-07-18 18:47:44 +0200 | [diff] [blame] | 44 | :delete {f} README_sv.txt |
| 45 | :sys $VIM README_sv.txt -u NONE -N -e -c "0read LICENSE_en_US.txt" -c "read LICENSE_sv_SE.txt" -c "set ff=unix" -c write -c q |
| 46 | :delete LICENSE_en_US.txt LICENSE_sv_SE.txt |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 47 | @if not os.path.exists('sv_SE.orig.aff'): |
| 48 | :copy sv_SE.aff sv_SE.orig.aff |
| 49 | @if not os.path.exists('sv_SE.orig.dic'): |
| 50 | :copy sv_SE.dic sv_SE.orig.dic |
| 51 | @if os.path.exists('sv_SE.diff'): |
| 52 | :sys patch <sv_SE.diff |
| 53 | |
Bram Moolenaar | 607cc1e | 2010-07-18 18:47:44 +0200 | [diff] [blame] | 54 | # Delete all the generated files, start from scratch |
| 55 | clean: |
| 56 | :delete {f} sv_SE.aff sv_SE.dic |
| 57 | :delete {f} sv_SE.aff.orig sv_SE.dic.orig |
| 58 | :delete {f} sv_SE.orig.aff sv_SE.orig.dic |
| 59 | :delete {f} README_sv.txt |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 60 | |
| 61 | # Generate diff files, so that others can get the OpenOffice files and apply |
| 62 | # the diffs to get the Vim versions. |
| 63 | |
| 64 | diff: |
| 65 | :assertpkg diff |
| 66 | :sys {force} diff -a -C 1 sv_SE.orig.aff sv_SE.aff >sv_SE.diff |
| 67 | :sys {force} diff -a -C 1 sv_SE.orig.dic sv_SE.dic >>sv_SE.diff |
| 68 | |
| 69 | |
| 70 | # Check for updated OpenOffice spell files. When there are changes the |
| 71 | # ".new.aff" and ".new.dic" files are left behind for manual inspection. |
| 72 | |
| 73 | check: |
| 74 | :assertpkg unzip diff |
Bram Moolenaar | 7abcaab | 2010-07-12 23:05:41 +0200 | [diff] [blame] | 75 | :fetch ooo_swedish_dict_1.43.oxt |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 76 | :mkdir tmp |
| 77 | :cd tmp |
| 78 | @try: |
| 79 | @import stat |
Bram Moolenaar | 7abcaab | 2010-07-12 23:05:41 +0200 | [diff] [blame] | 80 | :sys $UNZIP ../ooo_swedish_dict_1.43.oxt |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 81 | :sys {force} diff ../sv_SE.orig.aff sv_SE.aff >d |
| 82 | @if os.stat('d')[stat.ST_SIZE] > 0: |
| 83 | :copy sv_SE.aff ../sv_SE.new.aff |
| 84 | :sys {force} diff ../sv_SE.orig.dic sv_SE.dic >d |
| 85 | @if os.stat('d')[stat.ST_SIZE] > 0: |
| 86 | :copy sv_SE.dic ../sv_SE.new.dic |
| 87 | @finally: |
| 88 | :cd .. |
| 89 | :delete {r}{f}{q} tmp |
Bram Moolenaar | 7abcaab | 2010-07-12 23:05:41 +0200 | [diff] [blame] | 90 | :delete ooo_swedish_dict_1.43.oxt |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 91 | |
| 92 | |
| 93 | # vim: set sts=4 sw=4 : |