main.aap 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Aap recipe for Romanian 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 = ro_RO.aff ro_RO.dic
  9. all: $SPELLDIR/ro.utf-8.spl \
  10. $SPELLDIR/ro.iso-8859-2.spl \
  11. $SPELLDIR/ro.cp1250.spl \
  12. ../README_ro.txt
  13. $SPELLDIR/ro.utf-8.spl : $FILES
  14. :sys env LANG=ro_RO.utf8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
  15. # Note: this generates conversion errors, because not all characters can be
  16. # represented in iso-8859-2.
  17. $SPELLDIR/ro.iso-8859-2.spl : $FILES
  18. :sys env LANG=ro_RO.iso88592 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
  19. # Note: this generates conversion errors, because not all characters can be
  20. # represented in cp1250.
  21. $SPELLDIR/ro.cp1250.spl : $FILES
  22. :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/ro ro_RO" -c q
  23. ../README_ro.txt: README
  24. :copy $source $target
  25. #
  26. # Fetching the files from OpenOffice.org.
  27. #
  28. #OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
  29. OODIR = http://sourceforge.net/projects/rospell/files/Romanian%20dictionaries/dict-3.3.10
  30. ZIPFILE = ro_RO.3.3.10.zip
  31. :attr {fetch = $OODIR/%file%} $ZIPFILE
  32. # The files don't depend on the .zip file so that we can delete it.
  33. # Only download the zip file if the targets don't exist.
  34. # This is a bit tricky, since the file name includes the date.
  35. ro_RO.aff ro_RO.dic: {buildcheck=}
  36. :assertpkg unzip patch
  37. :fetch $ZIPFILE
  38. :sys $UNZIP $ZIPFILE
  39. :delete $ZIPFILE
  40. @if not os.path.exists('ro_RO.orig.aff'):
  41. :copy ro_RO.aff ro_RO.orig.aff
  42. @if not os.path.exists('ro_RO.orig.dic'):
  43. :copy ro_RO.dic ro_RO.orig.dic
  44. @if os.path.exists('ro_RO.diff'):
  45. :sys patch <ro_RO.diff
  46. # Generate diff files, so that others can get the OpenOffice files and apply
  47. # the diffs to get the Vim versions.
  48. diff:
  49. :assertpkg diff
  50. :sys {force} diff -a -C 1 ro_RO.orig.aff ro_RO.aff >ro_RO.diff
  51. :sys {force} diff -a -C 1 ro_RO.orig.dic ro_RO.dic >>ro_RO.diff
  52. # Check for updated spell files. When there are changes the
  53. # ".new.aff" and ".new.dic" files are left behind for manual inspection.
  54. check:
  55. :assertpkg unzip diff
  56. :fetch $ZIPFILE
  57. :mkdir tmp
  58. :cd tmp
  59. @try:
  60. @import stat
  61. :sys $UNZIP ../$ZIPFILE
  62. :sys {force} diff ../ro_RO.orig.aff ro_RO.aff >d
  63. @if os.stat('d')[stat.ST_SIZE] > 0:
  64. :copy ro_RO.aff ../ro_RO.new.aff
  65. :sys {force} diff ../ro_RO.orig.dic ro_RO.dic >d
  66. @if os.stat('d')[stat.ST_SIZE] > 0:
  67. :copy ro_RO.dic ../ro_RO.new.dic
  68. @finally:
  69. :cd ..
  70. :delete {r}{f}{q} tmp
  71. :delete $ZIPFILE
  72. # Remove all the downloaded and generated files.
  73. clean:
  74. :delete ro_RO.aff
  75. :delete ro_RO.dic
  76. :delete ro_RO.orig.aff
  77. :delete ro_RO.orig.dic
  78. :delete ro_RO-ante1993.aff
  79. :delete ro_RO-ante1993.dic
  80. :delete COPYING.GPL
  81. :delete COPYING.LGPL
  82. :delete COPYING.MPL
  83. :delete README
  84. # vim: set sts=4 sw=4 :