main.aap 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Aap recipe for Malagasy 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 = mg_MG.aff mg_MG.dic
  9. # I don't have a Malagasy locale, use the Dutch one instead.
  10. all: $SPELLDIR/mg.latin1.spl $SPELLDIR/mg.utf-8.spl ../README_mg.txt
  11. $SPELLDIR/mg.latin1.spl : $FILES
  12. :sys env LANG=nl_NL.ISO8859-1
  13. $VIM -u NONE -e -c "mkspell! $SPELLDIR/mg mg_MG" -c q
  14. $SPELLDIR/mg.utf-8.spl : $FILES
  15. :sys env LANG=nl_NL.UTF-8
  16. $VIM -u NONE -e -c "mkspell! $SPELLDIR/mg mg_MG" -c q
  17. ../README_mg.txt : README_mg_MG.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%} mg_MG.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. mg_MG.aff mg_MG.dic: {buildcheck=}
  27. :assertpkg unzip patch
  28. :fetch mg_MG.zip
  29. :sys $UNZIP mg_MG.zip
  30. :delete mg_MG.zip
  31. @if not os.path.exists('mg_MG.orig.aff'):
  32. :copy mg_MG.aff mg_MG.orig.aff
  33. @if not os.path.exists('mg_MG.orig.dic'):
  34. :copy mg_MG.dic mg_MG.orig.dic
  35. @if os.path.exists('mg_MG.diff'):
  36. :sys patch <mg_MG.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 mg_MG.orig.aff mg_MG.aff >mg_MG.diff
  42. :sys {force} diff -a -C 1 mg_MG.orig.dic mg_MG.dic >>mg_MG.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 mg_MG.zip
  48. :mkdir tmp
  49. :cd tmp
  50. @try:
  51. @import stat
  52. :sys $UNZIP ../mg_MG.zip
  53. :sys {force} diff ../mg_MG.orig.aff mg_MG.aff >d
  54. @if os.stat('d')[stat.ST_SIZE] > 0:
  55. :copy mg_MG.aff ../mg_MG.new.aff
  56. :sys {force} diff ../mg_MG.orig.dic mg_MG.dic >d
  57. @if os.stat('d')[stat.ST_SIZE] > 0:
  58. :copy mg_MG.dic ../mg_MG.new.dic
  59. @finally:
  60. :cd ..
  61. :delete {r}{f}{q} tmp
  62. :delete mg_MG.zip
  63. # vim: set sts=4 sw=4 :