python: Fix "make install" on systems without Python.
[sliver-openvswitch.git] / python / ovs / automake.mk
1 run_python = PYTHONPATH=$(top_srcdir)/python:$$PYTHON_PATH $(PYTHON)
2
3 ovs_pyfiles = \
4         python/ovs/__init__.py \
5         python/ovs/daemon.py \
6         python/ovs/db/__init__.py \
7         python/ovs/db/data.py \
8         python/ovs/db/error.py \
9         python/ovs/db/idl.py \
10         python/ovs/db/parser.py \
11         python/ovs/db/schema.py \
12         python/ovs/db/types.py \
13         python/ovs/fatal_signal.py \
14         python/ovs/json.py \
15         python/ovs/jsonrpc.py \
16         python/ovs/ovsuuid.py \
17         python/ovs/poller.py \
18         python/ovs/process.py \
19         python/ovs/reconnect.py \
20         python/ovs/socket_util.py \
21         python/ovs/stream.py \
22         python/ovs/timeval.py \
23         python/ovs/util.py
24 EXTRA_DIST += $(ovs_pyfiles) python/ovs/dirs.py
25
26 if HAVE_PYTHON
27 nobase_pkgdata_DATA = $(ovs_pyfiles)
28 ovs-install-data-local:
29         $(MKDIR_P) python/ovs
30         (echo "import os" && \
31          echo 'PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """$(pkgdatadir)""")' && \
32          echo 'RUNDIR = os.environ.get("OVS_RUNDIR", """@RUNDIR@""")' && \
33          echo 'LOGDIR = os.environ.get("OVS_LOGDIR", """@LOGDIR@""")' && \
34          echo 'BINDIR = os.environ.get("OVS_BINDIR", """$(bindir)""")') \
35                 > python/ovs/dirs.py.tmp
36         $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs
37         $(INSTALL_DATA) python/ovs/dirs.py.tmp $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
38         rm python/ovs/dirs.py.tmp
39 else
40 ovs-install-data-local:
41         @:
42 endif
43 install-data-local: ovs-install-data-local
44
45 uninstall-local: ovs-uninstall-local
46 ovs-uninstall-local:
47         rm -f $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py