main.aap 2.4 KB

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