main.aap 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Aap recipe for Dutch 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 = nl_NL.aff nl_NL.dic
  9. all: $SPELLDIR/nl.latin1.spl $SPELLDIR/nl.utf-8.spl ../README_nl.txt
  10. $SPELLDIR/nl.latin1.spl : $FILES
  11. :sys env LANG=nl_NL.ISO8859-1
  12. $VIM -u NONE -e -c "mkspell! $SPELLDIR/nl nl_NL" -c q
  13. $SPELLDIR/nl.utf-8.spl : $FILES
  14. :sys env LANG=nl_NL.UTF-8
  15. $VIM -u NONE -e -c "mkspell! $SPELLDIR/nl nl_NL" -c q
  16. ../README_nl.txt : README_NL.txt README_EN.txt
  17. :cat $source >! $target
  18. #
  19. # Fetching the files from OpenOffice.org.
  20. #
  21. OODIR = http://extensions.services.openoffice.org/e-files/1456/5
  22. :attr {fetch = $OODIR/%file%} nl-dict.oxt
  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. nl_NL.aff nl_NL.dic: {buildcheck=}
  26. :assertpkg unzip patch
  27. :fetch nl-dict.oxt
  28. :sys $UNZIP nl-dict.oxt
  29. :update cleanunused
  30. @if not os.path.exists('nl_NL.orig.aff'):
  31. :copy nl_NL.aff nl_NL.orig.aff
  32. @if not os.path.exists('nl_NL.orig.dic'):
  33. :copy nl_NL.dic nl_NL.orig.dic
  34. @if os.path.exists('nl_NL.diff'):
  35. :sys patch <nl_NL.diff
  36. # Delete all the files unpacked from the archive
  37. clean: cleanunused
  38. :delete {f} nl_NL.dic
  39. :delete {f} nl_NL.aff
  40. :delete {f} README_EN.txt
  41. :delete {f} README_NL.txt
  42. # Delete all the files from the archive that are not used, including the
  43. # archive itself.
  44. cleanunused:
  45. :delete {f} nl-dict.oxt
  46. :delete {f} description.xml
  47. :delete {f} Dictionaries.xcu
  48. :delete {f} hyph_nl_NL.dic
  49. :delete {r}{f} description
  50. :delete {r}{f} images
  51. :delete {r}{f} META-INF
  52. # Generate diff files, so that others can get the OpenOffice files and apply
  53. # the diffs to get the Vim versions.
  54. diff:
  55. :assertpkg diff
  56. :sys {force} diff -a -C 1 nl_NL.orig.aff nl_NL.aff >nl_NL.diff
  57. :sys {force} diff -a -C 1 nl_NL.orig.dic nl_NL.dic >>nl_NL.diff
  58. # Check for updated OpenOffice spell files. When there are changes the
  59. # ".new.aff" and ".new.dic" files are left behind for manual inspection.
  60. # Currently doesn't work.
  61. #check:
  62. # :assertpkg unzip diff
  63. # :fetch nl_NL.zip
  64. # :mkdir tmp
  65. # :cd tmp
  66. # @try:
  67. # @import stat
  68. # :sys $UNZIP ../nl_NL.zip
  69. # :sys {force} diff ../nl_NL.orig.aff nl_NL.aff >d
  70. # @if os.stat('d')[stat.ST_SIZE] > 0:
  71. # :copy nl_NL.aff ../nl_NL.new.aff
  72. # :sys {force} diff ../nl_NL.orig.dic nl_NL.dic >d
  73. # @if os.stat('d')[stat.ST_SIZE] > 0:
  74. # :copy nl_NL.dic ../nl_NL.new.dic
  75. # @finally:
  76. # :cd ..
  77. # :delete {r}{f}{q} tmp
  78. # :delete nl_NL.zip
  79. # vim: set sts=4 sw=4 :