[libvirt] [PATCH 0/7] Various cleanups to the build system

Came for 6/7, stayed for the yak shaving. Andrea Bolognani (7): remote: Move polkitdir definition remote: Define polkit{actions,rules}dir remote: Define sysctldir remote: Define sasldir src: Simplify installing/uninstalling data apparmor: Move static data out of examples/ src: Add Vim modeline to Makefile.am snippets examples/Makefile.am | 40 ---------- src/Makefile.am | 54 ++++++------- src/access/Makefile.inc.am | 2 + src/admin/Makefile.inc.am | 2 + src/bhyve/Makefile.inc.am | 2 + src/conf/Makefile.inc.am | 2 + src/cpu/Makefile.inc.am | 2 + src/cpu_map/Makefile.inc.am | 2 + src/esx/Makefile.inc.am | 2 + src/hyperv/Makefile.inc.am | 2 + src/interface/Makefile.inc.am | 2 + src/libxl/Makefile.inc.am | 2 + src/locking/Makefile.inc.am | 2 + src/logging/Makefile.inc.am | 2 + src/lxc/Makefile.inc.am | 2 + src/network/Makefile.inc.am | 2 + src/node_device/Makefile.inc.am | 2 + src/nwfilter/Makefile.inc.am | 2 + src/openvz/Makefile.inc.am | 2 + src/phyp/Makefile.inc.am | 2 + src/qemu/Makefile.inc.am | 2 + src/remote/Makefile.inc.am | 75 +++++++++---------- src/rpc/Makefile.inc.am | 2 + src/secret/Makefile.inc.am | 2 + src/security/Makefile.inc.am | 42 +++++++++++ .../security}/apparmor/TEMPLATE.lxc | 0 .../security}/apparmor/TEMPLATE.qemu | 0 .../security}/apparmor/libvirt-lxc | 0 .../security}/apparmor/libvirt-qemu | 0 .../apparmor/usr.lib.libvirt.virt-aa-helper | 0 .../security}/apparmor/usr.sbin.libvirtd | 0 src/storage/Makefile.inc.am | 2 + src/test/Makefile.inc.am | 2 + src/util/Makefile.inc.am | 2 + src/vbox/Makefile.inc.am | 2 + src/vmware/Makefile.inc.am | 2 + src/vmx/Makefile.inc.am | 2 + src/vz/Makefile.inc.am | 2 + src/xenapi/Makefile.inc.am | 2 + src/xenconfig/Makefile.inc.am | 2 + 40 files changed, 161 insertions(+), 110 deletions(-) rename {examples => src/security}/apparmor/TEMPLATE.lxc (100%) rename {examples => src/security}/apparmor/TEMPLATE.qemu (100%) rename {examples => src/security}/apparmor/libvirt-lxc (100%) rename {examples => src/security}/apparmor/libvirt-qemu (100%) rename {examples => src/security}/apparmor/usr.lib.libvirt.virt-aa-helper (100%) rename {examples => src/security}/apparmor/usr.sbin.libvirtd (100%) -- 2.20.1

No need to have two conditional blocks. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/remote/Makefile.inc.am | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index d188c4e348..04a2ec8cc0 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -123,10 +123,6 @@ conf_DATA += remote/libvirtd.conf CLEANFILES += test_libvirtd.aug -if WITH_POLKIT -policydir = $(datadir)/polkit-1/actions -endif WITH_POLKIT - man8_MANS += libvirtd.8 libvirtd_SOURCES = $(LIBVIRTD_SOURCES) @@ -211,6 +207,8 @@ uninstall-sysctl: endif ! WITH_SYSCTL if WITH_POLKIT +policydir = $(datadir)/polkit-1/actions + install-polkit:: $(MKDIR_P) $(DESTDIR)$(policydir) $(INSTALL_DATA) $(srcdir)/remote/libvirtd.policy \ -- 2.20.1

Avoid building the same path several times. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/remote/Makefile.inc.am | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 04a2ec8cc0..d9f559dce5 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -207,21 +207,22 @@ uninstall-sysctl: endif ! WITH_SYSCTL if WITH_POLKIT -policydir = $(datadir)/polkit-1/actions +polkitactionsdir = $(datadir)/polkit-1/actions +polkitrulesdir = $(datadir)/polkit-1/rules.d install-polkit:: - $(MKDIR_P) $(DESTDIR)$(policydir) + $(MKDIR_P) $(DESTDIR)$(polkitactionsdir) $(INSTALL_DATA) $(srcdir)/remote/libvirtd.policy \ - $(DESTDIR)$(policydir)/org.libvirt.unix.policy - $(MKDIR_P) $(DESTDIR)$(datadir)/polkit-1/rules.d + $(DESTDIR)$(polkitactionsdir)/org.libvirt.unix.policy + $(MKDIR_P) $(DESTDIR)$(polkitrulesdir) $(INSTALL_DATA) $(srcdir)/remote/libvirtd.rules \ - $(DESTDIR)$(datadir)/polkit-1/rules.d/50-libvirt.rules + $(DESTDIR)$(polkitrulesdir)/50-libvirt.rules uninstall-polkit:: - rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy - rmdir $(DESTDIR)$(policydir) || : - rm -f $(DESTDIR)$(datadir)/polkit-1/rules.d/50-libvirt.rules - rmdir $(DESTDIR)$(datadir)/polkit-1/rules.d || : + rm -f $(DESTDIR)$(polkitactionsdir)/org.libvirt.unix.policy + rmdir $(DESTDIR)$(polkitactionsdir) || : + rm -f $(DESTDIR)$(polkitrulesdir)/50-libvirt.rules + rmdir $(DESTDIR)$(polkitrulesdir) || : else ! WITH_POLKIT install-polkit:: -- 2.20.1

On Wed, Jan 09, 2019 at 07:35:49PM +0100, Andrea Bolognani wrote:
Avoid building the same path several times.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/remote/Makefile.inc.am | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 04a2ec8cc0..d9f559dce5 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -207,21 +207,22 @@ uninstall-sysctl: endif ! WITH_SYSCTL
if WITH_POLKIT -policydir = $(datadir)/polkit-1/actions
polkitdir = $(datadir)/polkit-1 might be a nice little addition to the patch, but I don't care that much. Reviewed-by: Erik Skultety <eskultet@redhat.com>

On Thu, 2019-01-10 at 09:33 +0100, Erik Skultety wrote:
polkitdir = $(datadir)/polkit-1 might be a nice little addition to the patch, but I don't care that much.
I've implemented your suggestion and pushed the first four patches in the series. -- Andrea Bolognani / Red Hat / Virtualization

Avoid building the same path several times. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/remote/Makefile.inc.am | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index d9f559dce5..0633b05768 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -193,14 +193,16 @@ check-augeas-remote: test_libvirtd.aug 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 +sysctldir = $(prefix)/lib/sysctl.d + install-sysctl: - $(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d + $(MKDIR_P) $(DESTDIR)$(sysctldir) $(INSTALL_DATA) $(srcdir)/remote/libvirtd.sysctl \ - $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf + $(DESTDIR)$(sysctldir)/60-libvirtd.conf uninstall-sysctl: - rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf - rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || : + rm -f $(DESTDIR)$(sysctldir)/60-libvirtd.conf + rmdir $(DESTDIR)$(sysctldir) || : else ! WITH_SYSCTL install-sysctl: uninstall-sysctl: -- 2.20.1

On Wed, Jan 09, 2019 at 07:35:50PM +0100, Andrea Bolognani wrote:
Avoid building the same path several times.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Reviewed-by: Erik Skultety <eskultet@redhat.com>

Avoid building the same path several times. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/remote/Makefile.inc.am | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 0633b05768..5ef082c595 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -247,14 +247,16 @@ endif ! WITH_LIBVIRTD # This is needed for clients too, so can't wrap in # the WITH_LIBVIRTD conditional if WITH_SASL +sasldir = $(sysconfdir)/sasl2 + install-sasl: - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/ + $(MKDIR_P) $(DESTDIR)$(sasldir) $(INSTALL_DATA) $(srcdir)/remote/libvirtd.sasl \ - $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf + $(DESTDIR)$(sasldir)/libvirt.conf uninstall-sasl: - rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf - rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || : + rm -f $(DESTDIR)$(sasldir)/libvirt.conf + rmdir $(DESTDIR)$(sasldir) || : else ! WITH_SASL install-sasl: uninstall-sasl: -- 2.20.1

On Wed, Jan 09, 2019 at 07:35:51PM +0100, Andrea Bolognani wrote:
Avoid building the same path several times.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Reviewed-by: Erik Skultety <eskultet@redhat.com>

Instead of defining targets conditionally and depending on them unconditionally, define a couple of variables and conditionally add targets to them. In addition to removing a bunch of useless code, this has the nice effect of no longer requiring the main Makefile.am to have any knowledge about the contents of the various snippets it includes. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/Makefile.am | 54 ++++++++++++++++---------------------- src/remote/Makefile.inc.am | 30 +++++++++------------ 2 files changed, 34 insertions(+), 50 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index d3e8a1b572..ce1a810a0f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -72,6 +72,8 @@ STATEFUL_DRIVER_SOURCE_FILES = noinst_LTLIBRARIES = mod_LTLIBRARIES = INSTALL_DATA_DIRS = +INSTALL_DATA_LOCAL = +UNINSTALL_LOCAL = libvirt_la_BUILT_LIBADD = SYM_FILES = USED_SYM_FILES = @@ -805,10 +807,10 @@ install-logrotate: $(LOGROTATE_FILES) uninstall-logrotate: rm -f $(LOGROTATE_FILES:%.logrotate=$(DESTDIR)$(sysconfdir)/logrotate.d/%) rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || : -else ! WITH_LIBVIRTD -install-logrotate: -uninstall-logrotate: -endif ! WITH_LIBVIRTD + +INSTALL_DATA_LOCAL += install-logrotate +UNINSTALL_LOCAL += uninstall-logrotate +endif WITH_LIBVIRTD if LIBVIRT_INIT_SCRIPT_RED_HAT install-init:: $(SYSVINIT_FILES) install-sysconfig @@ -824,10 +826,10 @@ uninstall-init:: uninstall-sysconfig BUILT_SOURCES += $(SYSVINIT_FILES) DISTCLEANFILES += $(SYSVINIT_FILES) -else ! LIBVIRT_INIT_SCRIPT_RED_HAT -install-init:: -uninstall-init:: -endif ! LIBVIRT_INIT_SCRIPT_RED_HAT + +INSTALL_DATA_LOCAL += install-init +UNINSTALL_LOCAL += uninstall-init +endif LIBVIRT_INIT_SCRIPT_RED_HAT %.8: %.8.in $(top_srcdir)/configure.ac @@ -847,7 +849,6 @@ EXTRA_DIST += \ $(NULL) -if WITH_LIBVIRTD if LIBVIRT_INIT_SCRIPT_SYSTEMD SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system @@ -866,19 +867,14 @@ install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig uninstall-systemd: uninstall-sysconfig rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%) rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || : -else ! LIBVIRT_INIT_SCRIPT_SYSTEMD -install-systemd: -uninstall-systemd: -endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD -else ! WITH_LIBVIRTD -install-systemd: -uninstall-systemd: -endif ! WITH_LIBVIRTD + +INSTALL_DATA_LOCAL += install-systemd +UNINSTALL_LOCAL += uninstall-systemd +endif LIBVIRT_INIT_SCRIPT_SYSTEMD EXTRA_DIST += $(UPSTART_FILES) -if WITH_LIBVIRTD if LIBVIRT_INIT_SCRIPT_UPSTART install-upstart: install-sysconfig @@ -897,14 +893,10 @@ uninstall-upstart: uninstall-sysconfig rm -f $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \ done rmdir $(DESTDIR)$(sysconfdir)/event.d || : -else ! LIBVIRT_INIT_SCRIPT_UPSTART -install-upstart: -uninstall-upstart: -endif ! LIBVIRT_INIT_SCRIPT_UPSTART -else ! WITH_LIBVIRTD -install-upstart: -uninstall-upstart: -endif ! WITH_LIBVIRTD + +INSTALL_DATA_LOCAL += install-upstart +UNINSTALL_LOCAL += uninstall-upstart +endif LIBVIRT_INIT_SCRIPT_UPSTART EXTRA_DIST += dtrace2systemtap.pl @@ -1003,17 +995,15 @@ libvirt_nss_la_LIBADD = \ endif WITH_NSS -install-data-local: install-init install-systemd install-upstart \ - install-sysctl install-polkit install-sasl \ - install-logrotate $(INSTALL_DATA_DIRS:%=install-data-%) +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-init uninstall-systemd uninstall-upstart \ - uninstall-sysctl uninstall-polkit uninstall-sasl \ - uninstall-logrotate $(INSTALL_DATA_DIRS:%=uninstall-data-%) +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" ||: diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 5ef082c595..4a415d4482 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -203,10 +203,10 @@ install-sysctl: uninstall-sysctl: rm -f $(DESTDIR)$(sysctldir)/60-libvirtd.conf rmdir $(DESTDIR)$(sysctldir) || : -else ! WITH_SYSCTL -install-sysctl: -uninstall-sysctl: -endif ! WITH_SYSCTL + +INSTALL_DATA_LOCAL += install-sysctl +UNINSTALL_LOCAL += uninstall-sysctl +endif WITH_SYSCTL if WITH_POLKIT polkitactionsdir = $(datadir)/polkit-1/actions @@ -226,17 +226,11 @@ uninstall-polkit:: rm -f $(DESTDIR)$(polkitrulesdir)/50-libvirt.rules rmdir $(DESTDIR)$(polkitrulesdir) || : -else ! WITH_POLKIT -install-polkit:: -uninstall-polkit:: -endif ! WITH_POLKIT +INSTALL_DATA_LOCAL += install-polkit +UNINSTALL_LOCAL += uninstall-polkit +endif WITH_POLKIT -else ! WITH_LIBVIRTD -install-polkit:: -uninstall-polkit:: -install-sysctl:: -uninstall-sysctl:: -endif ! WITH_LIBVIRTD +endif WITH_LIBVIRTD .PHONY: \ install-data-remote \ @@ -257,10 +251,10 @@ install-sasl: uninstall-sasl: rm -f $(DESTDIR)$(sasldir)/libvirt.conf rmdir $(DESTDIR)$(sasldir) || : -else ! WITH_SASL -install-sasl: -uninstall-sasl: -endif ! WITH_SASL + +INSTALL_DATA_LOCAL += install-sasl +UNINSTALL_LOCAL += uninstall-sasl +endif WITH_SASL libvirtd.init: remote/libvirtd.init.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -- 2.20.1

On Wed, Jan 09, 2019 at 07:35:52PM +0100, Andrea Bolognani wrote:
Instead of defining targets conditionally and depending on them unconditionally, define a couple of variables and conditionally add targets to them.
In addition to removing a bunch of useless code, this has the nice effect of no longer requiring the main Makefile.am to have any knowledge about the contents of the various snippets it includes.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/Makefile.am | 54 ++++++++++++++++---------------------- src/remote/Makefile.inc.am | 30 +++++++++------------ 2 files changed, 34 insertions(+), 50 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index d3e8a1b572..ce1a810a0f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -72,6 +72,8 @@ STATEFUL_DRIVER_SOURCE_FILES = noinst_LTLIBRARIES = mod_LTLIBRARIES = INSTALL_DATA_DIRS = +INSTALL_DATA_LOCAL = +UNINSTALL_LOCAL = libvirt_la_BUILT_LIBADD = SYM_FILES = USED_SYM_FILES = @@ -805,10 +807,10 @@ install-logrotate: $(LOGROTATE_FILES) uninstall-logrotate: rm -f $(LOGROTATE_FILES:%.logrotate=$(DESTDIR)$(sysconfdir)/logrotate.d/%) rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || : -else ! WITH_LIBVIRTD -install-logrotate: -uninstall-logrotate: -endif ! WITH_LIBVIRTD + +INSTALL_DATA_LOCAL += install-logrotate +UNINSTALL_LOCAL += uninstall-logrotate +endif WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT install-init:: $(SYSVINIT_FILES) install-sysconfig @@ -824,10 +826,10 @@ uninstall-init:: uninstall-sysconfig
BUILT_SOURCES += $(SYSVINIT_FILES) DISTCLEANFILES += $(SYSVINIT_FILES) -else ! LIBVIRT_INIT_SCRIPT_RED_HAT -install-init:: -uninstall-init:: -endif ! LIBVIRT_INIT_SCRIPT_RED_HAT + +INSTALL_DATA_LOCAL += install-init +UNINSTALL_LOCAL += uninstall-init +endif LIBVIRT_INIT_SCRIPT_RED_HAT
%.8: %.8.in $(top_srcdir)/configure.ac @@ -847,7 +849,6 @@ EXTRA_DIST += \ $(NULL)
-if WITH_LIBVIRTD
Can we really do ^this? [...]
-if WITH_LIBVIRTD
Similarly here... [..]
-else ! WITH_POLKIT -install-polkit:: -uninstall-polkit:: -endif ! WITH_POLKIT +INSTALL_DATA_LOCAL += install-polkit +UNINSTALL_LOCAL += uninstall-polkit +endif WITH_POLKIT
-else ! WITH_LIBVIRTD
And here I'm also not sure. No comments to the rest. Erik

On Thu, 2019-01-10 at 10:44 +0100, Erik Skultety wrote:
On Wed, Jan 09, 2019 at 07:35:52PM +0100, Andrea Bolognani wrote: [...]
@@ -847,7 +849,6 @@ EXTRA_DIST += \ $(NULL)
-if WITH_LIBVIRTD
Can we really do ^this?
We were already doing so for {,un}install-init so I figured doing it for other similar situations would be reasonable, but after looking at it again perhaps wrapping *that one* in WITH_LIBVIRTD instead makes more sense. I'll respin. -- Andrea Bolognani / Red Hat / Virtualization

These files need to be installed on the system for apparmor support to work, so they don't belong with examples. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- examples/Makefile.am | 40 ------------------- src/security/Makefile.inc.am | 40 +++++++++++++++++++ .../security}/apparmor/TEMPLATE.lxc | 0 .../security}/apparmor/TEMPLATE.qemu | 0 .../security}/apparmor/libvirt-lxc | 0 .../security}/apparmor/libvirt-qemu | 0 .../apparmor/usr.lib.libvirt.virt-aa-helper | 0 .../security}/apparmor/usr.sbin.libvirtd | 0 8 files changed, 40 insertions(+), 40 deletions(-) rename {examples => src/security}/apparmor/TEMPLATE.lxc (100%) rename {examples => src/security}/apparmor/TEMPLATE.qemu (100%) rename {examples => src/security}/apparmor/libvirt-lxc (100%) rename {examples => src/security}/apparmor/libvirt-qemu (100%) rename {examples => src/security}/apparmor/usr.lib.libvirt.virt-aa-helper (100%) rename {examples => src/security}/apparmor/usr.sbin.libvirtd (100%) diff --git a/examples/Makefile.am b/examples/Makefile.am index 76907a1c8f..e2ec6e7fba 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -19,12 +19,6 @@ FILTERS = $(wildcard $(srcdir)/xml/nwfilter/*.xml) EXTRA_DIST = \ - apparmor/TEMPLATE.qemu \ - apparmor/TEMPLATE.lxc \ - apparmor/libvirt-qemu \ - apparmor/libvirt-lxc \ - apparmor/usr.lib.libvirt.virt-aa-helper \ - apparmor/usr.sbin.libvirtd \ lxcconvert/virt-lxc-convert \ polkit/libvirt-acl.rules \ $(wildcard $(srcdir)/systemtap/*.stp) \ @@ -70,40 +64,6 @@ admin_logging_SOURCES = admin/logging.c INSTALL_DATA_LOCAL = UNINSTALL_LOCAL = -if WITH_APPARMOR_PROFILES -apparmordir = $(sysconfdir)/apparmor.d/ -apparmor_DATA = \ - apparmor/usr.lib.libvirt.virt-aa-helper \ - apparmor/usr.sbin.libvirtd \ - $(NULL) - -abstractionsdir = $(apparmordir)/abstractions -abstractions_DATA = \ - apparmor/libvirt-qemu \ - apparmor/libvirt-lxc \ - $(NULL) - -templatesdir = $(apparmordir)/libvirt -templates_DATA = \ - apparmor/TEMPLATE.qemu \ - apparmor/TEMPLATE.lxc \ - $(NULL) - -APPARMOR_LOCAL_DIR = "$(DESTDIR)$(apparmordir)/local" -install-apparmor-local: - $(MKDIR_P) "$(APPARMOR_LOCAL_DIR)" - echo "# Site-specific additions and overrides for \ - 'usr.lib.libvirt.virt-aa-helper'" \ - >"$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper" - -uninstall-apparmor-local: - rm -f "$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper" - rmdir "$(APPARMOR_LOCAL_DIR)" || : - -INSTALL_DATA_LOCAL += install-apparmor-local -UNINSTALL_LOCAL += uninstall-apparmor-local -endif WITH_APPARMOR_PROFILES - if WITH_NWFILTER NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter" diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am index 0ade97d355..b24cdfd083 100644 --- a/src/security/Makefile.inc.am +++ b/src/security/Makefile.inc.am @@ -32,6 +32,12 @@ EXTRA_DIST += \ $(SECURITY_DRIVER_SELINUX_SOURCES) \ $(SECURITY_DRIVER_APPARMOR_SOURCES) \ $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES) \ + security/apparmor/TEMPLATE.qemu \ + security/apparmor/TEMPLATE.lxc \ + security/apparmor/libvirt-qemu \ + security/apparmor/libvirt-lxc \ + security/apparmor/usr.lib.libvirt.virt-aa-helper \ + security/apparmor/usr.sbin.libvirtd \ $(NULL) libvirt_security_manager_la_SOURCES = $(SECURITY_DRIVER_SOURCES) @@ -80,3 +86,37 @@ virt_aa_helper_CFLAGS = \ $(NULL) endif WITH_LIBVIRTD endif WITH_SECDRIVER_APPARMOR + +if WITH_APPARMOR_PROFILES +apparmordir = $(sysconfdir)/apparmor.d/ +apparmor_DATA = \ + security/apparmor/usr.lib.libvirt.virt-aa-helper \ + security/apparmor/usr.sbin.libvirtd \ + $(NULL) + +abstractionsdir = $(apparmordir)/abstractions +abstractions_DATA = \ + security/apparmor/libvirt-qemu \ + security/apparmor/libvirt-lxc \ + $(NULL) + +templatesdir = $(apparmordir)/libvirt +templates_DATA = \ + security/apparmor/TEMPLATE.qemu \ + security/apparmor/TEMPLATE.lxc \ + $(NULL) + +APPARMOR_LOCAL_DIR = "$(DESTDIR)$(apparmordir)/local" +install-apparmor-local: + $(MKDIR_P) "$(APPARMOR_LOCAL_DIR)" + echo "# Site-specific additions and overrides for \ + 'usr.lib.libvirt.virt-aa-helper'" \ + >"$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper" + +uninstall-apparmor-local: + rm -f "$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper" + rmdir "$(APPARMOR_LOCAL_DIR)" || : + +INSTALL_DATA_LOCAL += install-apparmor-local +UNINSTALL_LOCAL += uninstall-apparmor-local +endif WITH_APPARMOR_PROFILES diff --git a/examples/apparmor/TEMPLATE.lxc b/src/security/apparmor/TEMPLATE.lxc similarity index 100% rename from examples/apparmor/TEMPLATE.lxc rename to src/security/apparmor/TEMPLATE.lxc diff --git a/examples/apparmor/TEMPLATE.qemu b/src/security/apparmor/TEMPLATE.qemu similarity index 100% rename from examples/apparmor/TEMPLATE.qemu rename to src/security/apparmor/TEMPLATE.qemu diff --git a/examples/apparmor/libvirt-lxc b/src/security/apparmor/libvirt-lxc similarity index 100% rename from examples/apparmor/libvirt-lxc rename to src/security/apparmor/libvirt-lxc diff --git a/examples/apparmor/libvirt-qemu b/src/security/apparmor/libvirt-qemu similarity index 100% rename from examples/apparmor/libvirt-qemu rename to src/security/apparmor/libvirt-qemu diff --git a/examples/apparmor/usr.lib.libvirt.virt-aa-helper b/src/security/apparmor/usr.lib.libvirt.virt-aa-helper similarity index 100% rename from examples/apparmor/usr.lib.libvirt.virt-aa-helper rename to src/security/apparmor/usr.lib.libvirt.virt-aa-helper diff --git a/examples/apparmor/usr.sbin.libvirtd b/src/security/apparmor/usr.sbin.libvirtd similarity index 100% rename from examples/apparmor/usr.sbin.libvirtd rename to src/security/apparmor/usr.sbin.libvirtd -- 2.20.1

