blob: b28477d026b613e9cb14fdaa2a80bf426c501663 [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
12all: $(SPELLDIR)/pl.iso-8859-2.spl $(SPELLDIR)/pl.utf-8.spl ../README_pl.txt
13
14$(SPELLDIR)/pl.iso-8859-2.spl : $(VIM) $(FILES)
15 :sys env LANG=pl_PL.ISO8859-2 $(VIM) -e -c "mkspell! $(SPELLDIR)/pl pl_PL" -c q
16
17$(SPELLDIR)/pl.utf-8.spl : $(VIM) $(FILES)
18 :sys env LANG=pl_PL.UTF-8 $(VIM) -e -c "mkspell! $(SPELLDIR)/pl pl_PL" -c q
19
20../README_pl.txt: README_pl_PL.txt
21 :copy $source $target
22
23#
24# Fetching the files from OpenOffice.org.
25#
26OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
27:attr {fetch = $(OODIR)/%file%} pl_PL.zip
28
29# The files don't depend on the .zip file so that we can delete it.
30# Only download the zip file if the targets don't exist.
31pl_PL.aff pl_PL.dic: {buildcheck=}
32 :assertpkg unzip patch
33 :fetch pl_PL.zip
34 :sys $(UNZIP) pl_PL.zip
35 :delete pl_PL.zip
36 @if not os.path.exists('pl_PL.orig.aff'):
37 :copy pl_PL.aff pl_PL.orig.aff
38 @if not os.path.exists('pl_PL.orig.dic'):
39 :copy pl_PL.aff pl_PL.orig.dic
40 :sys patch <pl_PL.diff
41
42
43# Generate diff files, so that others can get the OpenOffice files and apply
44# the diffs to get the Vim versions.
45
46diff:
47 :assertpkg diff
48 :sys {force} diff -a -C 1 pl_PL.orig.aff pl_PL.aff >pl_PL.diff
49 :sys {force} diff -a -C 1 pl_PL.orig.dic pl_PL.dic >>pl_PL.diff
50
51
52# Check for updated OpenOffice spell files. When there are changes the
53# ".new.aff" and ".new.dic" files are left behind for manual inspection.
54
55check:
56 :assertpkg unzip diff
57 :fetch pl_PL.zip
58 :mkdir tmp
59 :cd tmp
60 @try:
61 @import stat
62 :sys $(UNZIP) ../pl_PL.zip
63 :sys {force} diff ../pl_PL.orig.aff pl_PL.aff >d
64 @if os.stat('d')[stat.ST_SIZE] > 0:
65 :copy pl_PL.aff ../pl_PL.new.aff
66 :sys {force} diff ../pl_PL.orig.dic pl_PL.dic >d
67 @if os.stat('d')[stat.ST_SIZE] > 0:
68 :copy pl_PL.dic ../pl_PL.new.dic
69 @finally:
70 :cd ..
71 :delete {r}{f}{q} tmp
72 :delete pl_PL.zip
73
74
75# vim: set sts=4 sw=4 :