maint: Update HACKING
[automake.git] / t / python-dist.sh
blob6233746b1c0db0555fcabe52b941244045458782
1 #! /bin/sh
2 # Copyright (C) 2011-2017 Free Software Foundation, Inc.
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.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Test distribution of *_PYTHON files.
19 # This test does not require python.
20 . test-init.sh
22 cat >> configure.ac << 'END'
23 AM_PATH_PYTHON([], [:], [:])
24 AC_OUTPUT
25 END
27 cat > Makefile.am << 'END'
28 python_PYTHON = python.py
29 dist_python_PYTHON = python-dist.py
30 nodist_python_PYTHON = python-nodist.py
32 pkgpython_PYTHON = pkgpython.py
33 dist_pkgpython_PYTHON = pkgpython-dist.py
34 nodist_pkgpython_PYTHON = pkgpython-nodist.py
36 mydir = $(prefix)/my
37 my_PYTHON = my.py
38 dist_my_PYTHON = my-dist.py
39 nodist_my_PYTHON = my-nodist.py
41 my.py my-dist.py my-nodist.py:
42 : > $@
44 .PHONY: disttest
45 disttest: distdir
46 ls -l $(distdir)
47 test -f $(distdir)/python.py
48 test -f $(distdir)/python-dist.py
49 test ! -f $(distdir)/python-nodist.py
50 test -f $(distdir)/pkgpython.py
51 test -f $(distdir)/pkgpython-dist.py
52 test ! -f $(distdir)/pkgpython-nodist.py
53 test -f $(distdir)/my.py
54 test -f $(distdir)/my-dist.py
55 test ! -f $(distdir)/my-nodist.py
56 END
58 : > python.py
59 : > python-dist.py
60 : > python-nodist.py
62 : > pkgpython.py
63 : > pkgpython-dist.py
64 : > pkgpython-nodist.py
66 : > py-compile
68 $ACLOCAL
69 $AUTOCONF
70 $AUTOMAKE
72 ./configure
74 $MAKE disttest
75 # It's not distributed, hence it shouldn't be needlessly generated.
76 test ! -e my-nodist.py