]> xenbits.xensource.com Git - libvirt.git/commitdiff
examples: Install under $(docdir)
authorAndrea Bolognani <abologna@redhat.com>
Fri, 10 May 2019 14:32:22 +0000 (16:32 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 13 May 2019 10:02:17 +0000 (12:02 +0200)
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@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
examples/Makefile.am
libvirt.spec.in

index ee7d3e6b2c055d7d44260ce9045eb5b014c3ec9c..c7688c7c3d214e7e047b6bbb71656c8846f08441 100644 (file)
@@ -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
index ea6a04c02a62677b80c2f9568f1a0ab711a675f3..5c27a44fc5430bff7bdf6a3771066709860a4e65 100644 (file)
@@ -1232,8 +1232,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
 
 %make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=%{_unitdir} V=1
 
-make %{?_smp_mflags} -C examples distclean V=1
-
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
 rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la
@@ -1510,16 +1508,6 @@ exit 0
 %doc %{_datadir}/gtk-doc/html/libvirt/*.html
 %doc %{_datadir}/gtk-doc/html/libvirt/*.png
 %doc %{_datadir}/gtk-doc/html/libvirt/*.css
-%doc examples/hellolibvirt
-%doc examples/object-events
-%doc examples/dominfo
-%doc examples/domsuspend
-%doc examples/dommigrate
-%doc examples/openauth
-%doc examples/xml
-%doc examples/rename
-%doc examples/systemtap
-%doc examples/admin
 
 
 %files daemon