meson: tools: generate libvirt-guests.sh script

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-07-27 09:14:24 +02:00
parent 5e3f2ec502
commit 2baf303684
2 changed files with 13 additions and 15 deletions

View File

@ -24,8 +24,6 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir)
confdir = $(sysconfdir)/libvirt
conf_DATA =
libexec_SCRIPTS = libvirt-guests.sh
if WITH_LOGIN_SHELL
conf_DATA += virt-login-shell.conf
endif WITH_LOGIN_SHELL
@ -49,19 +47,6 @@ uninstall-sysconfig:
rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \
-e 's|[@]bindir[@]|$(bindir)|g' \
-e 's|[@]localedir[@]|$(localedir)|g' \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \
chmod a+x $@-t && \
mv $@-t $@
BUILT_SOURCES += libvirt-guests.sh
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
if LIBVIRT_INIT_SCRIPT_SYSTEMD

View File

@ -221,8 +221,12 @@ executable(
)
tools_conf = configuration_data()
tools_conf.set('PACKAGE', meson.project_name())
tools_conf.set('VERSION', meson.project_version())
tools_conf.set('bindir', bindir)
tools_conf.set('localedir', localedir)
tools_conf.set('localstatedir', localstatedir)
tools_conf.set('sbindir', sbindir)
tools_conf.set('schemadir', pkgdatadir / 'schemas')
tools_conf.set('sysconfdir', sysconfdir)
@ -254,3 +258,12 @@ if conf.has('WITH_SANLOCK')
install_mode: 'rwxrwxr-x',
)
endif
configure_file(
input: 'libvirt-guests.sh.in',
output: 'libvirt-guests.sh',
configuration: tools_conf,
install: true,
install_dir: libexecdir,
install_mode: 'rwxrwxr-x',
)