main.aap 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Aap recipe for Esperanto 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 = eo_l3.aff eo_l3.dic
  9. all: $SPELLDIR/eo.iso-8859-3.spl $SPELLDIR/eo.utf-8.spl ../README_eo.txt
  10. $SPELLDIR/eo.iso-8859-3.spl : $FILES
  11. :sys $VIM -u NONE -e -c "set enc=iso-8859-3"
  12. -c "mkspell! $SPELLDIR/eo eo_l3" -c q
  13. $SPELLDIR/eo.utf-8.spl : $FILES
  14. :sys $VIM -u NONE -e -c "set enc=utf-8"
  15. -c "mkspell! $SPELLDIR/eo eo_l3" -c q
  16. ../README_eo.txt : README_eo_l3.txt
  17. :copy $source $target
  18. # fix missing newline
  19. :sys $VIM -u NONE -e -c "set ff=unix" -c wq $target
  20. #
  21. # Fetching the files from OpenOffice.org.
  22. #
  23. OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
  24. :attr {fetch = $OODIR/%file%} eo.zip
  25. # The files don't depend on the .zip file so that we can delete it.
  26. # Only download the zip file if the targets don't exist.
  27. eo_l3.aff eo_l3.dic: {buildcheck=}
  28. :assertpkg unzip patch
  29. :fetch eo.zip
  30. :sys $UNZIP eo.zip
  31. :delete eo.zip
  32. @if not os.path.exists('eo_l3.orig.aff'):
  33. :copy eo_l3.aff eo_l3.orig.aff
  34. @if not os.path.exists('eo_l3.orig.dic'):
  35. :copy eo_l3.dic eo_l3.orig.dic
  36. @if os.path.exists('eo_l3.diff'):
  37. :sys patch <eo_l3.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 eo_l3.orig.aff eo_l3.aff >eo_l3.diff
  43. :sys {force} diff -a -C 1 eo_l3.orig.dic eo_l3.dic >>eo_l3.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 eo.zip
  49. :mkdir tmp
  50. :cd tmp
  51. @try:
  52. @import stat
  53. :sys $UNZIP ../eo.zip
  54. :sys {force} diff ../eo_l3.orig.aff eo_l3.aff >d
  55. @if os.stat('d')[stat.ST_SIZE] > 0:
  56. :copy eo_l3.aff ../eo_l3.new.aff
  57. :sys {force} diff ../eo_l3.orig.dic eo_l3.dic >d
  58. @if os.stat('d')[stat.ST_SIZE] > 0:
  59. :copy eo_l3.dic ../eo_l3.new.dic
  60. @finally:
  61. :cd ..
  62. :delete {r}{f}{q} tmp
  63. :delete eo.zip
  64. # vim: set sts=4 sw=4 :