main.aap 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Aap recipe for Slovak 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 = sk_SK.aff sk_SK.dic
  9. all: $SPELLDIR/sk.iso-8859-2.spl $SPELLDIR/sk.utf-8.spl \
  10. $SPELLDIR/sk.cp1250.spl ../README_sk.txt
  11. $SPELLDIR/sk.iso-8859-2.spl : $FILES
  12. :sys env LANG=sk_SK.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/sk sk_SK" -c q
  13. $SPELLDIR/sk.utf-8.spl : $FILES
  14. :sys env LANG=sk_SK.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/sk sk_SK" -c q
  15. $SPELLDIR/sk.cp1250.spl : $FILES
  16. :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/sk sk_SK" -c q
  17. ../README_sk.txt: README_sk_SK.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%} sk_SK.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. sk_SK.aff sk_SK.dic: {buildcheck=}
  28. :assertpkg unzip patch
  29. :fetch sk_SK.zip
  30. :sys $UNZIP sk_SK.zip
  31. :delete sk_SK.zip
  32. @if not os.path.exists('sk_SK.orig.aff'):
  33. :copy sk_SK.aff sk_SK.orig.aff
  34. @if not os.path.exists('sk_SK.orig.dic'):
  35. :copy sk_SK.dic sk_SK.orig.dic
  36. @if os.path.exists('sk_SK.diff'):
  37. :sys patch <sk_SK.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 sk_SK.orig.aff sk_SK.aff >sk_SK.diff
  43. :sys {force} diff -a -C 1 sk_SK.orig.dic sk_SK.dic >>sk_SK.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 sk_SK.zip
  49. :mkdir tmp
  50. :cd tmp
  51. @try:
  52. @import stat
  53. :sys $UNZIP ../sk_SK.zip
  54. :sys {force} diff ../sk_SK.orig.aff sk_SK.aff >d
  55. @if os.stat('d')[stat.ST_SIZE] > 0:
  56. :copy sk_SK.aff ../sk_SK.new.aff
  57. :sys {force} diff ../sk_SK.orig.dic sk_SK.dic >d
  58. @if os.stat('d')[stat.ST_SIZE] > 0:
  59. :copy sk_SK.dic ../sk_SK.new.dic
  60. @finally:
  61. :cd ..
  62. :delete {r}{f}{q} tmp
  63. :delete sk_SK.zip
  64. # vim: set sts=4 sw=4 :