nobase-python.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #! /bin/sh
  2. # Copyright (C) 2008-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. # Make sure nobase_* works for python files.
  17. required=python
  18. . test-init.sh
  19. cat >>configure.ac <<EOF
  20. AM_PATH_PYTHON
  21. AC_OUTPUT
  22. EOF
  23. cat > Makefile.am <<'END'
  24. mydir=$(prefix)/my
  25. my_PYTHON = one.py sub/base.py
  26. nobase_my_PYTHON = two.py sub/nobase.py
  27. END
  28. test_install()
  29. {
  30. $MAKE install-data
  31. find inst -print # For debugging.
  32. py_installed inst/my/one.py
  33. py_installed inst/my/one.pyc
  34. py_installed inst/my/two.py
  35. py_installed inst/my/two.pyc
  36. py_installed inst/my/base.py
  37. py_installed inst/my/base.pyc
  38. py_installed inst/my/sub/nobase.py
  39. py_installed inst/my/sub/nobase.pyc
  40. py_installed --not inst/my/nobase.py
  41. py_installed --not inst/my/nobase.pyc
  42. }
  43. test_uninstall()
  44. {
  45. $MAKE uninstall
  46. test -d inst/my
  47. ! find inst/my -type f -print | grep .
  48. }
  49. mkdir sub
  50. for file in one.py sub/base.py two.py sub/nobase.py; do
  51. echo 'def one(): return 1' >$file
  52. done
  53. $ACLOCAL
  54. $AUTOCONF
  55. $AUTOMAKE --add-missing
  56. ./configure --prefix "$(pwd)/inst" --program-prefix=p
  57. $MAKE
  58. test_install
  59. test_uninstall
  60. $MAKE install-strip
  61. test_uninstall
  62. # Likewise, in a VPATH build.
  63. $MAKE distclean
  64. mkdir build
  65. cd build
  66. ../configure --prefix "$(pwd)/inst" --program-prefix=p
  67. test_install
  68. test_uninstall
  69. :