]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
spec: make it easier to autoreconf when building rpm
authorEric Blake <eblake@redhat.com>
Mon, 5 Dec 2011 17:22:10 +0000 (10:22 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 17 May 2012 14:22:06 +0000 (08:22 -0600)
Over time, Fedora and RHEL RPMs have often backported upstream
patches that touched configure.ac and/or Makefile.am; this
necessitates rerunning the autotools for the patch to be effective.
Making this a one-liner spec tweak will make it easier for future
backports to pull patches without having to find all the places
to touch to properly use the autotools.  Meanwhile, there have been
historical instances where an update in the autotools caused FTBFS
situations, so this is not on by default.

* libvirt.spec.in (enable_autotools): New variable, default off.
(BuildRequires): Conditionally add autotools.
(%build): Conditionally use them before configure.
* mingw32-libvirt.spec.in: Likewise.
(cherry picked from commit 9c417636c4045735712c066595ff31539ac88bff)

Conflicts:

mingw32-libvirt.spec.in - caused by change in context

libvirt.spec.in
mingw32-libvirt.spec.in

index cfc3a43ab8f59994f1447447e471f1e876825a49..8579ba8ffa8af4c0b03543d6f1a828fb316d2853 100644 (file)
@@ -8,6 +8,11 @@
   sed -ne 's/^\.fc\?\([0-9]\+\).*/%%define fedora \1/p')}
 %endif
 
+# Default to skipping autoreconf.  Distros can change just this one line
+# (or provide a command-line override) if they backport any patches that
+# touch configure.ac or Makefile.am.
+%{!?enable_autotools:%define enable_autotools 0}
+
 # A client only build will create a libvirt.so only containing
 # the generic RPC driver, and test driver and no libvirtd
 # Default to a full server + client build
@@ -330,6 +335,12 @@ Requires: libcgroup
 Requires: dmidecode
 
 # All build-time requirements
+%if 0%{?enable_autotools}
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: gettext-devel
+BuildRequires: libtool
+%endif
 BuildRequires: python-devel
 
 %if %{with_xen}
@@ -700,6 +711,9 @@ of recent versions of Linux (and other OSes).
 %define with_packager_version --with-packager-version="%{release}"
 
 
+%if 0%{?enable_autotools}
+autoreconf -if
+%endif
 %configure %{?_without_xen} \
            %{?_without_qemu} \
            %{?_without_openvz} \
index f651d11015a69bae201caa87e018c8b27ce2edb4..e071c38eebab3929f10882ec7acc9cfddc6badeb 100644 (file)
@@ -5,6 +5,11 @@
 %define __find_provides %{_mingw32_findprovides}
 %define __debug_install_post %{_mingw32_debug_install_post}
 
+# Default to skipping autoreconf.  Distros can change just this one line
+# (or provide a command-line override) if they backport any patches that
+# touch configure.ac or Makefile.am.
+%{!?enable_autotools:%define enable_autotools 0}
+
 Name:           mingw32-libvirt
 Version:        @VERSION@
 Release:        3%{?dist}%{?extra_release}
@@ -28,6 +33,12 @@ BuildRequires:  mingw32-portablexdr
 BuildRequires:  pkgconfig
 # Need native version for msgfmt
 BuildRequires:  gettext
+%if 0%{?enable_autotools}
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: gettext-devel
+BuildRequires: libtool
+%endif
 
 BuildArch:      noarch
 
@@ -42,6 +53,10 @@ MinGW Windows libvirt virtualization library.
 
 
 %build
+%if 0%{?enable_autotools}
+autoreconf -if
+%endif
+
 # XXX enable SASL in future
 %{_mingw32_configure} \
   --without-sasl \