[libvirt PATCH 229/351] meson: src: install empty directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 scripts/install-dirs.sh     |  5 +++++
 scripts/meson.build         |  1 +
 src/Makefile.am             |  9 ---------
 src/libxl/Makefile.inc.am   | 16 ----------------
 src/libxl/meson.build       |  6 ++++++
 src/locking/Makefile.inc.am | 24 ------------------------
 src/locking/meson.build     | 12 ++++++++++++
 src/lxc/Makefile.inc.am     | 17 -----------------
 src/lxc/meson.build         |  6 ++++++
 src/meson.build             | 16 ++++++++++++++++
 src/network/Makefile.inc.am |  5 -----
 src/network/meson.build     |  6 ++++++
 src/qemu/Makefile.inc.am    | 29 -----------------------------
 src/qemu/meson.build        | 10 ++++++++++
 src/remote/Makefile.inc.am  | 13 -------------
 src/remote/meson.build      |  4 ++++
 16 files changed, 66 insertions(+), 113 deletions(-)
 create mode 100644 scripts/install-dirs.sh

diff --git a/scripts/install-dirs.sh b/scripts/install-dirs.sh
new file mode 100644
index 00000000000..27558d53fe9
--- /dev/null
+++ b/scripts/install-dirs.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+for dir in "$@"; do
+    mkdir -p $DESTDIR/$dir
+done
diff --git a/scripts/meson.build b/scripts/meson.build
index 0d2e48c3a36..8e4f16349e5 100644
--- a/scripts/meson.build
+++ b/scripts/meson.build
@@ -20,6 +20,7 @@ scripts = [
   'header-ifdef.py',
   'hvsupport.py',
   'hyperv_wmi_generator.py',
+  'install-dirs.sh',
   'meson-python.sh',
   'mock-noinline.py',
   'prohibit-duplicate-header.py',
diff --git a/src/Makefile.am b/src/Makefile.am
index c403a1d6b33..894ec5162a3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -227,15 +227,6 @@ endif WITH_LIBVIRTD
 
 install-data-local: $(INSTALL_DATA_LOCAL) \
 		$(INSTALL_DATA_DIRS:%=install-data-%)
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
 
 uninstall-local: $(UNINSTALL_LOCAL) \
 		$(INSTALL_DATA_DIRS:%=uninstall-data-%)
-	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am
index 0031adb2ef3..5af19c83512 100644
--- a/src/libxl/Makefile.inc.am
+++ b/src/libxl/Makefile.inc.am
@@ -2,19 +2,3 @@
 
 DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES))
 STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES))
-
-if WITH_LIBXL
-
-INSTALL_DATA_DIRS += libxl
-
-install-data-libxl:
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
-	$(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/libxl"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
-
-uninstall-data-libxl:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
-	rmdir "$(DESTDIR)$(runstatedir)/libvirt/libxl" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
-
-endif WITH_LIBXL
diff --git a/src/libxl/meson.build b/src/libxl/meson.build
index 722a001e079..a5df0011b0b 100644
--- a/src/libxl/meson.build
+++ b/src/libxl/meson.build
@@ -77,4 +77,10 @@ if conf.has('WITH_LIBXL')
     'name': 'virtxend',
     'file': files('virtxend.sysconf'),
   }
+
+  virt_install_dirs += [
+    localstatedir / 'lib' / 'libvirt' / 'libxl',
+    runstatedir / 'libvirt' / 'libxl',
+    localstatedir / 'log' / 'libvirt' / 'libxl',
+  ]
 endif
diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am
index 02ce2fa7a77..285e73a6bf4 100644
--- a/src/locking/Makefile.inc.am
+++ b/src/locking/Makefile.inc.am
@@ -1,27 +1,3 @@
 # vim: filetype=automake
 
 RPC_PROBE_FILES += $(srcdir)/locking/lock_protocol.x
