main.aap 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Aap recipe for Russian 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. REGIONS = RU YO
  8. SPELLDIR = ..
  9. FILES = ru_$*(REGIONS).aff ru_$*(REGIONS).dic
  10. all: $SPELLDIR/ru.koi8-r.spl $SPELLDIR/ru.utf-8.spl \
  11. $SPELLDIR/ru.cp1251.spl ../README_ru.txt
  12. $SPELLDIR/ru.koi8-r.spl : $FILES
  13. :sys env LANG=ru_RU.KOI8-R $VIM -u NONE -e -c "mkspell! $SPELLDIR/ru ru_RU ru_YO" -c q
  14. $SPELLDIR/ru.utf-8.spl : $FILES
  15. :sys env LANG=ru_RU.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ru ru_RU ru_YO" -c q
  16. $SPELLDIR/ru.cp1251.spl : $FILES
  17. :sys env LANG=ru_RU.CP1251 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ru ru_RU ru_YO" -c q
  18. ../README_ru.txt: README_ru_$*(REGIONS).txt
  19. :print ru_RU >! $target
  20. :cat README_ru_RU.txt >> $target
  21. :print =================================================== >>$target
  22. :print ru_YO >> $target
  23. :cat README_ru_YO.txt >> $target
  24. #
  25. # Fetching the files from OpenOffice.org.
  26. #
  27. OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
  28. :attr {fetch = $OODIR/%file%} ru_RU.zip ru_RU_yo.zip
  29. # The files don't depend on the .zip file so that we can delete it.
  30. # Only download the zip file if the targets don't exist.
  31. # This is a bit tricky, since the file name includes the date.
  32. ru_RU.aff ru_RU.dic: {buildcheck=}
  33. :assertpkg unzip
  34. :fetch ru_RU.zip
  35. :sys unzip ru_RU.zip
  36. :delete ru_RU.zip
  37. @if not os.path.exists('ru_RU.orig.aff'):
  38. :copy ru_RU.aff ru_RU.orig.aff
  39. @if not os.path.exists('ru_RU.orig.dic'):
  40. :copy ru_RU.dic ru_RU.orig.dic
  41. @if os.path.exists('ru_RU.diff'):
  42. :sys patch <ru_RU.diff
  43. ru_YO.aff ru_YO.dic: {buildcheck=}
  44. :assertpkg unzip
  45. :fetch ru_RU_yo.zip
  46. :sys unzip ru_RU_yo.zip
  47. :delete ru_RU_yo.zip
  48. :move ru_RU_yo.aff ru_YO.aff
  49. :move ru_RU_yo.dic ru_YO.dic
  50. :move README_ru_RU_yo.txt README_ru_YO.txt
  51. @if not os.path.exists('ru_YO.orig.aff'):
  52. :copy ru_YO.aff ru_YO.orig.aff
  53. @if not os.path.exists('ru_YO.orig.dic'):
  54. :copy ru_YO.dic ru_YO.orig.dic
  55. @if os.path.exists('ru_YO.diff'):
  56. :sys patch <ru_YO.diff
  57. # Generate diff files, so that others can get the OpenOffice files and apply
  58. # the diffs to get the Vim versions.
  59. diff:
  60. :assertpkg diff
  61. :sys {force} diff -a -C 1 ru_RU.orig.aff ru_RU.aff >ru_RU.diff
  62. :sys {force} diff -a -C 1 ru_RU.orig.dic ru_RU.dic >>ru_RU.diff
  63. :sys {force} diff -a -C 1 ru_YO.orig.aff ru_YO.aff >ru_YO.diff
  64. :sys {force} diff -a -C 1 ru_YO.orig.dic ru_YO.dic >>ru_YO.diff
  65. # Check for updated spell files. When there are changes the
  66. # ".new.aff" and ".new.dic" files are left behind for manual inspection.
  67. check:
  68. :print Doesn't work yet.