[libvirt PATCH 266/351] meson: tools: install libvirt-guests sysconf file

Pavel Hrdina posted 351 patches 5 years, 6 months ago
There is a newer version of this series
[libvirt PATCH 266/351] meson: tools: install libvirt-guests sysconf file
Posted by Pavel Hrdina 5 years, 6 months ago
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 tools/Makefile.am | 13 ++-----------
 tools/meson.build |  8 ++++++++
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/tools/Makefile.am b/tools/Makefile.am
index 655e22d95ea..9c6c6b3d3c9 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -29,24 +29,15 @@ install-data-local: install-systemd install-nss \
 uninstall-local: uninstall-systemd uninstall-nss \
 	uninstall-bash-completion
 
-install-sysconfig:
-	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
-	$(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
-	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
-
-uninstall-sysconfig:
-	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
-	rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
-
 SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
 
 if LIBVIRT_INIT_SCRIPT_SYSTEMD
-install-systemd: libvirt-guests.service install-sysconfig libvirt-guests.sh
+install-systemd: libvirt-guests.service libvirt-guests.sh
 	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
 	$(INSTALL_DATA) libvirt-guests.service \
 	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
 
-uninstall-systemd: uninstall-sysconfig
+uninstall-systemd:
 	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
 	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||:
 
diff --git a/tools/meson.build b/tools/meson.build
index 446831557e1..b95ced3728b 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -261,3 +261,11 @@ configure_file(
   install: true,
   install_dir: libexecdir,
 )
+
+if init_script == 'systemd'
+  install_data(
+    'libvirt-guests.sysconf',
+    install_dir: sysconfdir / 'sysconfig',
+    rename: 'libvirt-guests',
+  )
+endif
-- 
2.26.2

Re: [libvirt PATCH 266/351] meson: tools: install libvirt-guests sysconf file
Posted by Peter Krempa 5 years, 6 months ago
On Thu, Jul 16, 2020 at 11:58:22 +0200, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>  tools/Makefile.am | 13 ++-----------
>  tools/meson.build |  8 ++++++++
>  2 files changed, 10 insertions(+), 11 deletions(-)

[...]

> diff --git a/tools/meson.build b/tools/meson.build
> index 446831557e1..b95ced3728b 100644
> --- a/tools/meson.build
> +++ b/tools/meson.build
> @@ -261,3 +261,11 @@ configure_file(
>    install: true,
>    install_dir: libexecdir,
>  )
> +
> +if init_script == 'systemd'
> +  install_data(
> +    'libvirt-guests.sysconf',
> +    install_dir: sysconfdir / 'sysconfig',
> +    rename: 'libvirt-guests',
> +  )
> +endif

Arguably it's data at this point as it doesn't need to be modified, but
shouldn't we use the config_file directive for any config file?

Re: [libvirt PATCH 266/351] meson: tools: install libvirt-guests sysconf file
Posted by Pavel Hrdina 5 years, 6 months ago
On Tue, Jul 28, 2020 at 10:32:20AM +0200, Peter Krempa wrote:
> On Thu, Jul 16, 2020 at 11:58:22 +0200, Pavel Hrdina wrote:
> > Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> > ---
> >  tools/Makefile.am | 13 ++-----------
> >  tools/meson.build |  8 ++++++++
> >  2 files changed, 10 insertions(+), 11 deletions(-)
> 
> [...]
> 
> > diff --git a/tools/meson.build b/tools/meson.build
> > index 446831557e1..b95ced3728b 100644
> > --- a/tools/meson.build
> > +++ b/tools/meson.build
> > @@ -261,3 +261,11 @@ configure_file(
> >    install: true,
> >    install_dir: libexecdir,
> >  )
> > +
> > +if init_script == 'systemd'
> > +  install_data(
> > +    'libvirt-guests.sysconf',
> > +    install_dir: sysconfdir / 'sysconfig',
> > +    rename: 'libvirt-guests',
> > +  )
> > +endif
> 
> Arguably it's data at this point as it doesn't need to be modified, but
> shouldn't we use the config_file directive for any config file?

If by 'config_file' you mean 'configure_file' I don't think so. There is
no need to copy it into build directory, it just needs to be installed.

Pavel