[PATCH 4/8] Use autoconf to set the spec file Version.

David Shea dshea at redhat.com
Thu Sep 5 14:42:41 UTC 2013


Autoconf is able to do exactly what we want as far as generating
anaconda.spec, which saves us some trouble with tracking the files for
the clean and dist rules.
---
 Makefile.am      | 12 ++----------
 anaconda.spec.in |  2 +-
 configure.ac     |  1 +
 3 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d0949fd..e4b0e88 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,8 +27,7 @@ TESTS = tests/pylint/runpylint.sh \
 		  tests/nosetests.sh \
 		  tests/accelerators/run_check_accelerators.sh
 
-EXTRA_DIST = config.rpath COPYING \
-             anaconda.spec.in
+EXTRA_DIST = config.rpath COPYING
 
 MAINTAINERCLEANFILES = Makefile.in config.guess config.h.in config.sub \
                        depcomp install-sh ltmain.sh missing ABOUT-NLS \
@@ -36,7 +35,7 @@ MAINTAINERCLEANFILES = Makefile.in config.guess config.h.in config.sub \
 		       m4/* config.rpath po/Makefile.in.in po/Rules-quot \
 		       test-driver
 
-CLEANFILES = *~ anaconda.spec
+CLEANFILES = *~
 
 MOSTLYCLEANDIRS = m4
 
@@ -46,16 +45,9 @@ dist_sbin_SCRIPTS     = anaconda
 
 ARCHIVE_TAG   = $(PACKAGE_NAME)-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)
 
-sed_verbose = $(sed_verbose_$(V))
-sed_verbose_ = $(sed_verbose_$(AM_DEFAULT_VERBOSITY))
-sed_verbose_0 = @echo "  SED    "$@;
-
 TX_PULL_ARGS = -a --disable-overwrite
 TX_PUSH_ARGS = -s
 
-$(PACKAGE_NAME).spec: $(PACKAGE_NAME).spec.in
-	$(sed_verbose)sed -e 's/#VERSION#/$(PACKAGE_VERSION)/' < $< > $@
-
 tag:
 	@git tag -s -a -m "Tag as $(ARCHIVE_TAG)" $(ARCHIVE_TAG)
 	@echo "Tagged as $(ARCHIVE_TAG)"
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 443dac1..f1062c0 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -2,7 +2,7 @@
 
 Summary: Graphical system installer
 Name:    anaconda
-Version: #VERSION#
+Version: @PACKAGE_VERSION@
 Release: 1%{?dist}
 License: GPLv2+
 Group:   Applications/System
diff --git a/configure.ac b/configure.ac
index af3c653..28ea1ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -214,6 +214,7 @@ AM_CONDITIONAL(IS_X86_64,
 AC_CONFIG_SUBDIRS([widgets])
 
 AC_CONFIG_FILES([Makefile
+                 anaconda.spec
                  data/Makefile
                  data/command-stubs/Makefile
                  docs/Makefile
-- 
1.8.3.1



More information about the anaconda-patches mailing list