blob: 74cd1d58bdcdeba5652ca73e0643873c03c563c1 [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 Moolenaar5b8d8fd2005-08-16 23:01:50 +000015$SPELLDIR/pl.iso-8859-2.spl : $FILES
Bram Moolenaarae5bce12005-08-15 21:41:48 +000016 :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 Moolenaar5b8d8fd2005-08-16 23:01:50 +000018$SPELLDIR/pl.utf-8.spl : $FILES
Bram Moolenaarae5bce12005-08-15 21:41:48 +000019 :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 Moolenaar5b8d8fd2005-08-16 23:01:50 +000021$SPELLDIR/pl.cp1250.spl : $FILES
Bram Moolenaarae5bce12005-08-15 21:41:48 +000022 :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#
Bram Moolenaar9964e462007-05-05 17:54:07 +000036HTTPDIR = http://www.kurnik.pl/dictionary
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
Bram Moolenaar9964e462007-05-05 17:54:07 +000043 fname = alt-myspell-pl.tar.bz2
44 :attr {fetch = $HTTPDIR/%file%} $fname
45 :fetch $fname
Bram Moolenaarae5bce12005-08-15 21:41:48 +000046 :sys bunzip2 -c $fname | tar xf -
Bram Moolenaar9964e462007-05-05 17:54:07 +000047 :move alt-myspell-pl-20[0-9]*/* .
48 :deldir alt-myspell-pl-20[0-9]*
Bram Moolenaarae5bce12005-08-15 21:41:48 +000049 :delete $fname
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000050 @if not os.path.exists('pl_PL.orig.aff'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000051 :copy pl_PL.aff pl_PL.orig.aff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000052 @if not os.path.exists('pl_PL.orig.dic'):
Bram Moolenaarae5bce12005-08-15 21:41:48 +000053 :copy pl_PL.dic pl_PL.orig.dic
Bram Moolenaar78984f52005-08-01 07:19:10 +000054 @if os.path.exists('pl_PL.diff'):
55 :sys patch <pl_PL.diff
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000056
57
58# Generate diff files, so that others can get the OpenOffice files and apply
59# the diffs to get the Vim versions.
60
61diff:
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
Bram Moolenaarae5bce12005-08-15 21:41:48 +000067# Check for updated spell files. When there are changes the
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000068# ".new.aff" and ".new.dic" files are left behind for manual inspection.
69
70check:
Bram Moolenaarae5bce12005-08-15 21:41:48 +000071 :assertpkg tar bunzip2 diff
Bram Moolenaar9964e462007-05-05 17:54:07 +000072 fname = alt-myspell-pl.tar.bz2
73 :attr {fetch = $HTTPDIR/%file%} $fname
74 :fetch $fname
Bram Moolenaarae5bce12005-08-15 21:41:48 +000075 :sys bunzip2 -c $fname | tar xf -
Bram Moolenaar9964e462007-05-05 17:54:07 +000076 :cd alt-myspell-pl-20[0-9]*
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000077 @try:
78 @import stat
Bram Moolenaarae5bce12005-08-15 21:41:48 +000079 :sys $UNZIP ../pl_PL.zip
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000080 :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 ..
Bram Moolenaarae5bce12005-08-15 21:41:48 +000088 :delete {r}{f}{q} $base
89 :delete $fname
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000090
91
92# vim: set sts=4 sw=4 :