main.aap 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Aap recipe for Lithuanian 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 = lt_LT.aff lt_LT.dic
  9. all: $SPELLDIR/lt.iso-8859-13.spl $SPELLDIR/lt.utf-8.spl \
  10. ../README_lt.txt
  11. $SPELLDIR/lt.iso-8859-13.spl : $FILES
  12. :sys env LANG=lt_LT.ISO8859-13 $VIM -u NONE -e -c "mkspell! $SPELLDIR/lt lt_LT" -c q
  13. $SPELLDIR/lt.utf-8.spl : $FILES
  14. :sys env LANG=lt_LT.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/lt lt_LT" -c q
  15. ../README_lt.txt: README_lt_LT.txt
  16. :copy $source $target
  17. #
  18. # Fetching the files from OpenOffice.org.
  19. #
  20. OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
  21. :attr {fetch = $OODIR/%file%} lt_LT.zip
  22. # The files don't depend on the .zip file so that we can delete it.
  23. # Only download the zip file if the targets don't exist.
  24. # This is a bit tricky, since the file name includes the date.
  25. lt_LT.aff lt_LT.dic: {buildcheck=}
  26. :assertpkg unzip patch
  27. :fetch lt_LT.zip
  28. :sys $UNZIP lt_LT.zip
  29. :delete lt_LT.zip
  30. @if not os.path.exists('lt_LT.orig.aff'):
  31. :copy lt_LT.aff lt_LT.orig.aff
  32. @if not os.path.exists('lt_LT.orig.dic'):
  33. :copy lt_LT.dic lt_LT.orig.dic
  34. @if os.path.exists('lt_LT.diff'):
  35. :sys patch <lt_LT.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 lt_LT.orig.aff lt_LT.aff >lt_LT.diff
  41. :sys {force} diff -a -C 1 lt_LT.orig.dic lt_LT.dic >>lt_LT.diff
  42. # Check for updated 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 lt_LT.zip
  47. :mkdir tmp
  48. :cd tmp
  49. @try:
  50. @import stat
  51. :sys $UNZIP ../lt_LT.zip
  52. :sys {force} diff ../lt_LT.orig.aff lt_LT.aff >d
  53. @if os.stat('d')[stat.ST_SIZE] > 0:
  54. :copy lt_LT.aff ../lt_LT.new.aff
  55. :sys {force} diff ../lt_LT.orig.dic lt_LT.dic >d
  56. @if os.stat('d')[stat.ST_SIZE] > 0:
  57. :copy lt_LT.dic ../lt_LT.new.dic
  58. @finally:
  59. :cd ..
  60. :delete {r}{f}{q} tmp
  61. :delete lt_LT.zip
  62. # vim: set sts=4 sw=4 :