main.aap 2.4 KB

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