]> git.proxmox.com Git - mirror_ovs.git/blob - python/automake.mk
Test the Python C JSON extension
[mirror_ovs.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/compat/__init__.py \
14 python/ovs/compat/sortedcontainers/__init__.py \
15 python/ovs/compat/sortedcontainers/sortedlist.py \
16 python/ovs/compat/sortedcontainers/sorteddict.py \
17 python/ovs/compat/sortedcontainers/sortedset.py \
18 python/ovs/daemon.py \
19 python/ovs/fcntl_win.py \
20 python/ovs/db/__init__.py \
21 python/ovs/db/custom_index.py \
22 python/ovs/db/data.py \
23 python/ovs/db/error.py \
24 python/ovs/db/idl.py \
25 python/ovs/db/parser.py \
26 python/ovs/db/schema.py \
27 python/ovs/db/types.py \
28 python/ovs/fatal_signal.py \
29 python/ovs/json.py \
30 python/ovs/jsonrpc.py \
31 python/ovs/ovsuuid.py \
32 python/ovs/poller.py \
33 python/ovs/process.py \
34 python/ovs/reconnect.py \
35 python/ovs/socket_util.py \
36 python/ovs/stream.py \
37 python/ovs/timeval.py \
38 python/ovs/unixctl/__init__.py \
39 python/ovs/unixctl/client.py \
40 python/ovs/unixctl/server.py \
41 python/ovs/util.py \
42 python/ovs/version.py \
43 python/ovs/vlog.py \
44 python/ovs/winutils.py
45 # These python files are used at build time but not runtime,
46 # so they are not installed.
47 EXTRA_DIST += \
48 python/build/__init__.py \
49 python/build/nroff.py \
50 python/build/soutil.py
51
52 # PyPI support.
53 EXTRA_DIST += \
54 python/ovs/compat/sortedcontainers/LICENSE \
55 python/README.rst \
56 python/setup.py
57
58 # C extension support.
59 EXTRA_DIST += python/ovs/_json.c
60
61 PYFILES = $(ovs_pyfiles) python/ovs/dirs.py $(ovstest_pyfiles)
62 EXTRA_DIST += $(PYFILES)
63 PYCOV_CLEAN_FILES += $(PYFILES:.py=.py,cover)
64
65 FLAKE8_PYFILES += \
66 $(filter-out python/ovs/compat/% python/ovs/dirs.py,$(PYFILES)) \
67 python/setup.py \
68 python/build/__init__.py \
69 python/build/nroff.py \
70 python/ovs/dirs.py.template
71
72 if HAVE_PYTHON
73 nobase_pkgdata_DATA = $(ovs_pyfiles) $(ovstest_pyfiles)
74 ovs-install-data-local:
75 $(MKDIR_P) python/ovs
76 sed \
77 -e '/^##/d' \
78 -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
79 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
80 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
81 -e 's,[@]bindir[@],$(bindir),g' \
82 -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
83 -e 's,[@]DBDIR[@],$(DBDIR),g' \
84 < $(srcdir)/python/ovs/dirs.py.template \
85 > python/ovs/dirs.py.tmp
86 $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs
87 $(INSTALL_DATA) python/ovs/dirs.py.tmp $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
88 rm python/ovs/dirs.py.tmp
89
90 python-sdist: $(srcdir)/python/ovs/version.py $(ovs_pyfiles) python/ovs/dirs.py
91 (cd python/ && $(PYTHON) setup.py sdist)
92
93 pypi-upload: $(srcdir)/python/ovs/version.py $(ovs_pyfiles) python/ovs/dirs.py
94 (cd python/ && $(PYTHON) setup.py sdist upload)
95
96 ALL_LOCAL += python-build
97 python-build:$(lib_LTLIBRARIES)
98 (cd $(srcdir)/python/ && $(PYTHON) setup.py build_py -d $(abs_top_builddir)/python && $(PYTHON) setup.py build_ext -b $(abs_top_builddir)/python -I$(abs_top_srcdir)/include:$(abs_top_builddir)/include -L$(abs_top_builddir)/lib/.libs)
99 if HAVE_PYTHON3
100 (cd $(srcdir)/python/ && $(PYTHON3) setup.py build_py -d $(abs_top_builddir)/python && $(PYTHON3) setup.py build_ext -b $(abs_top_builddir)/python -I$(abs_top_srcdir)/include:$(abs_top_builddir)/include -L$(abs_top_builddir)/lib/.libs)
101
102 CLEAN_LOCAL += python-clean
103 python-clean:
104 rm -rf $(abs_top_builddir)/python
105 endif
106 else
107 ovs-install-data-local:
108 @:
109 endif
110 install-data-local: ovs-install-data-local
111
112 UNINSTALL_LOCAL += ovs-uninstall-local
113 ovs-uninstall-local:
114 rm -f $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
115
116 ALL_LOCAL += $(srcdir)/python/ovs/version.py
117 $(srcdir)/python/ovs/version.py: config.status
118 $(AM_V_GEN)$(ro_shell) > $(@F).tmp && \
119 echo 'VERSION = "$(VERSION)"' >> $(@F).tmp && \
120 if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi
121
122 ALL_LOCAL += $(srcdir)/python/ovs/dirs.py
123 $(srcdir)/python/ovs/dirs.py: python/ovs/dirs.py.template
124 $(AM_V_GEN)sed \
125 -e '/^##/d' \
126 -e 's,[@]pkgdatadir[@],/usr/local/share/openvswitch,g' \
127 -e 's,[@]RUNDIR[@],/var/run,g' \
128 -e 's,[@]LOGDIR[@],/usr/local/var/log,g' \
129 -e 's,[@]bindir[@],/usr/local/bin,g' \
130 -e 's,[@]sysconfdir[@],/usr/local/etc,g' \
131 -e 's,[@]DBDIR[@],/usr/local/etc/openvswitch,g' \
132 < $? > $@.tmp && \
133 mv $@.tmp $@
134 EXTRA_DIST += python/ovs/dirs.py.template