-
-INSTALL_DATA_DIRS += locking
-
-install-data-locking:
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
-	$(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/lockd"
-if WITH_SANLOCK
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
-endif WITH_SANLOCK
-
-uninstall-data-locking:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
-	rmdir "$(DESTDIR)$(runstatedir)/libvirt/lockd" ||:
-if WITH_SANLOCK
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
-endif WITH_SANLOCK
-endif WITH_LIBVIRTD
-
-.PHONY: \
-	install-data-locking \
-	uninstall-data-locking \
-	$(NULL)
diff --git a/src/locking/meson.build b/src/locking/meson.build
index 1d42682d608..dbff78ca1bb 100644
--- a/src/locking/meson.build
+++ b/src/locking/meson.build
@@ -225,4 +225,16 @@ if conf.has('WITH_LIBVIRTD')
     'aug': files('test_virtlockd.aug.in'),
     'conf': files('virtlockd.conf'),
   }
+
+  virt_install_dirs += [
+    localstatedir / 'lib' / 'libvirt' / 'lockd',
+    localstatedir / 'lib' / 'libvirt' / 'lockd' / 'files',
+    runstatedir / 'libvirt' / 'lockd',
+  ]
+
+  if conf.has('WITH_SANLOCK')
+    virt_install_dirs += [
+      localstatedir / 'lib' / 'libvirt' / 'sanlock',
+    ]
+  endif
 endif
diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am
index f65b1cdf6b9..7f312975d6c 100644
--- a/src/lxc/Makefile.inc.am
+++ b/src/lxc/Makefile.inc.am
@@ -15,21 +15,4 @@ if WITH_DTRACE_PROBES
 RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x
 endif
 
-INSTALL_DATA_DIRS += lxc
-
-install-data-lxc:
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
-	$(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/lxc"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/lxc"
-
-uninstall-data-lxc:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
-	rmdir "$(DESTDIR)$(runstatedir)/libvirt/lxc" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/lxc" ||:
-
 endif WITH_LXC
-
-.PHONY: \
-	install-data-lxc \
-	uninstall-data-lxc \
-	$(NULL)
diff --git a/src/lxc/meson.build b/src/lxc/meson.build
index bcb5798dbc7..ccb11ee1d42 100644
--- a/src/lxc/meson.build
+++ b/src/lxc/meson.build
@@ -160,4 +160,10 @@ if conf.has('WITH_LXC')
     'name': 'virtlxcd',
     'file': files('virtlxcd.sysconf'),
   }
+
+  virt_install_dirs += [
+    localstatedir / 'lib' / 'libvirt' / 'lxc',
+    runstatedir / 'libvirt' / 'lxc',
+    localstatedir / 'log' / 'libvirt' / 'lxc',
+  ]
 endif
diff --git a/src/meson.build b/src/meson.build
index 7d1b9714218..b8e356d8b0e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -203,6 +203,10 @@ openrc_init_files = []
 #   * file - source sysconf file (required)
 sysconf_files = []
 
+# virt_install_dirs:
+#   list of directories to create during installation
+virt_install_dirs = []
+
 
 # list subdirectories
 
@@ -774,3 +778,15 @@ foreach sysconf : sysconf_files
     rename: [ sysconf['name'] ],
   )
 endforeach
+
+
+# Install empty directories
+
+virt_install_dirs += [
+  localstatedir / 'cache' / 'libvirt',
+  localstatedir / 'lib' / 'libvirt' / 'images',
+  localstatedir / 'lib' / 'libvirt' / 'filesystems',
+  localstatedir / 'lib' / 'libvirt' / 'boot',
+]
+
+meson.add_install_script(install_dirs_prog.path(), virt_install_dirs)
diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am
index 2202903870f..8482f924a15 100644
--- a/src/network/Makefile.inc.am
+++ b/src/network/Makefile.inc.am
@@ -10,9 +10,6 @@ INSTALL_DATA_DIRS += network
 UUID=$(shell uuidgen 2>/dev/null)
 
 install-data-network:
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
-	$(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/network"
 	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
 	$(INSTALL_DATA) $(srcdir)/network/default.xml \
 	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
@@ -38,8 +35,6 @@ uninstall-data-network:
 	rm -f $(DESTDIR)$(confdir)/qemu/networks/default.xml
 	rmdir "$(DESTDIR)$(confdir)/qemu/networks/autostart" || :
 	rmdir "$(DESTDIR)$(confdir)/qemu/networks" || :
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
-	rmdir "$(DESTDIR)$(runstatedir)/libvirt/network" ||:
 if WITH_FIREWALLD_ZONE
 	rm -f  $(DESTDIR)$(prefix)/lib/firewalld/zones/libvirt.xml
 endif WITH_FIREWALLD_ZONE
diff --git a/src/network/meson.build b/src/network/meson.build
index 35391698d6d..c2085091bce 100644
--- a/src/network/meson.build
+++ b/src/network/meson.build
@@ -77,4 +77,10 @@ if conf.has('WITH_NETWORK')
     'name': 'virtnetworkd',
     'file': files('virtnetworkd.sysconf'),
   }
