vim

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

main.aap (2598B)


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