meson: src: install empty directories

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-23 12:41:32 +02:00
parent 3d1bd8e8bb
commit c6193d9ee9
16 changed files with 73 additions and 113 deletions

View File

@ -0,0 +1,9 @@
#!/usr/bin/env python3
import os
import sys
destdir = os.environ.get('DESTDIR', os.sep)
for dirname in sys.argv[1:]:
os.makedirs(os.path.join(destdir, dirname.strip(os.sep)), exist_ok=True)

View File

@ -20,6 +20,7 @@ scripts = [
'hyperv_wmi_generator.py',
'meson-gen-def.py',
'meson-gen-sym.py',
'meson-install-dirs.py',
'meson-python.sh',
'mock-noinline.py',
'prohibit-duplicate-header.py',

View File

@ -234,15 +234,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" ||:

View File

@ -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

View File

@ -76,4 +76,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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -159,4 +159,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

View File

@ -211,6 +211,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
@ -800,3 +804,18 @@ 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(
meson_python_prog.path(), python3_prog.path(), meson_install_dirs_prog.path(),
virt_install_dirs,
)

View File

@ -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

View File

@ -76,4 +76,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

View File

@ -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)

View File

@ -160,4 +160,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

View File

@ -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

View File

@ -209,6 +209,10 @@ if conf.has('WITH_REMOTE')
'name': 'virtproxyd',
'file': files('virtproxyd.sysconf'),
}
virt_install_dirs += [
localstatedir / 'log' / 'libvirt',
]
endif
endif