main.aap 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Aap recipe for Faroese 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 = fo_FO.aff fo_FO.dic
  9. all: $SPELLDIR/fo.latin1.spl $SPELLDIR/fo.utf-8.spl ../README_fo.txt
  10. $SPELLDIR/fo.latin1.spl : $FILES
  11. :sys env LANG=fo_FO.ISO8859-1
  12. $VIM -u NONE -e -c "mkspell! $SPELLDIR/fo fo_FO" -c q
  13. $SPELLDIR/fo.utf-8.spl : $FILES
  14. :sys $VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/fo fo_FO" -c q
  15. ../README_fo.txt : README_fo_FO.txt Copyright
  16. :cat $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%} fo_FO.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. fo_FO.aff fo_FO.dic: {buildcheck=}
  25. :assertpkg unzip patch
  26. :fetch fo_FO.zip
  27. :sys $UNZIP fo_FO.zip
  28. :delete fo_FO.zip
  29. :delete contributors fo_FO.excluded Makefile COPYING
  30. @if not os.path.exists('fo_FO.orig.aff'):
  31. :copy fo_FO.aff fo_FO.orig.aff
  32. @if not os.path.exists('fo_FO.orig.dic'):
  33. :copy fo_FO.dic fo_FO.orig.dic
  34. @if os.path.exists('fo_FO.diff'):
  35. :sys patch <fo_FO.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 fo_FO.orig.aff fo_FO.aff >fo_FO.diff
  41. :sys {force} diff -a -C 1 fo_FO.orig.dic fo_FO.dic >>fo_FO.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 fo_FO.zip
  47. :mkdir tmp
  48. :cd tmp
  49. @try:
  50. @import stat
  51. :sys $UNZIP ../fo_FO.zip
  52. :sys {force} diff ../fo_FO.orig.aff fo_FO.aff >d
  53. @if os.stat('d')[stat.ST_SIZE] > 0:
  54. :copy fo_FO.aff ../fo_FO.new.aff
  55. :sys {force} diff ../fo_FO.orig.dic fo_FO.dic >d
  56. @if os.stat('d')[stat.ST_SIZE] > 0:
  57. :copy fo_FO.dic ../fo_FO.new.dic
  58. @finally:
  59. :cd ..
  60. :delete {r}{f}{q} tmp
  61. :delete fo_FO.zip
  62. # vim: set sts=4 sw=4 :