On Wed, Jan 09, 2019 at 07:35:53PM +0100, Andrea Bolognani wrote:
These files need to be installed on the system for apparmor support to work, so they don't belong with examples.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Reviewed-by: Erik Skultety <eskultet@redhat.com>

Vim won't recognize them, and thus not enable niceties such as syntax highlighting, otherwise. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/access/Makefile.inc.am | 2 ++ src/admin/Makefile.inc.am | 2 ++ src/bhyve/Makefile.inc.am | 2 ++ src/conf/Makefile.inc.am | 2 ++ src/cpu/Makefile.inc.am | 2 ++ src/cpu_map/Makefile.inc.am | 2 ++ src/esx/Makefile.inc.am | 2 ++ src/hyperv/Makefile.inc.am | 2 ++ src/interface/Makefile.inc.am | 2 ++ src/libxl/Makefile.inc.am | 2 ++ src/locking/Makefile.inc.am | 2 ++ src/logging/Makefile.inc.am | 2 ++ src/lxc/Makefile.inc.am | 2 ++ src/network/Makefile.inc.am | 2 ++ src/node_device/Makefile.inc.am | 2 ++ src/nwfilter/Makefile.inc.am | 2 ++ src/openvz/Makefile.inc.am | 2 ++ src/phyp/Makefile.inc.am | 2 ++ src/qemu/Makefile.inc.am | 2 ++ src/remote/Makefile.inc.am | 2 ++ src/rpc/Makefile.inc.am | 2 ++ src/secret/Makefile.inc.am | 2 ++ src/security/Makefile.inc.am | 2 ++ src/storage/Makefile.inc.am | 2 ++ src/test/Makefile.inc.am | 2 ++ src/util/Makefile.inc.am | 2 ++ src/vbox/Makefile.inc.am | 2 ++ src/vmware/Makefile.inc.am | 2 ++ src/vmx/Makefile.inc.am | 2 ++ src/vz/Makefile.inc.am | 2 ++ src/xenapi/Makefile.inc.am | 2 ++ src/xenconfig/Makefile.inc.am | 2 ++ 32 files changed, 64 insertions(+) diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am index 6d57ca1a1b..ff9e7d445f 100644 --- a/src/access/Makefile.inc.am +++ b/src/access/Makefile.inc.am @@ -146,3 +146,5 @@ access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \ $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \ lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \ > $(srcdir)/access/viraccessapichecklxc.c + +# vim: filetype=automake diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am index 55d721f0bf..ffbfc34200 100644 --- a/src/admin/Makefile.inc.am +++ b/src/admin/Makefile.inc.am @@ -48,3 +48,5 @@ admin/admin_server_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \ $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \ admin ADMIN $(ADMIN_PROTOCOL) \ > $(srcdir)/admin/admin_server_dispatch_stubs.h + +# vim: filetype=automake diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am index fba1b9ef30..6134f3686c 100644 --- a/src/bhyve/Makefile.inc.am +++ b/src/bhyve/Makefile.inc.am @@ -71,3 +71,5 @@ EXTRA_DIST += \ .PHONY: \ check-augeas-bhyve \ $(NULL) + +# vim: filetype=automake diff --git a/src/conf/Makefile.inc.am b/src/conf/Makefile.inc.am index 219ff350d7..2d22d4614a 100644 --- a/src/conf/Makefile.inc.am +++ b/src/conf/Makefile.inc.am @@ -169,3 +169,5 @@ libvirt_conf_la_CFLAGS = \ $(NULL) libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS) libvirt_conf_la_LIBADD = $(LIBXML_LIBS) + +# vim: filetype=automake diff --git a/src/cpu/Makefile.inc.am b/src/cpu/Makefile.inc.am index 5020d40583..057e571b83 100644 --- a/src/cpu/Makefile.inc.am +++ b/src/cpu/Makefile.inc.am @@ -22,3 +22,5 @@ libvirt_cpu_la_CFLAGS = \ $(AM_CFLAGS) \ $(NULL) libvirt_cpu_la_SOURCES = $(CPU_SOURCES) + +# vim: filetype=automake diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am index 9eeb33e4be..8b71552357 100644 --- a/src/cpu_map/Makefile.inc.am +++ b/src/cpu_map/Makefile.inc.am @@ -60,3 +60,5 @@ cpumap_DATA = \ $(NULL) EXTRA_DIST += $(cpumap_DATA) + +# vim: filetype=automake diff --git a/src/esx/Makefile.inc.am b/src/esx/Makefile.inc.am index 152dd7b979..5ad7f2210c 100644 --- a/src/esx/Makefile.inc.am +++ b/src/esx/Makefile.inc.am @@ -88,3 +88,5 @@ libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES) libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED) endif WITH_ESX + +# vim: filetype=automake diff --git a/src/hyperv/Makefile.inc.am b/src/hyperv/Makefile.inc.am index a768272b72..2e4263f75d 100644 --- a/src/hyperv/Makefile.inc.am +++ b/src/hyperv/Makefile.inc.am @@ -57,3 +57,5 @@ libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS) libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES) endif WITH_HYPERV + +# vim: filetype=automake diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index 08b35d040d..76716fda14 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -40,3 +40,5 @@ libvirt_driver_interface_la_SOURCES += $(INTERFACE_DRIVER_UDEV_SOURCES) endif WITH_UDEV libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la endif WITH_INTERFACE + +# vim: filetype=automake diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 59c136bf4e..77f4e0090c 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -102,3 +102,5 @@ EXTRA_DIST += \ libxl/libvirtd_libxl.aug \ libxl/test_libvirtd_libxl.aug.in \ $(NULL) + +# vim: filetype=automake diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index f2eb2efb7b..42642df731 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -323,3 +323,5 @@ virtlockd.8.in: locking/virtlockd.pod < $@-t1 > $@-t2 && \ rm -f $@-t1 && \ mv $@-t2 $@ + +# vim: filetype=automake diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index ae022ade0b..ec2f91b68b 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -153,3 +153,5 @@ virtlogd-admin.socket: logging/virtlogd-admin.socket.in \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ < $< > $@-t && \ mv $@-t $@ + +# vim: filetype=automake diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 8dd2e9ea9e..a6cff211f5 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -205,3 +205,5 @@ EXTRA_DIST += \ lxc/libvirtd_lxc.aug \ lxc/test_libvirtd_lxc.aug.in \ $(NULL) + +# vim: filetype=automake diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 508c8c0422..992fe5b608 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -104,3 +104,5 @@ EXTRA_DIST += network/default.xml install-data-network \ uninstall-data-network \ $(NULL) + +# vim: filetype=automake diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index 0c3ad51273..63579f2778 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -63,3 +63,5 @@ endif WITH_UDEV libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la endif WITH_NODE_DEVICES + +# vim: filetype=automake diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index 27aa801095..4c0dd9a047 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -40,3 +40,5 @@ libvirt_driver_nwfilter_impl_la_LIBADD = \ $(NULL) libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES) endif WITH_NWFILTER + +# vim: filetype=automake diff --git a/src/openvz/Makefile.inc.am b/src/openvz/Makefile.inc.am index baad737362..f7adcc4528 100644 --- a/src/openvz/Makefile.inc.am +++ b/src/openvz/Makefile.inc.am @@ -26,3 +26,5 @@ USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms else ! WITH_OPENVZ SYM_FILES += $(srcdir)/libvirt_openvz.syms endif ! WITH_OPENVZ + +# vim: filetype=automake diff --git a/src/phyp/Makefile.inc.am b/src/phyp/Makefile.inc.am index 496ff25266..faea97478c 100644 --- a/src/phyp/Makefile.inc.am +++ b/src/phyp/Makefile.inc.am @@ -17,3 +17,5 @@ libvirt_driver_phyp_la_CFLAGS = \ $(NULL) libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES) endif WITH_PHYP + +# vim: filetype=automake diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 2afa67f195..a9da8b1113 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -162,3 +162,5 @@ EXTRA_DIST += \ qemu/THREADS.txt \ libvirt_qemu_probes.d \ $(NULL) + +# vim: filetype=automake diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 4a415d4482..8ac2778b6c 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -323,3 +323,5 @@ libvirtd.8.in: remote/libvirtd.pod < $@-t1 > $@-t2 && \ rm -f $@-t1 && \ mv $@-t2 $@ + +# vim: filetype=automake diff --git a/src/rpc/Makefile.inc.am b/src/rpc/Makefile.inc.am index b8c80528d2..e12258555e 100644 --- a/src/rpc/Makefile.inc.am +++ b/src/rpc/Makefile.inc.am @@ -135,3 +135,5 @@ libvirt_net_rpc_client_la_CFLAGS = \ $(NULL) libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS) libvirt_net_rpc_client_la_LIBADD = $(CYGWIN_EXTRA_LIBADD) + +# vim: filetype=automake diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index 79c2b2d74a..79160437c4 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -36,3 +36,5 @@ libvirt_driver_secret_la_LIBADD = \ libvirt_driver_secret_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES) endif WITH_SECRETS + +# vim: filetype=automake diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am index b24cdfd083..3f10e151bd 100644 --- a/src/security/Makefile.inc.am +++ b/src/security/Makefile.inc.am @@ -120,3 +120,5 @@ uninstall-apparmor-local: INSTALL_DATA_LOCAL += install-apparmor-local UNINSTALL_LOCAL += uninstall-apparmor-local endif WITH_APPARMOR_PROFILES + +# vim: filetype=automake diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index b4400b556f..1553bef6ed 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -389,3 +389,5 @@ libvirt_parthelper_CFLAGS = \ $(PIE_CFLAGS) \ $(NULL) endif WITH_STORAGE_DISK + +# vim: filetype=automake diff --git a/src/test/Makefile.inc.am b/src/test/Makefile.inc.am index d52c281545..49745192b6 100644 --- a/src/test/Makefile.inc.am +++ b/src/test/Makefile.inc.am @@ -24,3 +24,5 @@ libvirt_driver_test_la_CFLAGS = \ $(NULL) libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES) endif WITH_TEST + +# vim: filetype=automake diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index 4295babac3..58f2bb880d 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -336,3 +336,5 @@ util/virkey%.7: util/virkey%.pod < $@-t1 > $@-t2 && \ rm -f $@-t1 && \ mv $@-t2 $@ + +# vim: filetype=automake diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index 8c76f84e82..5057ffe92a 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -74,3 +74,5 @@ libvirt_driver_vbox_impl_la_LIBADD = \ $(NULL) libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES) endif WITH_VBOX + +# vim: filetype=automake diff --git a/src/vmware/Makefile.inc.am b/src/vmware/Makefile.inc.am index 0fbf866030..1dd202ae3e 100644 --- a/src/vmware/Makefile.inc.am +++ b/src/vmware/Makefile.inc.am @@ -25,3 +25,5 @@ USED_SYM_FILES += $(srcdir)/libvirt_vmware.syms else ! WITH_VMWARE SYM_FILES += $(srcdir)/libvirt_vmware.syms endif ! WITH_VMWARE + +# vim: filetype=automake diff --git a/src/vmx/Makefile.inc.am b/src/vmx/Makefile.inc.am index b9bf6ef690..b635484513 100644 --- a/src/vmx/Makefile.inc.am +++ b/src/vmx/Makefile.inc.am @@ -20,3 +20,5 @@ USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms else ! WITH_VMX SYM_FILES += $(srcdir)/libvirt_vmx.syms endif ! WITH_VMX + +# vim: filetype=automake diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index cacdb38795..b457d2b5c1 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -36,3 +36,5 @@ libvirt_driver_vz_impl_la_LIBADD = \ $(LIBNL_LIBS) \ $(NULL) endif WITH_VZ + +# vim: filetype=automake diff --git a/src/xenapi/Makefile.inc.am b/src/xenapi/Makefile.inc.am index 4640e9943f..9179cf104f 100644 --- a/src/xenapi/Makefile.inc.am +++ b/src/xenapi/Makefile.inc.am @@ -26,3 +26,5 @@ libvirt_driver_xenapi_la_LIBADD = \ $(NULL) libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES) endif WITH_XENAPI + +# vim: filetype=automake diff --git a/src/xenconfig/Makefile.inc.am b/src/xenconfig/Makefile.inc.am index a87d69990f..d7d10f76ed 100644 --- a/src/xenconfig/Makefile.inc.am +++ b/src/xenconfig/Makefile.inc.am @@ -26,3 +26,5 @@ USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms else ! WITH_XENCONFIG SYM_FILES += $(srcdir)/libvirt_xenconfig.syms endif ! WITH_XENCONFIG + +# vim: filetype=automake -- 2.20.1

