main.aap 2.3 KB

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