main.aap 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Aap recipe for Polish 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 = pl_PL.aff pl_PL.dic
  9. all: $SPELLDIR/pl.iso-8859-2.spl $SPELLDIR/pl.utf-8.spl \
  10. $SPELLDIR/pl.cp1250.spl ../README_pl.txt
  11. $SPELLDIR/pl.iso-8859-2.spl : $FILES
  12. :sys env LANG=pl_PL.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pl pl_PL" -c q
  13. $SPELLDIR/pl.utf-8.spl : $FILES
  14. :sys env LANG=pl_PL.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/pl pl_PL" -c q
  15. $SPELLDIR/pl.cp1250.spl : $FILES
  16. :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/pl pl_PL" -c q
  17. ../README_pl.txt: README_pl_PL.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%} pl_PL.zip
  24. #
  25. # Fetching the files from
  26. #
  27. HTTPDIR = http://www.kurnik.pl/dictionary
  28. # The files don't depend on the .zip file so that we can delete it.
  29. # Only download the zip file if the targets don't exist.
  30. # This is a bit tricky, since the file name includes the date.
  31. pl_PL.aff pl_PL.dic: {buildcheck=}
  32. :assertpkg tar bunzip2
  33. fname = alt-myspell-pl.tar.bz2
  34. :attr {fetch = $HTTPDIR/%file%} $fname
  35. :fetch $fname
  36. :sys bunzip2 -c $fname | tar xf -
  37. :move alt-myspell-pl-20[0-9]*/* .
  38. :deldir alt-myspell-pl-20[0-9]*
  39. :delete $fname
  40. @if not os.path.exists('pl_PL.orig.aff'):
  41. :copy pl_PL.aff pl_PL.orig.aff
  42. @if not os.path.exists('pl_PL.orig.dic'):
  43. :copy pl_PL.dic pl_PL.orig.dic
  44. @if os.path.exists('pl_PL.diff'):
  45. :sys patch <pl_PL.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 pl_PL.orig.aff pl_PL.aff >pl_PL.diff
  51. :sys {force} diff -a -C 1 pl_PL.orig.dic pl_PL.dic >>pl_PL.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 tar bunzip2 diff
  56. fname = alt-myspell-pl.tar.bz2
  57. :attr {fetch = $HTTPDIR/%file%} $fname
  58. :fetch $fname
  59. :sys bunzip2 -c $fname | tar xf -
  60. :cd alt-myspell-pl-20[0-9]*
  61. @try:
  62. @import stat
  63. :sys $UNZIP ../pl_PL.zip
  64. :sys {force} diff ../pl_PL.orig.aff pl_PL.aff >d
  65. @if os.stat('d')[stat.ST_SIZE] > 0:
  66. :copy pl_PL.aff ../pl_PL.new.aff
  67. :sys {force} diff ../pl_PL.orig.dic pl_PL.dic >d
  68. @if os.stat('d')[stat.ST_SIZE] > 0:
  69. :copy pl_PL.dic ../pl_PL.new.dic
  70. @finally:
  71. :cd ..
  72. :delete {r}{f}{q} $base
  73. :delete $fname
  74. # vim: set sts=4 sw=4 :