On Wed, Jan 09, 2019 at 07:35:48PM +0100, Andrea Bolognani wrote:
No need to have two conditional blocks.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
Reviewed-by: Erik Skultety <eskultet@redhat.com>

On Wed, Jan 09, 2019 at 07:35:54PM +0100, Andrea Bolognani wrote:
Vim won't recognize them, and thus not enable niceties such as syntax highlighting, otherwise.
So, is there a strict reason for the *inc.am naming? Reading through [1] gave me the necessary background, but is there an inherent issue naming all of the Makefiles in subdirectories to Makefile.am, I mean, we'd still end up including those, or does that go against some automake rules? Erik

On Thu, Jan 10, 2019 at 10:23:07AM +0100, Erik Skultety wrote:
On Wed, Jan 09, 2019 at 07:35:54PM +0100, Andrea Bolognani wrote:
Vim won't recognize them, and thus not enable niceties such as syntax highlighting, otherwise.
So, is there a strict reason for the *inc.am naming? Reading through [1] gave me the necessary background, but is there an inherent issue naming all of the Makefiles in subdirectories to Makefile.am, I mean, we'd still end up including those, or does that go against some automake rules?
I picked Makefile.inc.am because I think it would be confusing to name them Makefile.am when they are not self-contained automake files. They can only ever be used when included from teh real Makefile.am. I'm not inclined to rename them just for sake of editor mode settings. We previously removed editor settings from all files, in favour of putting such configs in the root of the source tree. eg the emacs .dir-locals.el, .ctags, .color_coded.in, etc Assuming this plugin: https://www.vim.org/scripts/script.php?script_id=441 it appears we could have a $GIT/.vimrc file for this purpose. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Thu, Jan 10, 2019 at 10:05:49AM +0000, Daniel P. Berrangé wrote:
On Thu, Jan 10, 2019 at 10:23:07AM +0100, Erik Skultety wrote:
On Wed, Jan 09, 2019 at 07:35:54PM +0100, Andrea Bolognani wrote:
Vim won't recognize them, and thus not enable niceties such as syntax highlighting, otherwise.
So, is there a strict reason for the *inc.am naming? Reading through [1] gave me the necessary background, but is there an inherent issue naming all of the Makefiles in subdirectories to Makefile.am, I mean, we'd still end up including those, or does that go against some automake rules?
I picked Makefile.inc.am because I think it would be confusing to name them Makefile.am when they are not self-contained automake files. They can only ever be used when included from teh real Makefile.am. I'm not inclined to rename them just for sake of editor mode settings.
We previously removed editor settings from all files, in favour of putting such configs in the root of the source tree. eg the emacs .dir-locals.el, .ctags, .color_coded.in, etc
Yeah, I didn't like the vim annotation, since we should not favour a single editor, what you suggest makes more sense if the below plugin works reliably and doesn't mess with all of your favourite .vimrc settings.
Assuming this plugin:
https://www.vim.org/scripts/script.php?script_id=441
it appears we could have a $GIT/.vimrc file for this purpose.
So, I'm not sure I 100% understand what it does from the description, would it only replace ("patch") the stuff that is relevant to the project, leaving all of the other settings coming from your ~/.vimrc config in effect? Erik

