446
|
1 # Aap recipe for Polish Vim spell files.
|
388
|
2
|
|
3 # Use a freshly compiled Vim if it exists.
|
|
4 @if os.path.exists('../../../src/vim'):
|
|
5 VIM = ../../../src/vim
|
|
6 @else:
|
456
|
7 :progsearch VIM vim
|
388
|
8
|
|
9 SPELLDIR = ..
|
|
10 FILES = pl_PL.aff pl_PL.dic
|
|
11
|
481
|
12 all: $SPELLDIR/pl.iso-8859-2.spl $SPELLDIR/pl.utf-8.spl \
|
|
13 $SPELLDIR/pl.cp1250.spl ../README_pl.txt
|
388
|
14
|
482
|
15 $SPELLDIR/pl.iso-8859-2.spl : $FILES
|
481
|
16 :sys env LANG=pl_PL.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pl pl_PL" -c q
|
388
|
17
|
482
|
18 $SPELLDIR/pl.utf-8.spl : $FILES
|
481
|
19 :sys env LANG=pl_PL.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pl pl_PL" -c q
|
388
|
20
|
482
|
21 $SPELLDIR/pl.cp1250.spl : $FILES
|
481
|
22 :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/pl pl_PL" -c q
|
400
|
23
|
388
|
24 ../README_pl.txt: README_pl_PL.txt
|
|
25 :copy $source $target
|
|
26
|
|
27 #
|
|
28 # Fetching the files from OpenOffice.org.
|
|
29 #
|
400
|
30 #OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
|
481
|
31 #:attr {fetch = $OODIR/%file%} pl_PL.zip
|
400
|
32
|
|
33 #
|
|
34 # Fetching the files from
|
|
35 #
|
1121
|
36 HTTPDIR = http://www.kurnik.pl/dictionary
|
388
|
37
|
|
38 # The files don't depend on the .zip file so that we can delete it.
|
|
39 # Only download the zip file if the targets don't exist.
|
400
|
40 # This is a bit tricky, since the file name includes the date.
|
388
|
41 pl_PL.aff pl_PL.dic: {buildcheck=}
|
400
|
42 :assertpkg tar bunzip2
|
1121
|
43 fname = alt-myspell-pl.tar.bz2
|
|
44 :attr {fetch = $HTTPDIR/%file%} $fname
|
|
45 :fetch $fname
|
481
|
46 :sys bunzip2 -c $fname | tar xf -
|
1121
|
47 :move alt-myspell-pl-20[0-9]*/* .
|
|
48 :deldir alt-myspell-pl-20[0-9]*
|
481
|
49 :delete $fname
|
388
|
50 @if not os.path.exists('pl_PL.orig.aff'):
|
481
|
51 :copy pl_PL.aff pl_PL.orig.aff
|
388
|
52 @if not os.path.exists('pl_PL.orig.dic'):
|
481
|
53 :copy pl_PL.dic pl_PL.orig.dic
|
456
|
54 @if os.path.exists('pl_PL.diff'):
|
|
55 :sys patch <pl_PL.diff
|
388
|
56
|
|
57
|
|
58 # Generate diff files, so that others can get the OpenOffice files and apply
|
|
59 # the diffs to get the Vim versions.
|
|
60
|
|
61 diff:
|
|
62 :assertpkg diff
|
|
63 :sys {force} diff -a -C 1 pl_PL.orig.aff pl_PL.aff >pl_PL.diff
|
|
64 :sys {force} diff -a -C 1 pl_PL.orig.dic pl_PL.dic >>pl_PL.diff
|
|
65
|
|
66
|
481
|
67 # Check for updated spell files. When there are changes the
|
388
|
68 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
|
|
69
|
|
70 check:
|
481
|
71 :assertpkg tar bunzip2 diff
|
1121
|
72 fname = alt-myspell-pl.tar.bz2
|
|
73 :attr {fetch = $HTTPDIR/%file%} $fname
|
|
74 :fetch $fname
|
481
|
75 :sys bunzip2 -c $fname | tar xf -
|
1121
|
76 :cd alt-myspell-pl-20[0-9]*
|
388
|
77 @try:
|
|
78 @import stat
|
481
|
79 :sys $UNZIP ../pl_PL.zip
|
388
|
80 :sys {force} diff ../pl_PL.orig.aff pl_PL.aff >d
|
|
81 @if os.stat('d')[stat.ST_SIZE] > 0:
|
|
82 :copy pl_PL.aff ../pl_PL.new.aff
|
|
83 :sys {force} diff ../pl_PL.orig.dic pl_PL.dic >d
|
|
84 @if os.stat('d')[stat.ST_SIZE] > 0:
|
|
85 :copy pl_PL.dic ../pl_PL.new.dic
|
|
86 @finally:
|
|
87 :cd ..
|
481
|
88 :delete {r}{f}{q} $base
|
|
89 :delete $fname
|
388
|
90
|
|
91
|
|
92 # vim: set sts=4 sw=4 :
|