blob: 9d786528d80f7615792169e7ebe816fe07034371 [file] [log] [blame]
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001# Aap recipe for Dutch Vim spell files.
2
3# Use a freshly compiled Vim if it exists.
4@if os.path.exists('../../../src/vim'):
5 VIM = ../../../src/vim
6@else:
7 VIM = vim
8
9SPELLDIR = ..
10FILES = pl_PL.aff pl_PL.dic
11
Bram Moolenaar63b80982005-07-08 22:21:38 +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
15$(SPELLDIR)/pl.iso-8859-2.spl : $(VIM) $(FILES)
16 :sys env LANG=pl_PL.ISO8859-2 $(VIM) -e -c "mkspell! $(SPELLDIR)/pl pl_PL" -c q
17
18$(SPELLDIR)/pl.utf-8.spl : $(VIM) $(FILES)
19 :sys env LANG=pl_PL.UTF-8 $(VIM) -e -c "mkspell! $(SPELLDIR)/pl pl_PL" -c q
20
Bram Moolenaar63b80982005-07-08 22:21:38 +000021# On Unix 'encoding' can't be "cp1250", use "8bit-cp1250" instead.
22$(SPELLDIR)/pl.cp1250.spl : $(VIM) $(FILES)
23 :sys $(VIM) -e -c "set enc=8bit-cp1250" -c "mkspell! $(SPELLDIR)/pl pl_PL" -c q
24 :move {f} $(SPELLDIR)/pl.8bit-cp1250.spl $(SPELLDIR)/pl.cp1250.spl
25
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000026../README_pl.txt: README_pl_PL.txt
27 :copy $source $target
28
29#
30# Fetching the files from OpenOffice.org.
31#
Bram Moolenaar63b80982005-07-08 22:21:38 +000032#OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
33#:attr {fetch = $(OODIR)/%file%} pl_PL.zip
34
35#
36# Fetching the files from
37#
38HTTPDIR = http://www.kurnik.pl/slownik/ort/
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000039
40# The files don't depend on the .zip file so that we can delete it.
41# Only download the zip file if the targets don't exist.
Bram Moolenaar63b80982005-07-08 22:21:38 +000042# This is a bit tricky, since the file name includes the date.
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000043pl_PL.aff pl_PL.dic: {buildcheck=}
Bram Moolenaar63b80982005-07-08 22:21:38 +000044 :assertpkg tar bunzip2
45 @from time import strftime, gmtime, time
46 @for day in range(20):
47 date = `strftime('%Y%m%d', gmtime(time() - day * 24 * 60 * 60))`
48 base = alt-myspell-pl-$(date)
49 fname = $(base).tar.bz2
50 :attr {fetch = $(HTTPDIR)/%file%} $(fname)
51 @try:
52 :fetch $(fname)
53 ok = 1
54 @except:
55 ok = 0
56 @if ok:
57 @break
58 :sys bunzip2 -c $(fname) | tar xf -
59 :move $(base)/* .
60 :deldir $(base)
61 :delete $(fname)
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000062 @if not os.path.exists('pl_PL.orig.aff'):
63 :copy pl_PL.aff pl_PL.orig.aff
64 @if not os.path.exists('pl_PL.orig.dic'):
65 :copy pl_PL.aff pl_PL.orig.dic
66 :sys patch <pl_PL.diff
67
68
69# Generate diff files, so that others can get the OpenOffice files and apply
70# the diffs to get the Vim versions.
71
72diff:
73 :assertpkg diff
74 :sys {force} diff -a -C 1 pl_PL.orig.aff pl_PL.aff >pl_PL.diff
75 :sys {force} diff -a -C 1 pl_PL.orig.dic pl_PL.dic >>pl_PL.diff
76
77
78# Check for updated OpenOffice spell files. When there are changes the
79# ".new.aff" and ".new.dic" files are left behind for manual inspection.
80
81check:
82 :assertpkg unzip diff
83 :fetch pl_PL.zip
84 :mkdir tmp
85 :cd tmp
86 @try:
87 @import stat
88 :sys $(UNZIP) ../pl_PL.zip
89 :sys {force} diff ../pl_PL.orig.aff pl_PL.aff >d
90 @if os.stat('d')[stat.ST_SIZE] > 0:
91 :copy pl_PL.aff ../pl_PL.new.aff
92 :sys {force} diff ../pl_PL.orig.dic pl_PL.dic >d
93 @if os.stat('d')[stat.ST_SIZE] > 0:
94 :copy pl_PL.dic ../pl_PL.new.dic
95 @finally:
96 :cd ..
97 :delete {r}{f}{q} tmp
98 :delete pl_PL.zip
99
100
101# vim: set sts=4 sw=4 :