blob: e33acf8028fb61e2476db432a9d2c170c2e5016c [file] [log] [blame]
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001# Aap recipe for Polish Vim spell files.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00002
3# Use a freshly compiled Vim if it exists.
4@if os.path.exists('../../../src/vim'):
5 VIM = ../../../src/vim
6@else:
Bram Moolenaar78984f52005-08-01 07:19:10 +00007 :progsearch VIM vim
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00008
9SPELLDIR = ..
10FILES = pl_PL.aff pl_PL.dic
11
Bram Moolenaarae5bce12005-08-15 21:41:48 +000012all: $SPELLDIR/pl.iso-8859-2.spl $SPELLDIR/pl.utf-8.spl \
13 $SPELLDIR/pl.cp1250.spl ../README_pl.txt
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000014
Bram Moolenaarae5bce12005-08-15 21:41:48 +000015$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
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000017
Bram Moolenaarae5bce12005-08-15 21:41:48 +000018$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
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000020
Bram Moolenaarae5bce12005-08-15 21:41:48 +000021$SPELLDIR/pl.cp1250.spl : $VIM $FILES
22 :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/pl pl_PL" -c q
Bram Moolenaar63b80982005-07-08 22:21:38 +000023
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000024../README_pl.txt: README_pl_PL.txt
25 :copy $source $target
26
27#
28# Fetching the files from OpenOffice.org.
29#
Bram Moolenaar63b80982005-07-08 22:21:38 +000030#OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
Bram Moolenaarae5bce12005-08-15 21:41:48 +000031#:attr {fetch = $OODIR/%file%} pl_PL.zip
Bram Moolenaar63b80982005-07-08 22:21:38 +000032
33#
34# Fetching the files from
35#
36HTTPDIR = http://www.kurnik.pl/slownik/ort/
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000037
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.
Bram Moolenaar63b80982005-07-08 22:21:38 +000040# This is a bit tricky, since the file name includes the date.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000041pl_PL.aff pl_PL.dic: {buildcheck=}
Bram Moolenaar63b80982005-07-08 22:21:38 +000042 :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))`
Bram Moolenaarae5bce12005-08-15 21:41:48 +000046 base = alt-myspell-pl-$date
47 fname = $base.tar.bz2
48 :attr {fetch = $HTTPDIR/%file%} $fname
Bram Moolenaar63b80982005-07-08 22:21:38 +000049 @try:
Bram Moolenaarae5bce12005-08-15 21:41:48 +000050 :fetch $fname
Bram Moolenaar63b80982005-07-08 22:21:38 +000051 ok = 1
52 @except:
53 ok = 0
54 @if ok:
55 @break
Bram Moolenaarae5bce12005-08-15 21:41:48 +000056 :sys bunzip2 -c $fname | tar xf -
57 :move $base/* .
58 :deldir $base
59 :delete $fname
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000060 @if not os.path.exists('pl_PL.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000061 :copy pl_PL.aff pl_PL.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000062 @if not os.path.exists('pl_PL.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000063 :copy pl_PL.dic pl_PL.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000064 @if os.path.exists('pl_PL.diff'):
65 :sys patch <pl_PL.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000066
67
68# Generate diff files, so that others can get the OpenOffice files and apply
69# the diffs to get the Vim versions.
70
71diff:
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
Bram Moolenaarae5bce12005-08-15 21:41:48 +000077# Check for updated spell files. When there are changes the
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000078# ".new.aff" and ".new.dic" files are left behind for manual inspection.
79
80check:
Bram Moolenaarae5bce12005-08-15 21:41:48 +000081 :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
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000097 @try:
98 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +000099 :sys $UNZIP ../pl_PL.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000100 :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 ..
Bram Moolenaarae5bce12005-08-15 21:41:48 +0000108 :delete {r}{f}{q} $base
109 :delete $fname
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000110
111
112# vim: set sts=4 sw=4 :