main.aap 2.5 KB

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