+
+  virt_install_dirs += [
+    localstatedir / 'lib' / 'libvirt' / 'network',
+    localstatedir / 'lib' / 'libvirt' / 'dnsmasq',
+    runstatedir / 'libvirt' / 'network',
+  ]
 endif
diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am
index 6d1e9e78148..f665cb1f130 100644
--- a/src/qemu/Makefile.inc.am
+++ b/src/qemu/Makefile.inc.am
@@ -2,32 +2,3 @@
 
 DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES))
 STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES))
-
-if WITH_QEMU
-
-INSTALL_DATA_DIRS += qemu
-
-install-data-qemu:
-	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
-	$(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/qemu"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/swtpm"
-	$(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/qemu/swtpm"
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/swtpm/libvirt/qemu"
-
-uninstall-data-qemu:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" ||:
-	rmdir "$(DESTDIR)$(runstatedir)/libvirt/qemu" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/swtpm"
-	rmdir "$(DESTDIR)$(runstatedir)/libvirt/qemu/swtpm" ||:
-	rmdir "$(DESTDIR)$(localstatedir)/log/swtpm/libvirt/qemu" ||:
-
-endif WITH_QEMU
-
-.PHONY: \
-	install-data-qemu \
-	uninstall-data-qemu \
-	$(NULL)
diff --git a/src/qemu/meson.build b/src/qemu/meson.build
index a7a7b4801ca..7bdaf6c19bd 100644
--- a/src/qemu/meson.build
+++ b/src/qemu/meson.build
@@ -157,4 +157,14 @@ if conf.has('WITH_QEMU')
     'name': 'virtqemud',
     'file': files('virtqemud.sysconf'),
   }
+
+  virt_install_dirs += [
+    localstatedir / 'lib' / 'libvirt' / 'qemu',
+    runstatedir / 'libvirt' / 'qemu',
+    localstatedir / 'cache' / 'libvirt' / 'qemu',
+    localstatedir / 'log' / 'libvirt' / 'qemu',
+    localstatedir / 'lib' / 'libvirt' / 'swtpm',
+    runstatedir / 'libvirt' / 'qemu' / 'swtpm',
+    localstatedir / 'log' / 'swtpm' / 'libvirt' / 'qemu',
+  ]
 endif
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index 14c7a8e4141..287dad426cb 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -9,14 +9,6 @@ LOGROTATE_FILES_IN += \
 
 if WITH_LIBVIRTD
 
-INSTALL_DATA_DIRS += remote
-
-install-data-remote:
-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt"
-
-uninstall-data-remote:
-	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||:
-
 if WITH_SYSCTL
 # Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
 # /usr/lib/sysctl.d/ even when libdir is /usr/lib64
@@ -60,11 +52,6 @@ endif WITH_POLKIT
 
 endif WITH_LIBVIRTD
 
-.PHONY: \
-	install-data-remote \
-	uninstall-data-remote \
-	$(NULL)
-
 # This is needed for clients too, so can't wrap in
 # the WITH_LIBVIRTD conditional
 if WITH_SASL
diff --git a/src/remote/meson.build b/src/remote/meson.build
index cc5a24d1e68..b18754d02c1 100644
--- a/src/remote/meson.build
+++ b/src/remote/meson.build
@@ -192,6 +192,10 @@ if conf.has('WITH_REMOTE')
       'name': 'virtproxyd',
       'file': files('virtproxyd.sysconf'),
     }
+
+    virt_install_dirs += [
+      localstatedir / 'log' / 'libvirt',
+    ]
   endif
 endif
 
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux