This uses meson to install the example data files and example
program source.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Makefile.am | 2 +-
examples/Makefile.am | 83 --------------------------------
examples/c/admin/meson.build | 8 +++
examples/c/domain/meson.build | 6 +++
examples/c/misc/meson.build | 4 ++
examples/meson.build | 4 ++
examples/polkit/meson.build | 5 ++
examples/sh/meson.build | 5 ++
examples/systemtap/meson.build | 8 +++
examples/xml/meson.build | 3 ++
examples/xml/storage/meson.build | 14 ++++++
examples/xml/test/meson.build | 13 +++++
12 files changed, 71 insertions(+), 84 deletions(-)
delete mode 100644 examples/Makefile.am
create mode 100644 examples/polkit/meson.build
create mode 100644 examples/sh/meson.build
create mode 100644 examples/systemtap/meson.build
create mode 100644 examples/xml/meson.build
create mode 100644 examples/xml/storage/meson.build
create mode 100644 examples/xml/test/meson.build
diff --git a/Makefile.am b/Makefile.am
index 711f365504..bf043c5362 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,7 +20,7 @@ LCOV = lcov
GENHTML = genhtml
SUBDIRS = . gnulib/lib include/libvirt src tools docs gnulib/tests \
- tests po examples
+ tests po
XZ_OPT ?= -v -T0
export XZ_OPT
diff --git a/examples/Makefile.am b/examples/Makefile.am
deleted file mode 100644
index b12652874f..0000000000
--- a/examples/Makefile.am
+++ /dev/null
@@ -1,83 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-## Copyright (C) 2005-2016 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library. If not, see
-## <
http://www.gnu.org/licenses/>.
-
-ADMIN_EXAMPLES = \
- $(wildcard $(srcdir)/c/admin/*.c) \
- $(NULL)
-
-DOMAIN_EXAMPLES = \
- $(wildcard $(srcdir)/c/domain/*.c) \
- $(NULL)
-
-MISC_EXAMPLES = \
- $(wildcard $(srcdir)/c/misc/*.c) \
- $(NULL)
-
-POLKIT_EXAMPLES = \
- $(wildcard $(srcdir)/polkit/*.rules) \
- $(NULL)
-
-SH_EXAMPLES = \
- $(wildcard $(srcdir)/sh/*) \
- $(NULL)
-
-STORAGE_XML_EXAMPLES = \
- $(wildcard $(srcdir)/xml/storage/*.xml) \
- $(NULL)
-
-SYSTEMTAP_EXAMPLES = \
- $(wildcard $(srcdir)/systemtap/*.stp) \
- $(NULL)
-
-TEST_XML_EXAMPLES = \
- $(wildcard $(srcdir)/xml/test/*.xml) \
- $(NULL)
-
-EXTRA_DIST = \
- $(POLKIT_EXAMPLES) \
- $(SH_EXAMPLES) \
- $(STORAGE_XML_EXAMPLES) \
- $(SYSTEMTAP_EXAMPLES) \
- $(TEST_XML_EXAMPLES) \
- $(NULL)
-
-examplesdir = $(docdir)/examples
-
-adminexamplesdir = $(examplesdir)/c/admin
-adminexamples_DATA = $(ADMIN_EXAMPLES)
-
-domainexamplesdir = $(examplesdir)/c/domain
-domainexamples_DATA = $(DOMAIN_EXAMPLES)
-
-miscexamplesdir = $(examplesdir)/c/misc
-miscexamples_DATA = $(MISC_EXAMPLES)
-
-polkitexamplesdir = $(examplesdir)/polkit
-polkitexamples_DATA = $(POLKIT_EXAMPLES)
-
-shexamplesdir = $(examplesdir)/sh
-shexamples_DATA = $(SH_EXAMPLES)
-
-storagexmlexamplesdir = $(examplesdir)/xml/storage
-storagexmlexamples_DATA = $(STORAGE_XML_EXAMPLES)
-
-systemtapexamplesdir = $(examplesdir)/systemtap
-systemtapexamples_DATA = $(SYSTEMTAP_EXAMPLES)
-
-testxmlexamplesdir = $(examplesdir)/xml/test
-testxmlexamples_DATA = $(TEST_XML_EXAMPLES)
diff --git a/examples/c/admin/meson.build b/examples/c/admin/meson.build
index bdec5fd22e..3fb6b3f7db 100644
--- a/examples/c/admin/meson.build
+++ b/examples/c/admin/meson.build
@@ -1,4 +1,5 @@
+examples_admin_dir = examples_dir / 'c' / 'admin'
examples_admin_deps = [libvirt_dep, libvirt_admin_dep]
client_close_src = ['client_close.c']
@@ -7,6 +8,7 @@ client_close = executable(
client_close_src,
dependencies: examples_admin_deps
)
+install_data(client_close_src, install_dir: examples_admin_dir)
client_info_src = ['client_info.c']
client_info = executable(
@@ -14,6 +16,7 @@ client_info = executable(
client_info_src,
dependencies: examples_admin_deps
)
+install_data(client_info_src, install_dir: examples_admin_dir)
client_limits_src = ['client_limits.c']
client_limits = executable(
@@ -21,6 +24,7 @@ client_limits = executable(
client_limits_src,
dependencies: examples_admin_deps
)
+install_data(client_limits_src, install_dir: examples_admin_dir)
list_clients_src = ['list_clients.c']
list_clients = executable(
@@ -28,6 +32,7 @@ list_clients = executable(
list_clients_src,
dependencies: examples_admin_deps
)
+install_data(list_clients_src, install_dir: examples_admin_dir)
list_server_src = ['list_servers.c']
list_servers = executable(
@@ -35,6 +40,7 @@ list_servers = executable(
list_server_src,
dependencies: examples_admin_deps
)
+install_data(list_server_src, install_dir: examples_admin_dir)
logging_src = ['logging.c']
logging = executable(
@@ -42,6 +48,7 @@ logging = executable(
logging_src,
dependencies: examples_admin_deps
)
+install_data(logging_src, install_dir: examples_admin_dir)
threadpool_params_src = ['threadpool_params.c']
threadpool_params = executable(
@@ -49,3 +56,4 @@ threadpool_params = executable(
threadpool_params_src,
dependencies: examples_admin_deps
)
+install_data(threadpool_params_src, install_dir: examples_admin_dir)
diff --git a/examples/c/domain/meson.build b/examples/c/domain/meson.build
index 8e9336b150..d3d9a5a029 100644
--- a/examples/c/domain/meson.build
+++ b/examples/c/domain/meson.build
@@ -1,4 +1,5 @@
+examples_domain_dir = examples_dir / 'c' / 'domain'
examples_domain_deps = [libvirt_dep]
dommigrate_src = ['dommigrate.c']
@@ -7,6 +8,7 @@ dommigrate = executable(
dommigrate_src,
dependencies: examples_domain_deps
)
+install_data(dommigrate_src, install_dir: examples_domain_dir)
domtop_src = ['domtop.c']
domtop = executable(
@@ -14,6 +16,7 @@ domtop = executable(
domtop_src,
dependencies: examples_domain_deps
)
+install_data(domtop_src, install_dir: examples_domain_dir)
info1_src = ['info1.c']
info1 = executable(
@@ -21,6 +24,7 @@ info1 = executable(
info1_src,
dependencies: examples_domain_deps
)
+install_data(info1_src, install_dir: examples_domain_dir)
rename_src = ['rename.c']
rename = executable(
@@ -28,6 +32,7 @@ rename = executable(
rename_src,
dependencies: examples_domain_deps
)
+install_data(rename_src, install_dir: examples_domain_dir)
suspend_src = ['suspend.c']
suspend = executable(
@@ -35,3 +40,4 @@ suspend = executable(
suspend_src,
dependencies: examples_domain_deps
)
+install_data(suspend_src, install_dir: examples_domain_dir)
diff --git a/examples/c/misc/meson.build b/examples/c/misc/meson.build
index 397258170f..2a77c526f7 100644
--- a/examples/c/misc/meson.build
+++ b/examples/c/misc/meson.build
@@ -1,4 +1,5 @@
+examples_misc_dir = examples_dir / 'c' / 'misc'
examples_misc_deps = [libvirt_dep]
hellolibvirt_src = ['hellolibvirt.c']
@@ -7,6 +8,7 @@ hellolibvirt = executable(
hellolibvirt_src,
dependencies: examples_misc_deps
)
+install_data(hellolibvirt_src, install_dir: examples_misc_dir)
eventtest_src = ['event-test.c']
eventtest = executable(
@@ -14,6 +16,7 @@ eventtest = executable(
eventtest_src,
dependencies: examples_misc_deps
)
+install_data(eventtest_src, install_dir: examples_misc_dir)
openauth_src = ['openauth.c']
openauth = executable(
@@ -21,3 +24,4 @@ openauth = executable(
openauth_src,
dependencies: examples_misc_deps
)
+install_data(openauth_src, install_dir: examples_misc_dir)
diff --git a/examples/meson.build b/examples/meson.build
index bb757e92a0..36faf5abec 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -1,2 +1,6 @@
+examples_dir = join_paths(pkg_doc_dir, 'examples')
+
subdir('c')
+subdir('polkit')
+subdir('sh')
diff --git a/examples/polkit/meson.build b/examples/polkit/meson.build
new file mode 100644
index 0000000000..759f565e3a
--- /dev/null
+++ b/examples/polkit/meson.build
@@ -0,0 +1,5 @@
+
+examples_polkit_dir = examples_dir / 'polkit'
+
+polkit_rules = ['libvirt-acl.rules']
+install_data(polkit_rules, install_dir: examples_polkit_dir)
diff --git a/examples/sh/meson.build b/examples/sh/meson.build
new file mode 100644
index 0000000000..3f43da2e02
--- /dev/null
+++ b/examples/sh/meson.build
@@ -0,0 +1,5 @@
+
+examples_sh_dir = examples_dir / 'sh'
+
+sh_scripts = ['virt-lxc-convert']
+install_data(sh_scripts, install_dir: examples_sh_dir)
diff --git a/examples/systemtap/meson.build b/examples/systemtap/meson.build
new file mode 100644
index 0000000000..023e6be7ed
--- /dev/null
+++ b/examples/systemtap/meson.build
@@ -0,0 +1,8 @@
+
+examples_systemtap_dir = examples_dir / 'systemtap'
+
+systemtap_scripts = ['events.stp',
+ 'lock-debug.stp',
+ 'qemu-monitor.stp',
+ 'rpc-monitor.stp']
+install_data(systemtap_scripts, install_dir: examples_systemtap_dir)
diff --git a/examples/xml/meson.build b/examples/xml/meson.build
new file mode 100644
index 0000000000..d37508121e
--- /dev/null
+++ b/examples/xml/meson.build
@@ -0,0 +1,3 @@
+
+subdir('storage')
+subdir('test')
diff --git a/examples/xml/storage/meson.build b/examples/xml/storage/meson.build
new file mode 100644
index 0000000000..3e78086c67
--- /dev/null
+++ b/examples/xml/storage/meson.build
@@ -0,0 +1,14 @@
+
+examples_xml_storage_dir = examples_dir / 'xml' / 'storage'
+
+storage_xml = ['pool-dir.xml',
+ 'pool-logical.xml',
+ 'vol-cow.xml',
+ 'vol-qcow.xml',
+ 'vol-sparse.xml',
+ 'pool-fs.xml',
+ 'pool-netfs.xml',
+ 'vol-qcow2.xml',
+ 'vol-raw.xml',
+ 'vol-vmdk.xml']
+install_data(storage_xml, install_dir: examples_xml_storage_dir)
diff --git a/examples/xml/test/meson.build b/examples/xml/test/meson.build
new file mode 100644
index 0000000000..31c5e38bc1
--- /dev/null
+++ b/examples/xml/test/meson.build
@@ -0,0 +1,13 @@
+
+examples_xml_test_dir = examples_dir / 'xml' / 'test'
+
+test_xml = ['testdomfc4.xml',
+ 'testnetdef.xml',
+ 'testnodeinline.xml',
+ 'testpool.xml',
+ 'testdev.xml',
+ 'testdomfv0.xml',
+ 'testnetpriv.xml',
+ 'testnode.xml',
+ 'testvol.xml']
+install_data(test_xml, install_dir: examples_xml_test_dir)
--
2.21.0