python-dist.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #! /bin/sh
  2. # Copyright (C) 2011-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Test distribution of *_PYTHON files.
  17. # This test does not require python.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AM_PATH_PYTHON([], [:], [:])
  21. AC_OUTPUT
  22. END
  23. cat > Makefile.am << 'END'
  24. python_PYTHON = python.py
  25. dist_python_PYTHON = python-dist.py
  26. nodist_python_PYTHON = python-nodist.py
  27. pkgpython_PYTHON = pkgpython.py
  28. dist_pkgpython_PYTHON = pkgpython-dist.py
  29. nodist_pkgpython_PYTHON = pkgpython-nodist.py
  30. mydir = $(prefix)/my
  31. my_PYTHON = my.py
  32. dist_my_PYTHON = my-dist.py
  33. nodist_my_PYTHON = my-nodist.py
  34. my.py my-dist.py my-nodist.py:
  35. : > $@
  36. .PHONY: disttest
  37. disttest: distdir
  38. ls -l $(distdir)
  39. test -f $(distdir)/python.py
  40. test -f $(distdir)/python-dist.py
  41. test ! -f $(distdir)/python-nodist.py
  42. test -f $(distdir)/pkgpython.py
  43. test -f $(distdir)/pkgpython-dist.py
  44. test ! -f $(distdir)/pkgpython-nodist.py
  45. test -f $(distdir)/my.py
  46. test -f $(distdir)/my-dist.py
  47. test ! -f $(distdir)/my-nodist.py
  48. END
  49. : > python.py
  50. : > python-dist.py
  51. : > python-nodist.py
  52. : > pkgpython.py
  53. : > pkgpython-dist.py
  54. : > pkgpython-nodist.py
  55. : > py-compile
  56. $ACLOCAL
  57. $AUTOCONF
  58. $AUTOMAKE
  59. ./configure
  60. $MAKE disttest
  61. # It's not distributed, hence it shouldn't be needlessly generated.
  62. test ! -e my-nodist.py
  63. :