vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

main.aap (3262B)


      1 # 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 
      9 SPELLDIR = ..
     10 FILES    = ro_RO.aff ro_RO.dic
     11 
     12 all: $SPELLDIR/ro.utf-8.spl \
     13         $SPELLDIR/ro.iso-8859-2.spl \
     14         $SPELLDIR/ro.cp1250.spl \
     15         ../README_ro.txt
     16 
     17 $SPELLDIR/ro.utf-8.spl : $FILES
     18         :sys env LANG=ro_RO.utf8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
     19 
     20 # 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.
     27 $SPELLDIR/ro.cp1250.spl : $FILES
     28         :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/ro ro_RO" -c q
     29 
     30 ../README_ro.txt: README
     31         :copy $source $target
     32 
     33 #
     34 # Fetching the files from OpenOffice.org.
     35 #
     36 #OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
     37 OODIR = http://sourceforge.net/projects/rospell/files/Romanian%20dictionaries/dict-3.3.10
     38 ZIPFILE = ro_RO.3.3.10.zip
     39 :attr {fetch = $OODIR/%file%} $ZIPFILE
     40 
     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.
     44 ro_RO.aff ro_RO.dic: {buildcheck=}
     45         :assertpkg unzip patch
     46         :fetch $ZIPFILE
     47         :sys $UNZIP $ZIPFILE
     48         :delete $ZIPFILE
     49         @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 
     60 diff:
     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 
     69 check:
     70         :assertpkg unzip diff
     71         :fetch $ZIPFILE
     72         :mkdir tmp
     73         :cd tmp
     74         @try:
     75             @import stat
     76             :sys $UNZIP ../$ZIPFILE
     77             :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
     86             :delete $ZIPFILE
     87 
     88 # Remove all the downloaded and generated files.
     89 clean:
     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
    100 
    101 # vim: set sts=4 sw=4 :