main.aap 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Aap recipe for Kinyarwanda (Rwanda) 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 = rw_RW.aff rw_RW.dic
  9. all: $SPELLDIR/rw.latin1.spl $SPELLDIR/rw.utf-8.spl ../README_rw.txt
  10. # I don't have a Kinyarwanda locale, use the Dutch one instead.
  11. $SPELLDIR/rw.latin1.spl : $FILES
  12. :sys env LANG=nl_NL.ISO8859-1
  13. $VIM -u NONE -e -c "mkspell! $SPELLDIR/rw rw_RW" -c q
  14. $SPELLDIR/rw.utf-8.spl : $FILES
  15. :sys env LANG=nl_NL.UTF-8
  16. $VIM -u NONE -e -c "mkspell! $SPELLDIR/rw rw_RW" -c q
  17. ../README_rw.txt : README_rw_RW.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%} rw_RW.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. rw_RW.aff rw_RW.dic: {buildcheck=}
  27. :assertpkg unzip patch
  28. :fetch rw_RW.zip
  29. :sys $UNZIP rw_RW.zip
  30. :delete rw_RW.zip
  31. @if not os.path.exists('rw_RW.orig.aff'):
  32. :copy rw_RW.aff rw_RW.orig.aff
  33. @if not os.path.exists('rw_RW.orig.dic'):
  34. :copy rw_RW.dic rw_RW.orig.dic
  35. @if os.path.exists('rw_RW.diff'):
  36. :sys patch <rw_RW.diff
  37. # Generate diff files, so that others can get the OpenOffice files and apply
  38. # the diffs to get the Vim versions.
  39. diff:
  40. :assertpkg diff
  41. :sys {force} diff -a -C 1 rw_RW.orig.aff rw_RW.aff >rw_RW.diff
  42. :sys {force} diff -a -C 1 rw_RW.orig.dic rw_RW.dic >>rw_RW.diff
  43. # Check for updated OpenOffice spell files. When there are changes the
  44. # ".new.aff" and ".new.dic" files are left behind for manual inspection.
  45. check:
  46. :assertpkg unzip diff
  47. :fetch rw_RW.zip
  48. :mkdir tmp
  49. :cd tmp
  50. @try:
  51. @import stat
  52. :sys $UNZIP ../rw_RW.zip
  53. :sys {force} diff ../rw_RW.orig.aff rw_RW.aff >d
  54. @if os.stat('d')[stat.ST_SIZE] > 0:
  55. :copy rw_RW.aff ../rw_RW.new.aff
  56. :sys {force} diff ../rw_RW.orig.dic rw_RW.dic >d
  57. @if os.stat('d')[stat.ST_SIZE] > 0:
  58. :copy rw_RW.dic ../rw_RW.new.dic
  59. @finally:
  60. :cd ..
  61. :delete {r}{f}{q} tmp
  62. :delete rw_RW.zip
  63. # vim: set sts=4 sw=4 :