main.aap 2.5 KB

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