[libvirt] [PATCH 4/4] examples: Install under $(docdir)
Daniel P. Berrangé
berrange at redhat.com
Mon May 13 11:03:23 UTC 2019
On Fri, May 10, 2019 at 08:51:20PM +0200, Andrea Bolognani wrote:
> Our build system doesn't currently install the various
> example programs provided along libvirt; however, both the
> upstream .spec file and the Debian packaging go out of
> their way to make sure these useful demos are included in
> the respective documentation packages.
>
> Moreover, doing so without help from the upstream build
> system is easy to get wrong: the libvirt-docs RPM package,
> for example, ends up missing one of the examples and
> including a bunch of empty .deps/ directories.
>
> Install the examples in $(docdir) as part of our regular
> procedure, so that users and downstreams don't have to do
> anything special about them.
>
> Signed-off-by: Andrea Bolognani <abologna at redhat.com>
> ---
> examples/Makefile.am | 11 +++++++++++
> libvirt.spec.in | 12 ------------
> 2 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/examples/Makefile.am b/examples/Makefile.am
> index ee7d3e6b2c..c7688c7c3d 100644
> --- a/examples/Makefile.am
> +++ b/examples/Makefile.am
> @@ -84,6 +84,17 @@ INSTALL_DATA_LOCAL += install-nwfilter-local
> UNINSTALL_LOCAL += uninstall-nwfilter-local
> endif WITH_NWFILTER
>
> +examplesdir = $(docdir)/examples
> +
> install-data-local: $(INSTALL_DATA_LOCAL)
> + $(mkinstalldirs) $(DESTDIR)$(examplesdir)
> + for p in $(noinst_PROGRAMS); do \
> + d=$$(dirname $$p); \
> + $(mkinstalldirs) $(DESTDIR)$(examplesdir)/$$d; \
> + $(INSTALL_DATA) $(srcdir)/$${p}.c $(DESTDIR)$(examplesdir)/$$d/; \
> + done
>
> uninstall-local: $(UNINSTALL_LOCAL)
> + for p in $(noinst_PROGRAMS); do \
> + rm -f $(DESTDIR)$(examplesdir)/$${p}.c; \
> + done
This breaks Windows builds, because the program names includes '.exe'
suffix. Instead of copying/deleting example.c, we try to copy/delete
example.exe.c
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 :|
More information about the libvir-list
mailing list