main.aap 2.3 KB

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