Another convenience borrowed from libvirt's build files. If a
downstream distro backports a patch that modifies configure.ac or one
of the Makefile.am's, the files in the source tarball will be out of
date and will need to be regerated during the build. This can now be
easily done by simply setting enable_autotools to 1 in the specfile.
---
netcf.spec.in | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/netcf.spec.in b/netcf.spec.in
index bfd4d86..5979bd4 100644
--- a/netcf.spec.in
+++ b/netcf.spec.in
@@ -9,6 +9,11 @@ URL:
https://fedorahosted.org/netcf/
Source0:
https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# 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}
+
# Fedora 20 / RHEL-7 are where netcf first uses systemd. Although earlier
# Fedora has systemd, netcf still used sysvinit there.
%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
@@ -24,6 +29,13 @@ Requires(post): systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
+%if 0%{?enable_autotools}
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: gettext-devel
+BuildRequires: libtool
+BuildRequires: /usr/bin/pod2man
+%endif
BuildRequires: readline-devel augeas-devel >= 0.5.2
BuildRequires: libxml2-devel libxslt-devel
@@ -83,6 +95,10 @@ The libraries for %{name}.
%endif
+%if 0%{?enable_autotools}
+ autoreconf -if
+%endif
+
%configure --disable-static \
%{?_with_libnl1} \
%{sysinit}
--
1.8.4.2