From d9dc32b334cef962246b06ae6ed27a7846f0413f Mon Sep 17 00:00:00 2001 From: Daniel P. Berrangé Date: Jun 22 2018 10:26:03 +0000 Subject: Add ability to re-run autotools when needed by a patch Signed-off-by: Daniel P. Berrangé --- diff --git a/Makefile b/Makefile index 5875b80..21d745c 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,8 @@ BASENAME = $(APP)-$(VERSION) PATCH_DIR = patches/$(BASENAME) +AUTOTOOLS=$(shell test -d $(PATCH_DIR) && grep -E '/(m4/|configure.ac|Makefile.am)' $(PATCH_DIR)/* 1>/dev/null 2>&1 && echo 1 || echo 0) + RPM_BASE = $(APP)-ark-$(VERSION_TAG) RPM_SPEC = build/SPECS/$(RPM_BASE).spec @@ -46,6 +48,7 @@ $(RPM_SPEC): $(RPM_TEMPLATE) -e "s,::DOWNLOAD_URL::,$(DOWNLOAD_URL)," \ -e "s,::PATCH_FILES::,$(PATCH_FILES)," \ -e "s,::PATCH_APPLY::,$(PATCH_APPLY)," \ + -e "s,::AUTOTOOLS::,$(AUTOTOOLS)," \ -e "s,,\n,g" \ < $< > $@ diff --git a/libvirt-ark.spec.in b/libvirt-ark.spec.in index 53c347a..e0dbb25 100644 --- a/libvirt-ark.spec.in +++ b/libvirt-ark.spec.in @@ -77,6 +77,13 @@ BuildRequires: yajl-devel BuildRequires: libtirpc-devel BuildRequires: rpcgen %endif +%if ::AUTOTOOLS:: +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gettext-devel +BuildRequires: libtool +BuildRequires: /usr/bin/pod2man +%endif %description Libvirt archive version %{version} @@ -86,6 +93,9 @@ Libvirt archive version %{version} ::PATCH_APPLY:: %build +%if ::AUTOTOOLS:: +autoreconf -if +%endif ./configure --prefix=/opt/libvirt/%{version} \ --without-python make %{?_smp_mflags}