Make the location of the database separately configurable.
[sliver-openvswitch.git] / python / automake.mk
1 ovstest_pyfiles = \
2         python/ovstest/__init__.py \
3         python/ovstest/args.py \
4         python/ovstest/rpcserver.py \
5         python/ovstest/tcp.py \
6         python/ovstest/tests.py \
7         python/ovstest/udp.py \
8         python/ovstest/util.py \
9         python/ovstest/vswitch.py
10
11 ovs_pyfiles = \
12         python/ovs/__init__.py \
13         python/ovs/daemon.py \
14         python/ovs/db/__init__.py \
15         python/ovs/db/data.py \
16         python/ovs/db/error.py \
17         python/ovs/db/idl.py \
18         python/ovs/db/parser.py \
19         python/ovs/db/schema.py \
20         python/ovs/db/types.py \
21         python/ovs/fatal_signal.py \
22         python/ovs/json.py \
23         python/ovs/jsonrpc.py \
24         python/ovs/ovsuuid.py \
25         python/ovs/poller.py \
26         python/ovs/process.py \
27         python/ovs/reconnect.py \
28         python/ovs/socket_util.py \
29         python/ovs/stream.py \
30         python/ovs/timeval.py \
31         python/ovs/unixctl/__init__.py \
32         python/ovs/unixctl/client.py \
33         python/ovs/unixctl/server.py \
34         python/ovs/util.py \
35         python/ovs/version.py \
36         python/ovs/vlog.py
37
38 PYFILES = $(ovs_pyfiles) python/ovs/dirs.py $(ovstest_pyfiles)
39 EXTRA_DIST += $(PYFILES)
40 PYCOV_CLEAN_FILES += $(PYFILES:.py=.py,cover)
41
42 if HAVE_PYTHON
43 nobase_pkgdata_DATA = $(ovs_pyfiles) $(ovstest_pyfiles)
44 ovs-install-data-local:
45         $(MKDIR_P) python/ovs
46         (echo "import os" && \
47          echo 'PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """$(pkgdatadir)""")' && \
48          echo 'RUNDIR = os.environ.get("OVS_RUNDIR", """@RUNDIR@""")' && \
49          echo 'LOGDIR = os.environ.get("OVS_LOGDIR", """@LOGDIR@""")' && \
50          echo 'DBDIR = os.environ.get("OVS_DBDIR", """@DBDIR@""")' && \
51          echo 'BINDIR = os.environ.get("OVS_BINDIR", """$(bindir)""")') \
52                 > python/ovs/dirs.py.tmp
53         $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs
54         $(INSTALL_DATA) python/ovs/dirs.py.tmp $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
55         rm python/ovs/dirs.py.tmp
56 else
57 ovs-install-data-local:
58         @:
59 endif
60 install-data-local: ovs-install-data-local
61
62 UNINSTALL_LOCAL += ovs-uninstall-local
63 ovs-uninstall-local:
64         rm -f $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
65
66 ALL_LOCAL += $(srcdir)/python/ovs/version.py
67 $(srcdir)/python/ovs/version.py: config.status
68         $(ro_shell) > $(@F).tmp
69         echo 'VERSION = "$(VERSION)"' >> $(@F).tmp
70         if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi