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
|
481
|
15 $SPELLDIR/pl.iso-8859-2.spl : $VIM $FILES
|
|
16 :sys env LANG=pl_PL.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pl pl_PL" -c q
|
388
|
17
|
481
|
18 $SPELLDIR/pl.utf-8.spl : $VIM $FILES
|
|
19 :sys env LANG=pl_PL.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pl pl_PL" -c q
|
388
|
20
|
481
|
21 $SPELLDIR/pl.cp1250.spl : $VIM $FILES
|
|
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 #
|
|
36 HTTPDIR = http://www.kurnik.pl/slownik/ort/
|
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
|
|
43 @from time import strftime, gmtime, time
|
|
44 @for day in range(20):
|
|
45 date = `strftime('%Y%m%d', gmtime(time() - day * 24 * 60 * 60))`
|
481
|
46 base = alt-myspell-pl-$date
|
|
47 fname = $base.tar.bz2
|
|
48 :attr {fetch = $HTTPDIR/%file%} $fname
|
400
|
49 @try:
|
481
|
50 :fetch $fname
|
400
|
51 ok = 1
|
|
52 @except:
|
|
53 ok = 0
|
|
54 @if ok:
|
|
55 @break
|
481
|
56 :sys bunzip2 -c $fname | tar xf -
|
|
57 :move $base/* .
|
|
58 :deldir $base
|
|
59 :delete $fname
|
388
|
60 @if not os.path.exists('pl_PL.orig.aff'):
|
481
|
61 :copy pl_PL.aff pl_PL.orig.aff
|
388
|
62 @if not os.path.exists('pl_PL.orig.dic'):
|
481
|
63 :copy pl_PL.dic pl_PL.orig.dic
|
456
|
64 @if os.path.exists('pl_PL.diff'):
|
|
65 :sys patch <pl_PL.diff
|
388
|
66
|
|
67
|
|
68 # Generate diff files, so that others can get the OpenOffice files and apply
|
|
69 # the diffs to get the Vim versions.
|
|
70
|
|
71 diff:
|
|
72 :assertpkg diff
|
|
73 :sys {force} diff -a -C 1 pl_PL.orig.aff pl_PL.aff >pl_PL.diff
|
|
74 :sys {force} diff -a -C 1 pl_PL.orig.dic pl_PL.dic >>pl_PL.diff
|
|
75
|
|
76
|
481
|
77 # Check for updated spell files. When there are changes the
|
388
|
78 # ".new.aff" and ".new.dic" files are left behind for manual inspection.
|
|
79
|
|
80 check:
|
481
|
81 :assertpkg tar bunzip2 diff
|
|
82 @from time import strftime, gmtime, time
|
|
83 @for day in range(20):
|
|
84 date = `strftime('%Y%m%d', gmtime(time() - day * 24 * 60 * 60))`
|
|
85 base = alt-myspell-pl-$date
|
|
86 fname = $base.tar.bz2
|
|
87 :attr {fetch = $HTTPDIR/%file%} $fname
|
|
88 @try:
|
|
89 :fetch $fname
|
|
90 ok = 1
|
|
91 @except:
|
|
92 ok = 0
|
|
93 @if ok:
|
|
94 @break
|
|
95 :sys bunzip2 -c $fname | tar xf -
|
|
96 :cd $base
|
388
|
97 @try:
|
|
98 @import stat
|
481
|
99 :sys $UNZIP ../pl_PL.zip
|
388
|
100 :sys {force} diff ../pl_PL.orig.aff pl_PL.aff >d
|
|
101 @if os.stat('d')[stat.ST_SIZE] > 0:
|
|
102 :copy pl_PL.aff ../pl_PL.new.aff
|
|
103 :sys {force} diff ../pl_PL.orig.dic pl_PL.dic >d
|
|
104 @if os.stat('d')[stat.ST_SIZE] > 0:
|
|
105 :copy pl_PL.dic ../pl_PL.new.dic
|
|
106 @finally:
|
|
107 :cd ..
|
481
|
108 :delete {r}{f}{q} $base
|
|
109 :delete $fname
|
388
|
110
|
|
111
|
|
112 # vim: set sts=4 sw=4 :
|