Patchwork [2/7] package_rpm.bbclass: Add RPMSPEC_PREAMBLE

login
register
mail settings
Submitter Mark Hatle
Date Dec. 23, 2011, 1:01 a.m.
Message ID <3b7b0bf4be40d429749f046108d0cbb82eaa2962.1324601996.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/17531/
State Accepted
Commit c01a92408d267bcc5365bf8495035f6021a49ced
Headers show

Comments

Mark Hatle - Dec. 23, 2011, 1:01 a.m.
Add a way to add arbitrary text to the top of a spec file.  This
can be useful for adding specific tags to the produced binaries for
tracking purposes.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/package_rpm.bbclass |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 469526b..d03dc3f 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -817,6 +817,12 @@  python write_specfile () {
 	except OSError:
 		raise bb.build.FuncFailed("unable to open spec file for writing.")
 
+	# RPMSPEC_PREAMBLE is a way to add arbitrary text to the top
+	# of the generated spec file
+	external_preamble = d.getVar("RPMSPEC_PREAMBLE", True)
+	if external_preamble:
+		specfile.write(external_preamble + "\n")
+
 	for line in spec_preamble_top:
 		specfile.write(line + "\n")