On Thu, Jan 10, 2019 at 11:15:43AM +0100, Erik Skultety wrote:
On Thu, Jan 10, 2019 at 10:05:49AM +0000, Daniel P. Berrangé wrote:
On Thu, Jan 10, 2019 at 10:23:07AM +0100, Erik Skultety wrote:
On Wed, Jan 09, 2019 at 07:35:54PM +0100, Andrea Bolognani wrote:
Vim won't recognize them, and thus not enable niceties such as syntax highlighting, otherwise.
So, is there a strict reason for the *inc.am naming? Reading through [1] gave me the necessary background, but is there an inherent issue naming all of the Makefiles in subdirectories to Makefile.am, I mean, we'd still end up including those, or does that go against some automake rules?
I picked Makefile.inc.am because I think it would be confusing to name them Makefile.am when they are not self-contained automake files. They can only ever be used when included from teh real Makefile.am. I'm not inclined to rename them just for sake of editor mode settings.
We previously removed editor settings from all files, in favour of putting such configs in the root of the source tree. eg the emacs .dir-locals.el, .ctags, .color_coded.in, etc
Yeah, I didn't like the vim annotation, since we should not favour a single [> editor, what you suggest makes more sense if the below plugin works reliably and doesn't mess with all of your favourite .vimrc settings.
Assuming this plugin:
https://www.vim.org/scripts/script.php?script_id=441
it appears we could have a $GIT/.vimrc file for this purpose.
So, I'm not sure I 100% understand what it does from the description, would it only replace ("patch") the stuff that is relevant to the project, leaving all of the other settings coming from your ~/.vimrc config in effect?
I'm not sure to be honest. I just googled for "per directory vimrc" and found this. I don't use vim so didn't try it for real. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Thu, 2019-01-10 at 10:23 +0100, Erik Skultety wrote:
On Wed, Jan 09, 2019 at 07:35:54PM +0100, Andrea Bolognani wrote:
Vim won't recognize them, and thus not enable niceties such as syntax highlighting, otherwise.
So, is there a strict reason for the *inc.am naming? Reading through [1]
Missing reference for [1] :)
gave me the necessary background, but is there an inherent issue naming all of the Makefiles in subdirectories to Makefile.am, I mean, we'd still end up including those, or does that go against some automake rules?
I think the use of the .inc.am extension is intended to make it obvious that it's a snippet that will be included rather than a standalone file: as a test, I tried renaming one of the snippets from .inc.am to .am and I was still able to distcheck. CC'ing Dan for context, since he's the one who introduced snippets in the first place. -- Andrea Bolognani / Red Hat / Virtualization
participants (3)
-
Andrea Bolognani
-
Daniel P. Berrangé
-
Erik Skultety