blob: 8f2379dc3274234de222681dd57684105e06d967 [file] [log] [blame]
Bram Moolenaare344bea2005-09-01 20:46:49 +00001# Aap recipe for Romanian 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 :progsearch VIM vim
8
9SPELLDIR = ..
10FILES = ro_RO.aff ro_RO.dic
11
Bram Moolenaar91e15e12014-09-19 22:38:48 +020012all: $SPELLDIR/ro.utf-8.spl \
13 $SPELLDIR/ro.iso-8859-2.spl \
14 $SPELLDIR/ro.cp1250.spl \
15 ../README_ro.txt
Bram Moolenaare344bea2005-09-01 20:46:49 +000016
17$SPELLDIR/ro.utf-8.spl : $FILES
Bram Moolenaar91e15e12014-09-19 22:38:48 +020018 :sys env LANG=ro_RO.utf8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
Bram Moolenaare344bea2005-09-01 20:46:49 +000019
Bram Moolenaar91e15e12014-09-19 22:38:48 +020020# Note: this generates conversion errors, because not all characters can be
21# represented in iso-8859-2.
22$SPELLDIR/ro.iso-8859-2.spl : $FILES
23 :sys env LANG=ro_RO.iso88592 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
24
25# Note: this generates conversion errors, because not all characters can be
26# represented in cp1250.
Bram Moolenaare344bea2005-09-01 20:46:49 +000027$SPELLDIR/ro.cp1250.spl : $FILES
28 :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/ro ro_RO" -c q
29
Bram Moolenaar91e15e12014-09-19 22:38:48 +020030../README_ro.txt: README
Bram Moolenaare344bea2005-09-01 20:46:49 +000031 :copy $source $target
32
33#
34# Fetching the files from OpenOffice.org.
35#
Bram Moolenaar91e15e12014-09-19 22:38:48 +020036#OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
37OODIR = http://sourceforge.net/projects/rospell/files/Romanian%20dictionaries/dict-3.3.10
38ZIPFILE = ro_RO.3.3.10.zip
39:attr {fetch = $OODIR/%file%} $ZIPFILE
Bram Moolenaare344bea2005-09-01 20:46:49 +000040
41# The files don't depend on the .zip file so that we can delete it.
42# Only download the zip file if the targets don't exist.
43# This is a bit tricky, since the file name includes the date.
44ro_RO.aff ro_RO.dic: {buildcheck=}
45 :assertpkg unzip patch
Bram Moolenaar91e15e12014-09-19 22:38:48 +020046 :fetch $ZIPFILE
47 :sys $UNZIP $ZIPFILE
48 :delete $ZIPFILE
Bram Moolenaare344bea2005-09-01 20:46:49 +000049 @if not os.path.exists('ro_RO.orig.aff'):
50 :copy ro_RO.aff ro_RO.orig.aff
51 @if not os.path.exists('ro_RO.orig.dic'):
52 :copy ro_RO.dic ro_RO.orig.dic
53 @if os.path.exists('ro_RO.diff'):
54 :sys patch <ro_RO.diff
55
56
57# Generate diff files, so that others can get the OpenOffice files and apply
58# the diffs to get the Vim versions.
59
60diff:
61 :assertpkg diff
62 :sys {force} diff -a -C 1 ro_RO.orig.aff ro_RO.aff >ro_RO.diff
63 :sys {force} diff -a -C 1 ro_RO.orig.dic ro_RO.dic >>ro_RO.diff
64
65
66# Check for updated spell files. When there are changes the
67# ".new.aff" and ".new.dic" files are left behind for manual inspection.
68
69check:
70 :assertpkg unzip diff
Bram Moolenaar91e15e12014-09-19 22:38:48 +020071 :fetch $ZIPFILE
Bram Moolenaare344bea2005-09-01 20:46:49 +000072 :mkdir tmp
73 :cd tmp
74 @try:
75 @import stat
Bram Moolenaar91e15e12014-09-19 22:38:48 +020076 :sys $UNZIP ../$ZIPFILE
Bram Moolenaare344bea2005-09-01 20:46:49 +000077 :sys {force} diff ../ro_RO.orig.aff ro_RO.aff >d
78 @if os.stat('d')[stat.ST_SIZE] > 0:
79 :copy ro_RO.aff ../ro_RO.new.aff
80 :sys {force} diff ../ro_RO.orig.dic ro_RO.dic >d
81 @if os.stat('d')[stat.ST_SIZE] > 0:
82 :copy ro_RO.dic ../ro_RO.new.dic
83 @finally:
84 :cd ..
85 :delete {r}{f}{q} tmp
Bram Moolenaar91e15e12014-09-19 22:38:48 +020086 :delete $ZIPFILE
Bram Moolenaare344bea2005-09-01 20:46:49 +000087
Bram Moolenaar91e15e12014-09-19 22:38:48 +020088# Remove all the downloaded and generated files.
89clean:
90 :delete ro_RO.aff
91 :delete ro_RO.dic
92 :delete ro_RO.orig.aff
93 :delete ro_RO.orig.dic
94 :delete ro_RO-ante1993.aff
95 :delete ro_RO-ante1993.dic
96 :delete COPYING.GPL
97 :delete COPYING.LGPL
98 :delete COPYING.MPL
99 :delete README
Bram Moolenaare344bea2005-09-01 20:46:49 +0000100
101# vim: set sts=4 sw=4 :