[Ovirt-devel] [PATCH appliance] restore envvar-controlled RPM_FLAGS additions

Jim Meyering jim at meyering.net
Fri Sep 12 21:00:54 UTC 2008


Jim Meyering <jim at meyering.net> wrote:
> I verified that "make ... build" passes,
> but haven't tried setting any of those variables.

That change made modifications to release.mk that are
best avoided, since they'd not be useful for the other
projects that use release.mk, so here's one more iteration
that pulls the appliance-specific bits out into Makefile.am:

smoke test is in progress...

>From 5947d7e7eae24d9f9b4af5a95e1cea6a8cef6d0c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Fri, 12 Sep 2008 22:35:46 +0200
Subject: [PATCH appliance] restore envvar-controlled rpm option additions:

This puts a new appliance-specific definition into Makefile.am,
with only a small hook in the nominally-shared-between-all-ovirt-*
projects release.mk file.
---
 Makefile.am |   13 +++++++++++++
 release.mk  |    5 +++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b59086a..39f7d98 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,6 +28,19 @@ EXTRA_DIST =			\
   repos.ks.in			\
   version

+# FEDORA_URL env var can be set to the root of a fedora mirror
+# OVIRT_URL env var can be set to the root of an ovirt.org mirror
+# SKIP_COMPRESS_IMAGE env var an be set to 1 to skip qcow compression
+# that contains the install tree
+# This variable is used in the rpmbuild-invoking rule in release.mk.
+set_rpm_opts = \
+	test 'x$(SKIP_COMPRESS_IMAGE)' != x			\
+	  && v="--define 'skip_compress_image 1'";		\
+	test 'x$(FEDORA_URL)' != x				\
+	  && v="$$v --define 'fedora_url $(FEDORA_URL)'";	\
+	test 'x$(OVIRT_URL)' != x				\
+	  && v="$$v --define 'ovirt_url $(OVIRT_URL)'"
+
 include release.mk

 pkg_name = $(PACKAGE_NAME)
diff --git a/release.mk b/release.mk
index 7d9ddd0..c63e44b 100644
--- a/release.mk
+++ b/release.mk
@@ -1,5 +1,5 @@
 # Release/version-related Makefile variables and rules.
-# It expects the including Makefile to define the "pkg_name" 
+# It expects the including Makefile to define the "pkg_name"
 # variable, as well as a file named "version" in the current directory.

 srcdir		?= .
@@ -44,7 +44,8 @@ setversion:
 new-rpms: bumprelease rpms

 rpms: tar
-	rpmbuild $(RPM_FLAGS) -ba $(SPEC_FILE)
+	v=; $(set_rpm_opts); \
+	  rpmbuild $(RPM_FLAGS) $$v -ba $(SPEC_FILE)

 publish: rpms
 	rm -f $(OVIRT_CACHE_DIR)/ovirt/$(pkg_name)*
-- 
1.6.0.1.308.gede4c




More information about the ovirt-devel mailing list